/* ═══════════════════════════════════════════════════════════════
   KishKids Chat Widget – Ultra Modern Floating UI
   ═══════════════════════════════════════════════════════════════ */

:root {
    --kc-accent:       #25D366;
    --kc-radius:       18px;
    --kc-shadow:       0 12px 48px rgba(0,0,0,.22);
    --kc-panel-w:      340px;
    --kc-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --kc-ease:         cubic-bezier(.4, 0, .2, 1);
}

/* ── Wrapper ─────────────────────────────────────────────────── */
.kc-chat {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    font-family: var(--kc-font);
}
.kc-chat--right { right: 24px; }
.kc-chat--left  { left:  24px; }

@media (max-width: 600px) {
    .kc-chat--hide-mobile { display: none !important; }
    .kc-chat { bottom: 16px; }
    .kc-chat--right { right: 16px; }
    .kc-chat--left  { left:  16px; }
}

/* ── FAB button ──────────────────────────────────────────────── */
.kc-chat__fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--kc-accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0,0,0,.25);
    transition: transform .25s var(--kc-ease), box-shadow .25s var(--kc-ease);
    position: relative;
    color: #fff;
}
.kc-chat__fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 32px rgba(0,0,0,.3);
}
.kc-chat__fab:focus-visible {
    outline: 3px solid var(--kc-accent);
    outline-offset: 3px;
}

/* ripple pulse */
.kc-chat__fab::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: var(--kc-accent);
    opacity: .3;
    animation: kcPulse 2.5s ease-out infinite;
}
@keyframes kcPulse {
    0%   { transform: scale(.9); opacity: .35; }
    60%  { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.kc-chat__fab-icon { width: 26px; height: 26px; display: flex; }
.kc-chat__fab-icon svg { width: 100%; height: 100%; }
.kc-chat__fab-icon--close { display: none; }

.kc-chat--open .kc-chat__fab-icon--open  { display: none; }
.kc-chat--open .kc-chat__fab-icon--close { display: flex; }
.kc-chat--open .kc-chat__fab::before { animation: none; opacity: 0; }

/* badge */
.kc-chat__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #f44336;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    transition: transform .2s var(--kc-ease), opacity .2s;
}
.kc-chat--open .kc-chat__badge { transform: scale(0); opacity: 0; }

/* ── Panel ───────────────────────────────────────────────────── */
.kc-chat__panel {
    position: absolute;
    bottom: 76px;
    width: var(--kc-panel-w);
    background: #fff;
    border-radius: var(--kc-radius);
    box-shadow: var(--kc-shadow);
    overflow: hidden;
    transform-origin: bottom center;
    transform: scale(.85) translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition:
        transform .3s var(--kc-ease),
        opacity   .3s var(--kc-ease);
}
.kc-chat--right .kc-chat__panel { right: 0; }
.kc-chat--left  .kc-chat__panel { left:  0; }

.kc-chat--open .kc-chat__panel {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 400px) {
    .kc-chat__panel {
        width: calc(100vw - 32px);
    }
    .kc-chat--right .kc-chat__panel { right: 0; }
    .kc-chat--left  .kc-chat__panel { left: 0; }
}

/* ── Header ──────────────────────────────────────────────────── */
.kc-chat__header {
    background: linear-gradient(135deg, var(--kc-accent), color-mix(in srgb, var(--kc-accent) 70%, #000));
    padding: 20px 20px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    position: relative;
}
.kc-chat__header::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0; right: 0;
    height: 24px;
    background: #fff;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.kc-chat__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.5);
}
.kc-chat__avatar svg { width: 36px; height: 36px; }

.kc-chat__header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}
.kc-chat__agent-name  { font-weight: 700; font-size: 15px; line-height: 1.2; }
.kc-chat__agent-title { font-size: 12px; opacity: .85; }

.kc-chat__online-dot {
    position: absolute;
    top: 0; right: -14px;
    width: 9px; height: 9px;
    background: #8BC34A;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 0 rgba(139,195,74,.5);
    animation: kcOnlinePulse 2s infinite;
}
@keyframes kcOnlinePulse {
    0%   { box-shadow: 0 0 0 0 rgba(139,195,74,.5); }
    70%  { box-shadow: 0 0 0 6px rgba(139,195,74,0); }
    100% { box-shadow: 0 0 0 0 rgba(139,195,74,0); }
}

/* ── Body ────────────────────────────────────────────────────── */
.kc-chat__body {
    padding: 28px 20px 16px;
}

.kc-chat__greeting {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #333;
    position: relative;
}
.kc-chat__greeting::before {
    content: '';
    position: absolute;
    top: -7px; left: 18px;
    width: 14px; height: 14px;
    background: #f5f7fa;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.kc-chat__greeting p { margin: 0 0 4px; }
.kc-chat__greeting p:last-child { margin: 0; }
.kc-chat__greeting-sub { color: #777; font-size: 12px; }

/* ── Channels ────────────────────────────────────────────────── */
.kc-chat__channels {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kc-chat__channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #222;
    background: #f9f9f9;
    border: 1px solid #ebebeb;
    transition: background .2s, transform .15s var(--kc-ease), box-shadow .2s;
}
.kc-chat__channel:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-1px);
    color: #111;
}

.kc-chat__channel-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.kc-chat__channel-icon svg { width: 20px; height: 20px; }

.kc-chat__channel--whatsapp  .kc-chat__channel-icon { background: #25D366; }
.kc-chat__channel--messenger .kc-chat__channel-icon { background: linear-gradient(45deg,#0082fb,#00b2ff); }
.kc-chat__channel--email     .kc-chat__channel-icon { background: #EA4335; }

.kc-chat__channel-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.kc-chat__channel-label strong { font-size: 14px; font-weight: 600; }
.kc-chat__channel-label small  { font-size: 11px; color: #888; }

.kc-chat__channel-arrow {
    font-size: 22px;
    color: #ccc;
    line-height: 1;
    transition: transform .2s var(--kc-ease);
}
.kc-chat__channel:hover .kc-chat__channel-arrow {
    transform: translateX(3px);
    color: var(--kc-accent);
}

/* ── Footer ──────────────────────────────────────────────────── */
.kc-chat__footer {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    padding: 10px 20px 16px;
    border-top: 1px solid #f0f0f0;
}

/* ── Dark-mode ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .kc-chat__panel { background: #1e1e1e; }
    .kc-chat__header::after { background: #1e1e1e; }
    .kc-chat__greeting { background: #2a2a2a; color: #ddd; }
    .kc-chat__greeting::before { background: #2a2a2a; }
    .kc-chat__channel { background: #2a2a2a; border-color: #333; color: #eee; }
    .kc-chat__channel:hover { background: #333; color: #fff; }
    .kc-chat__footer { border-color: #2a2a2a; }
}
