/* ═══════════════════════════════════════════════════
   Kerala Nikkah Calls — Stylesheet
   ═══════════════════════════════════════════════════ */
:root {
    --kn-primary: #1a6b3c;
    --kn-gold:    #f0a500;
    --kn-red:     #e53e3e;
    --kn-green:   #22c55e;
    --kn-dark:    #1a202c;
    --kn-muted:   #718096;
    --kn-font:    'Poppins', sans-serif;
    --kn-radius:  16px;
}

/* ══════════════════════════════════════════════════════
   CALL BUTTONS (on profile page)
   ══════════════════════════════════════════════════════ */
.knca-buttons-wrap {
    padding: 16px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.knca-call-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.knca-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid transparent;
    font-family: var(--kn-font);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.knca-btn-video { background: #1a6b3c; color: white; }
.knca-btn-video:hover { background: #145530; }
.knca-btn-audio { background: #3b82f6; color: white; }
.knca-btn-audio:hover { background: #2563eb; }
.knca-btn-chat  { background: #8b5cf6; color: white; }
.knca-btn-chat:hover  { background: #7c3aed; }

.knca-offline-msg { color: #718096; font-size: .82rem; }
.knca-checking    { color: #94a3b8; font-size: .82rem; }

/* Inline icon buttons (in chat header) */
.knca-inline-buttons { display: flex; gap: 6px; }
.knca-icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%; border: 1px solid #e2e8f0;
    background: #f0f4f8; font-size: 1rem;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center;
}
.knca-icon-btn:hover { background: #1a6b3c; border-color: #1a6b3c; }

/* ══════════════════════════════════════════════════════
   OVERLAY
   ══════════════════════════════════════════════════════ */
.knca-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 99999;
    font-family: var(--kn-font);
}

.knca-screen {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}

/* ══════════════════════════════════════════════════════
   INCOMING CALL
   ══════════════════════════════════════════════════════ */
.knca-incoming-wrap {
    text-align: center;
    color: white;
}

.knca-ring-anim {
    position: relative;
    width: 120px; height: 120px;
    margin: 0 auto 20px;
    display: flex; align-items: center; justify-content: center;
}

.knca-ring-circle {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 2px solid var(--kn-green);
    animation: knca-ring 1.5s ease-out infinite;
}
.r1 { animation-delay: 0s; }
.r2 { animation-delay: .5s; }
.r3 { animation-delay: 1s; }

@keyframes knca-ring {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.knca-avatar-placeholder {
    font-size: 3rem;
    width: 80px; height: 80px;
    background: #2d3748;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 1; position: relative;
}
.knca-avatar-placeholder.large { font-size: 3.5rem; width: 96px; height: 96px; }

.knca-caller-name { font-size: 1.4rem; font-weight: 700; margin: 0 0 6px; color: white; }
.knca-call-type-label { color: #94a3b8; font-size: .9rem; margin: 0 0 28px; }

.knca-incoming-actions { display: flex; gap: 32px; justify-content: center; }

.knca-round-btn {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: none; font-size: 1.6rem;
    cursor: pointer; transition: transform .15s;
    display: flex; align-items: center; justify-content: center;
}
.knca-round-btn:hover { transform: scale(1.1); }
.knca-btn-red   { background: var(--kn-red); }
.knca-btn-green { background: var(--kn-green); }

/* ══════════════════════════════════════════════════════
   CALLING / RINGING SCREEN
   ══════════════════════════════════════════════════════ */
.knca-calling-wrap {
    text-align: center; color: white;
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
}

/* ══════════════════════════════════════════════════════
   VIDEO CALL
   ══════════════════════════════════════════════════════ */
.knca-video-wrap {
    position: relative;
    width: 100%; height: 100%;
    background: #000;
}

.knca-remote-video {
    width: 100%; height: 100%;
    object-fit: cover;
    background: #111;
}

.knca-local-video {
    position: absolute;
    bottom: 100px; right: 16px;
    width: 140px; height: 100px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,.3);
    background: #222;
    cursor: pointer;
}

.knca-video-topbar {
    position: absolute; top: 0; left: 0; right: 0;
    padding: 14px 20px;
    background: linear-gradient(rgba(0,0,0,.6), transparent);
    display: flex; justify-content: space-between; align-items: center;
    color: white;
}

.knca-remote-label { font-size: 1rem; font-weight: 600; }
.knca-timer        { font-size: .95rem; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 50px; }
.knca-timer.large  { font-size: 2rem; margin: 8px 0; }

.knca-video-controls {
    position: absolute;
    bottom: 20px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 12px;
    background: rgba(0,0,0,.55);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(8px);
}

.knca-ctrl-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.1);
    color: white; font-size: 1.2rem;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center;
}
.knca-ctrl-btn:hover   { background: rgba(255,255,255,.25); }
.knca-ctrl-btn.active  { background: rgba(255,255,255,.15); }
.knca-ctrl-btn.red     { background: var(--kn-red); border-color: var(--kn-red); }
.knca-ctrl-btn.red:hover { background: #c53030; }

/* Side chat panel during video call */
.knca-side-chat {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 300px;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(12px);
    display: flex; flex-direction: column;
    border-left: 1px solid rgba(255,255,255,.1);
}

.knca-side-msgs { flex: 1; overflow-y: auto; padding: 12px; }

.knca-side-compose {
    display: flex; gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}
.knca-side-compose input {
    flex: 1; background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 20px; padding: 8px 14px;
    color: white; font-size: .85rem; outline: none;
}
.knca-side-compose input::placeholder { color: rgba(255,255,255,.4); }
.knca-side-compose button {
    background: var(--kn-primary); color: white; border: none;
    padding: 8px 14px; border-radius: 20px; cursor: pointer; font-size: .9rem;
}

/* ══════════════════════════════════════════════════════
   AUDIO CALL
   ══════════════════════════════════════════════════════ */
.knca-audio-wrap {
    text-align: center; color: white;
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
}

.knca-audio-pulse {
    position: relative;
    width: 120px; height: 120px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 8px;
}

.knca-pulse-ring {
    position: absolute; inset: -12px;
    border-radius: 50%;
    border: 2px solid var(--kn-green);
    animation: knca-pulse 2s ease-in-out infinite;
}
@keyframes knca-pulse {
    0%, 100% { transform: scale(1); opacity: .6; }
    50%       { transform: scale(1.15); opacity: .2; }
}

.knca-audio-controls { display: flex; gap: 20px; margin-top: 16px; }

/* ══════════════════════════════════════════════════════
   LIVE CHAT (WebRTC data channel)
   ══════════════════════════════════════════════════════ */
.knca-livechat-wrap {
    width: min(480px, calc(100vw - 32px));
    height: min(600px, calc(100vh - 60px));
    background: #1e2430;
    border-radius: var(--kn-radius);
    display: flex; flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
}

.knca-livechat-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--kn-primary);
    color: white;
}

.knca-livechat-header span { font-size: 1rem; font-weight: 600; }
.knca-live-badge { font-size: .72rem; background: var(--kn-gold); color: #1a202c; padding: 2px 8px; border-radius: 50px; font-weight: 700; margin-left: auto; }

.knca-back-btn { background: none; border: none; color: white; font-size: 1.1rem; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.knca-back-btn:hover { background: rgba(255,255,255,.15); }

.knca-chat-msgs {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
}

/* Message bubbles */
.knca-msg { display: flex; flex-direction: column; max-width: 75%; }
.knca-msg-mine  { align-self: flex-end; align-items: flex-end; }
.knca-msg-remote{ align-self: flex-start; align-items: flex-start; }

.knca-msg-bubble {
    padding: 8px 12px; border-radius: 14px;
    font-size: .875rem; line-height: 1.45;
    word-break: break-word;
}
.knca-msg-mine   .knca-msg-bubble { background: var(--kn-primary); color: white; border-bottom-right-radius: 4px; }
.knca-msg-remote .knca-msg-bubble { background: #2d3748; color: #e2e8f0; border-bottom-left-radius: 4px; }

.knca-msg-meta { font-size: .68rem; color: #718096; margin-top: 3px; padding: 0 4px; }

/* Typing indicator */
.knca-typing-indicator {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 16px; color: #718096; font-size: .78rem;
}
.knca-typing-indicator span {
    display: inline-block; width: 6px; height: 6px;
    background: #718096; border-radius: 50%;
    animation: knca-dot 1.2s ease-in-out infinite;
}
.knca-typing-indicator span:nth-child(2) { animation-delay: .2s; }
.knca-typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes knca-dot { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

/* Chat compose */
.knca-chat-compose {
    display: flex; gap: 8px; padding: 12px 14px;
    border-top: 1px solid #2d3748;
    background: #1e2430;
}
.knca-chat-compose input {
    flex: 1; background: #2d3748; border: 1px solid #3d4a5c;
    border-radius: 24px; padding: 10px 16px;
    color: #e2e8f0; font-size: .875rem; outline: none;
    font-family: var(--kn-font);
}
.knca-chat-compose input:focus { border-color: var(--kn-primary); }
.knca-chat-compose input::placeholder { color: #4a5568; }
.knca-chat-compose button {
    width: 40px; height: 40px;
    background: var(--kn-primary); color: white;
    border: none; border-radius: 50%; cursor: pointer;
    font-size: 1rem; display: flex; align-items: center; justify-content: center;
    transition: background .2s; flex-shrink: 0;
}
.knca-chat-compose button:hover { background: #145530; }

/* ══════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════ */
.knca-toast {
    position: fixed;
    bottom: 32px; left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--kn-font);
    font-size: .875rem;
    font-weight: 500;
    z-index: 100000;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.knca-toast-error { background: #e53e3e; color: white; }
.knca-toast-info  { background: #1a202c; color: #e2e8f0; }
.knca-toast-ok    { background: var(--kn-green); color: white; }

/* ══════════════════════════════════════════════════════
   MOBILE
   ══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .knca-local-video { width: 100px; height: 70px; }
    .knca-side-chat   { display: none !important; }
    .knca-video-controls { gap: 8px; padding: 8px 14px; }
    .knca-ctrl-btn { width: 42px; height: 42px; font-size: 1.1rem; }
    .knca-call-actions { flex-direction: column; }
    .knca-btn { justify-content: center; }
}
