/* ==============================================================================
   Teahouse AI — Jonli Telefon Qo'ng'irog'i (call.css)
   Och Qaymoq (Light Cream & Warm Silk Gold) Hashamatli Dizayn Tizimi
   Ultra-ravon animatsiyalar, Glassmorphism va Neomorfik Ovoz To'lqinlari
   ============================================================================== */

:root {
    /* Och Qaymoq Asosiy Ranglar Palitrasi */
    --bg-cream-base: #fbf8f2;
    --bg-cream-soft: #f5eee2;
    --bg-cream-warm: #ebdcc6;
    
    /* Frosted Cream Glass & Kartochkalar */
    --card-cream-bg: rgba(255, 253, 248, 0.86);
    --card-border: rgba(214, 184, 142, 0.42);
    --card-border-hover: rgba(184, 142, 88, 0.75);
    --cream-shadow: 0 25px 70px -15px rgba(110, 78, 42, 0.14);
    --cream-glow: rgba(214, 175, 115, 0.35);
    
    /* Matn ranglari (Yuqori kontrastli issiq kofe & qora shokolad) */
    --text-primary: #1f150c;
    --text-secondary: #523e2b;
    --text-muted: #7d654f;
    --text-dim: #a6917b;
    
    /* Maxsus Oltin va Qaymoq Aksentlar */
    --accent-gold: #b88636;
    --accent-gold-dark: #936521;
    --accent-gold-light: #e8c688;
    --accent-amber: #c98d36;
    
    --accent-red: #ef4444;
    --accent-red-hover: #dc2626;
    
    /* Shriftlar */
    --font-display: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.call-body {
    background-color: var(--bg-cream-base);
    background-image: 
        radial-gradient(circle at 50% 8%, rgba(245, 230, 205, 0.85) 0%, transparent 60%),
        radial-gradient(circle at 15% 85%, rgba(235, 215, 185, 0.6) 0%, transparent 50%),
        linear-gradient(180deg, #fdfbf7 0%, #f6f0e4 100%);
    font-family: var(--font-body);
    color: var(--text-primary);
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ==============================================================================
   1. ORQA FONDA ATMOSFERIK OCH QAYMOQ NURLARI VA BUG' ZARRACHALARI
   ============================================================================== */

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: floatLightOrb 12s ease-in-out infinite alternate;
}

.glow-top {
    top: -90px;
    left: 50%;
    width: 420px;
    height: 420px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(235, 205, 150, 0.6) 0%, rgba(245, 230, 205, 0.25) 50%, transparent 70%);
}

.glow-center {
    top: 40%;
    left: 45%;
    width: 350px;
    height: 350px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(245, 230, 205, 0.3) 50%, transparent 70%);
    animation-delay: -4s;
}

.glow-bottom {
    bottom: -100px;
    right: 5%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(225, 190, 130, 0.45) 0%, transparent 70%);
    animation-delay: -8s;
}

@keyframes floatLightOrb {
    0% {
        transform: translate(-50%, 0) scale(1);
        opacity: 0.75;
    }
    50% {
        transform: translate(-46%, 22px) scale(1.08);
        opacity: 1;
    }
    100% {
        transform: translate(-54%, -18px) scale(0.96);
        opacity: 0.8;
    }
}

/* Suzuvchi issiq choy bug'i / mayin qaymoq zarrachalari */
.cream-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    bottom: -20px;
    background: radial-gradient(circle, rgba(214, 175, 115, 0.5) 0%, rgba(245, 230, 205, 0) 70%);
    border-radius: 50%;
    filter: blur(1px);
    animation: lightSteamRise 11s linear infinite;
}

.p-1 { left: 18%; width: 14px; height: 14px; animation-duration: 9s; animation-delay: 0s; }
.p-2 { left: 42%; width: 22px; height: 22px; animation-duration: 13s; animation-delay: 3s; }
.p-3 { left: 68%; width: 16px; height: 16px; animation-duration: 10s; animation-delay: 1.5s; }
.p-4 { left: 28%; width: 12px; height: 12px; animation-duration: 8s; animation-delay: 4.5s; }
.p-5 { left: 82%; width: 18px; height: 18px; animation-duration: 14s; animation-delay: 6.5s; }

@keyframes lightSteamRise {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.35;
    }
    100% {
        transform: translateY(-850px) scale(1.7) translateX(25px);
        opacity: 0;
    }
}

/* ==============================================================================
   2. ASOSIY KONTEYNER (OCH QAYMOQ GLASSMORPHISM)
   ============================================================================== */

.call-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    height: 100%;
    max-height: 860px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 22px;
    background: var(--card-cream-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--card-border);
}

@media (min-width: 480px) {
    .call-wrapper {
        height: 94vh;
        border-radius: 40px;
        box-shadow: 
            var(--cream-shadow),
            0 0 40px rgba(226, 186, 122, 0.22),
            inset 0 1px 0 #ffffff;
    }
}

/* ==============================================================================
   3. HEADER
   ============================================================================== */

.call-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(214, 184, 142, 0.28);
}

.call-close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(245, 230, 205, 0.7);
    border: 1px solid rgba(195, 155, 95, 0.45);
    color: #422d17;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(120, 85, 45, 0.1);
}

.call-close-btn:hover {
    background: rgba(214, 184, 142, 0.95);
    transform: translateY(-50%) scale(1.05);
}

.call-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(245, 230, 205, 0.65);
    border: 1px solid rgba(195, 155, 95, 0.45);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #422d17;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(120, 85, 45, 0.08);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-amber);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-amber);
    animation: goldDotPulse 1.8s infinite;
}

@keyframes goldDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 12px var(--accent-amber); }
    50% { opacity: 0.5; transform: scale(0.85); box-shadow: 0 0 4px var(--accent-amber); }
}

/* ==============================================================================
   4. ASOSIY EKRAN & AVATAR HALQALARI
   ============================================================================== */

.call-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    gap: 13px;
    padding: 6px 0;
}

.avatar-container {
    position: relative;
    width: 148px;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

/* Pulslanuvchi Och Qaymoq To'lqin Doiralari */
.pulse-circle {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid rgba(200, 155, 95, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s ease;
}

.avatar-container.active .circle-1 {
    width: 162px;
    height: 162px;
    animation: lightCreamRipple 2.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.avatar-container.active .circle-2 {
    width: 194px;
    height: 194px;
    animation: lightCreamRipple 2.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite 0.7s;
}

.avatar-container.active .circle-3 {
    width: 228px;
    height: 228px;
    animation: lightCreamRipple 2.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite 1.4s;
}

.avatar-container.active .circle-4 {
    width: 264px;
    height: 264px;
    animation: lightCreamRipple 2.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite 2.1s;
}

@keyframes lightCreamRipple {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
        border-color: rgba(184, 134, 54, 0.6);
    }
    50% {
        opacity: 0.5;
        border-color: rgba(214, 175, 115, 0.4);
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
        border-color: rgba(245, 230, 205, 0);
    }
}

/* Avatar Core va Och Qaymoq Nuri */
.avatar-core {
    position: relative;
    z-index: 2;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #ffffff 0%, #f4e3c5 45%, #d8aa66 100%);
    box-shadow: 
        0 0 35px rgba(214, 175, 115, 0.4),
        0 12px 28px rgba(120, 85, 45, 0.16),
        inset 0 0 15px #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: liveAvatarBreathe 4s ease-in-out infinite;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    background: #ffffff;
    filter: drop-shadow(0 3px 6px rgba(100, 70, 35, 0.12));
    transition: transform 0.4s ease;
}

@keyframes liveAvatarBreathe {
    0%, 100% {
        transform: scale(1) translateY(0);
        box-shadow: 0 0 35px rgba(214, 175, 115, 0.35), 0 12px 28px rgba(120, 85, 45, 0.15);
    }
    50% {
        transform: scale(1.04) translateY(-3px);
        box-shadow: 0 0 55px rgba(226, 186, 122, 0.6), 0 15px 35px rgba(120, 85, 45, 0.22);
    }
}

/* AI Gapirayotgandagi Yorqin Oltin-Qaymoq Nuri */
.avatar-container.speaking .avatar-core {
    background: linear-gradient(135deg, #ffffff 0%, #fdf5e6 30%, #e8c688 80%, #b88636 100%);
    box-shadow: 
        0 0 65px rgba(226, 186, 122, 0.8),
        0 0 100px rgba(245, 215, 160, 0.5),
        0 0 15px #ffffff;
    animation: liveAvatarSpeaking 1.5s ease-in-out infinite alternate;
}

.avatar-container.speaking .pulse-circle {
    border-color: rgba(184, 134, 54, 0.7);
}

@keyframes liveAvatarSpeaking {
    0% {
        transform: scale(1.05) translateY(-2px);
        box-shadow: 0 0 50px rgba(226, 186, 122, 0.7), 0 0 80px rgba(245, 215, 160, 0.4);
    }
    100% {
        transform: scale(1.12) translateY(-5px);
        box-shadow: 0 0 85px rgba(255, 255, 255, 0.95), 0 0 120px rgba(184, 134, 54, 0.7);
    }
}

/* ==============================================================================
   5. MA'LUMOTLAR VA STATUS PILL
   ============================================================================== */

.caller-name {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.caller-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 3px;
    letter-spacing: 0.3px;
}

.call-timer {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    margin-top: 5px;
    letter-spacing: 1.5px;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(184, 134, 54, 0.2);
}

/* Status Pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--card-border);
    border-radius: 9999px;
    max-width: 92%;
    box-shadow: 0 4px 18px rgba(120, 85, 45, 0.08);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-icon {
    font-size: 14px;
}

.status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.status-pill.listening {
    background: rgba(245, 230, 205, 0.85);
    border-color: rgba(184, 134, 54, 0.55);
    box-shadow: 0 0 20px rgba(214, 175, 115, 0.3);
}

.status-pill.listening .status-text {
    color: #24160a;
    font-weight: 700;
}

.status-pill.speaking {
    background: #ffffff;
    border-color: var(--accent-gold);
    box-shadow: 0 0 25px rgba(226, 186, 122, 0.45);
}

.status-pill.speaking .status-text {
    color: var(--accent-gold-dark);
    font-weight: 700;
}

.status-pill.thinking {
    background: rgba(250, 240, 225, 0.9);
    border-color: rgba(184, 134, 54, 0.45);
}

.status-pill.thinking .status-text {
    color: var(--accent-gold-dark);
}

/* ==============================================================================
   6. VISUALIZER & DUAL-MODE PUSH-TO-TALK
   ============================================================================== */

.visualizer-wrapper {
    width: 100%;
    max-width: 340px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

#visualizerCanvas {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(150, 105, 50, 0.15));
}

/* Push-To-Talk (Och Qaymoq Rang Bosib Gapirish Tugmasi) */
.ptt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px solid rgba(195, 155, 95, 0.5);
    border-radius: 9999px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 
        0 6px 20px rgba(120, 85, 45, 0.12),
        inset 0 1px 0 #ffffff;
}

.ptt-button:hover {
    background: #ffffff;
    border-color: var(--accent-gold);
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 134, 54, 0.25);
}

.ptt-button.recording {
    background: rgba(254, 242, 242, 0.95);
    border-color: var(--accent-red);
    color: #dc2626;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.35);
    animation: pttPulseRed 1.2s infinite;
}

@keyframes pttPulseRed {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* ==============================================================================
   7. SUBTITRLAR KARTASI
   ============================================================================== */

.subtitles-card {
    width: 100%;
    max-width: 390px;
    min-height: 66px;
    max-height: 94px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--card-border);
    border-left: 3.5px solid var(--accent-gold);
    border-radius: 18px;
    text-align: left;
    overflow-y: auto;
    box-shadow: 0 8px 25px rgba(120, 85, 45, 0.08);
    transition: all 0.3s ease;
}

.subtitles-card:hover {
    border-color: var(--card-border-hover);
    border-left-color: var(--accent-gold-dark);
}

.subtitles-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.subtitles-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-gold);
}

.subtitles-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.subtitles-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
}

.subtitles-text b {
    color: var(--accent-gold-dark);
    font-weight: 700;
}

/* Scrollbar */
.subtitles-card::-webkit-scrollbar {
    width: 4px;
}

.subtitles-card::-webkit-scrollbar-thumb {
    background: rgba(200, 155, 95, 0.4);
    border-radius: 4px;
}

/* ==============================================================================
   8. TUGMALAR VA FOOTER
   ============================================================================== */

.call-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(214, 184, 142, 0.28);
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
}

.control-btn {
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

/* Ikkilamchi tugmalar (Mute, Subtitrlar) */
.btn-secondary {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-secondary);
    border: 1px solid rgba(214, 184, 142, 0.45);
    position: relative;
    box-shadow: 0 4px 16px rgba(120, 85, 45, 0.09);
}

.btn-secondary svg {
    width: 22px;
    height: 22px;
}

.btn-secondary span {
    font-size: 10px;
    font-weight: 600;
    position: absolute;
    bottom: -18px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.btn-secondary:hover:not(:disabled) {
    background: #ffffff;
    color: var(--text-primary);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(120, 85, 45, 0.16);
}

.btn-secondary.muted {
    background: rgba(254, 242, 242, 0.95);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Asosiy Och Qaymoq-Oltin Qo'ng'iroq Tugmasi */
.btn-call-action {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 35px -5px rgba(140, 95, 45, 0.28);
    position: relative;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-call-action svg {
    width: 32px;
    height: 32px;
}

.btn-call-action.btn-start {
    background: linear-gradient(135deg, #fffcf5 0%, #faecd5 35%, #e2b772 75%, #b88636 100%);
    color: #24160a;
    box-shadow: 
        0 10px 30px rgba(184, 134, 54, 0.35),
        0 0 25px rgba(255, 255, 255, 0.6),
        inset 0 1px 0 #ffffff;
    animation: startLightCreamPulse 2.4s infinite;
}

@keyframes startLightCreamPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(214, 175, 115, 0.6), 0 10px 30px rgba(184, 134, 54, 0.35);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(214, 175, 115, 0), 0 14px 40px rgba(184, 134, 54, 0.5);
    }
}

.btn-call-action.btn-end {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
    color: #ffffff;
    box-shadow: 0 10px 35px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: rotate(135deg);
}

.btn-call-action:active {
    transform: scale(0.92);
}

.call-tip {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.3px;
}
