/* ============================================================
   KANUPAPA - CALL STYLING (call.css)
   Fullscreen video, multi-party group stage, PiP, controls & captions
   ============================================================ */

/* Incoming Call Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.modal-card {
    border-radius: 24px;
    padding: 2.2rem 1.8rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.incoming-card {
    border: 2px solid #10b981;
}

.caller-avatar-anim {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.3rem;
    margin-bottom: 1.2rem;
}

.request-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
}

/* Fullscreen Video View */
body.in-call {
    overflow: hidden !important;
    height: 100% !important;
    height: 100dvh !important;
    width: 100% !important;
}

body.in-call .top-bar {
    display: none !important;
}

body.in-call .app-container {
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

.fullscreen-video {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #000 !important;
    z-index: 9999 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.remote-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    background: #000;
    transition: object-fit 0.2s ease;
}

.remote-video.fit-contain {
    object-fit: contain !important;
}

.pip-container {
    position: absolute;
    top: 5.2rem;
    right: 1.5rem;
    width: 145px;
    height: 105px;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(56, 189, 248, 0.45);
    background: #000;
    z-index: 150;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    cursor: grab;
    transition: transform 0.15s ease;
}

.local-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.pip-label {
    position: absolute;
    bottom: 6px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* TV News Ticker Banner */
.live-caption-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.92);
    border-top: 3px solid #ef4444;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 120;
    backdrop-filter: blur(8px);
}

.ticker-tag {
    background: #ef4444;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.ticker-text-wrap {
    flex: 1;
    overflow: hidden;
}

#live-caption-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

/* Sleek Compact In-Call Voice Notepad */
.mobile-incall-caption-bar {
    position: absolute;
    bottom: 5.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 440px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 4px 6px 4px 14px;
    z-index: 130;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    transition: bottom 0.25s ease;
}

.mobile-incall-caption-bar.banner-active {
    bottom: 7.6rem;
}

.caption-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.caption-input {
    flex: 1;
    height: 36px;
    padding: 0 0.5rem;
    border: none;
    background: transparent;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.caption-input:focus {
    outline: none;
}

.btn-dictate {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-dictate.active {
    background: #ef4444;
    border-color: #f87171;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.btn-send-caption {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-send-caption:hover {
    background: #059669;
    transform: scale(1.06);
}

.caption-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.btn-send-caption {
    background: #10b981;
    color: white;
    border: none;
    height: 36px;
    padding: 0 0.85rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.btn-send-caption:hover {
    background: #059669;
}

.video-overlay-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    z-index: 140;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 7px 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-btn .btn-lbl {
    display: none !important;
}

.control-btn:hover, .control-btn:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.08);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.active {
    background: #2563eb;
    border-color: #60a5fa;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
}

.control-btn.earpiece-mode {
    background: rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
    color: #fef3c7;
}

.control-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    border-color: #f87171;
    color: white;
    width: 52px;
    height: 52px;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5);
}

.control-btn.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    transform: scale(1.1);
}

.call-timer-wrap {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    z-index: 140;
}

.call-timer {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.relay-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.28);
    border: 1px solid rgba(245, 158, 11, 0.65);
    color: #fef3c7;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: fadeIn 0.3s ease;
}

.relay-mode-badge.hidden {
    display: none !important;
}

.relay-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: pulseOrange 1.5s infinite;
}

@keyframes pulseOrange {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.relay-warning-banner {
    position: absolute;
    top: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(185, 28, 28, 0.95));
    border: 1px solid rgba(254, 202, 202, 0.4);
    color: white;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 150;
    backdrop-filter: blur(10px);
    animation: bounceIn 0.4s ease;
    max-width: 90%;
    text-align: center;
}

.relay-warning-banner.hidden {
    display: none !important;
}


    /* In-Call Mobile Controls */
    .video-overlay-controls {
        bottom: 1.2rem;
        left: 50%;
        transform: translateX(-50%);
        gap: 0.65rem;
        padding: 6px 14px;
        max-width: 95vw;
        border-radius: 999px;
    }

    .control-btn {
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
        border-radius: 50%;
        padding: 0;
    }

    .control-btn.btn-danger {
        width: 48px;
        height: 48px;
    }

    .control-btn .btn-lbl {
        display: none !important;
    }

    .call-timer {
        top: 0.8rem;
        left: 0.8rem;
        font-size: 0.88rem;
        padding: 4px 12px;
    }

    .pip-container {
        top: 0.8rem;
        right: 0.8rem;
        width: 85px;
        height: 115px;
        border-radius: 12px;
    }

    .mobile-incall-caption-bar {
        width: 92%;
        bottom: 4.8rem;
        padding: 3px 6px 3px 12px;
    }

    .mobile-incall-caption-bar.banner-active {
        bottom: 7.2rem;
    }

    #live-caption-text {
        font-size: 1.15rem;
    }
}


}

.attach-circle-link {
    background: linear-gradient(135deg, #10b981, #059669);
}

.attach-tile-label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-align: center;
    white-space: nowrap;
}

/* ==========================================================================
   DOCUMENT & FILE BUBBLE IN CHAT
   ========================================================================== */
.chat-file-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 4px;
    max-width: 320px;
}

.chat-file-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.chat-file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
}

.chat-file-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-file-size {
    font-size: 0.74rem;
    color: #94a3b8;
}

.chat-file-btn {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.18s ease;
    flex-shrink: 0;
}

.chat-file-btn:hover {
    background: #0369a1;
}

/* ==========================================================================
   WEB LINK BUBBLE & CARD IN CHAT
   ========================================================================== */
.chat-link-bubble {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    margin-top: 4px;
    max-width: 340px;
}

.chat-link-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-link-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    word-break: break-word;
}

.chat-link-desc {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.35;
    word-break: break-word;
}

.chat-link-url-text {
    font-size: 0.76rem;
    color: #38bdf8;
    word-break: break-all;
    text-decoration: underline;
}

.chat-link-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #0284c7, #026194);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-top: 4px;
    transition: all 0.18s ease;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.chat-link-open-btn:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

/* Inline auto-detected links in text messages */
.chat-inline-link {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-all;
    font-weight: 600;
}

.chat-inline-link:hover {
    color: #7dd3fc;
}

/* Web Link Share Modal */
.link-modal-card {
    max-width: 440px !important;
    width: 92% !important;
    background: #182234 !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    border-radius: 18px !important;
    padding: 18px 20px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85) !important;
}

/* ==========================================================================
   WHATSAPP-STYLE INLINE CHAT PHOTO & FULLSCREEN ZOOM VIEWER
   ========================================================================== */
.chat-media-wrap {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 4px;
    max-width: 320px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-inline-photo {
    width: 100%;
    max-height: 280px;
    object-fit: cover;
    display: block;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
}

.chat-inline-photo:hover {
    filter: brightness(1.08);
}

.chat-photo-actions-row {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.slideshow-zoom-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 3px 8px;
}

.btn-zoom-ctrl {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 700;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn-zoom-ctrl:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #38bdf8;
    transform: scale(1.08);
}

.zoom-level-badge {
    font-size: 0.82rem;
    font-weight: 700;
    color: #38bdf8;
    min-width: 48px;
    text-align: center;
    user-select: none;
}

.slideshow-zoom-viewport {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    user-select: none;
    touch-action: none;
}

#slideshow-active-img {
    max-height: 80vh;
    max-width: 92vw;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85);
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    will-change: transform;
}

#slideshow-active-img.zoomed {
    cursor: grab;
}

#slideshow-active-img.dragging {
    cursor: grabbing;
    transition: none !important;
}

/* ==========================================================================
   MULTI-PARTY GROUP CALLING & ACTIVE SPEAKER SPOTLIGHT SYSTEM
   ========================================================================== */
.group-call-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: #090e17;
    overflow: hidden;
}

.group-call-container.hidden {
    display: none !important;
}

/* 1. STAGE / SPOTLIGHT VIEW */
.group-stage-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    gap: 10px;
    position: relative;
}

.stage-speaker-card {

/* Enhanced In-Call Caption Bar & Non-Shrinkable Send Button */
.caption-input-row {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
    width: 100% !important;
}

.caption-input {
    flex: 1 1 auto !important;
    min-width: 60px !important;
    height: 38px !important;
    padding: 0 0.6rem !important;
    border: none !important;
    background: transparent !important;
    color: white !important;
    font-size: 0.92rem !important;
    outline: none !important;
}

.btn-dictate {
    flex-shrink: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.15rem !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
}

.btn-send-caption {
    flex-shrink: 0 !important;
    min-width: 68px !important;
    height: 38px !important;
    border-radius: 20px !important;
    background: #10b981 !important;
    color: white !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 0 12px !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.btn-send-caption:hover, .btn-send-caption:focus {
    background: #059669 !important;
    transform: scale(1.04) !important;
}
