/* ============================================
   Augmen Voice Assistant UI - Neural Core
   ============================================ */
:root {
    --bgc: rgba(10, 10, 10, 0.4);
    --bgc2: rgba(20, 20, 25, 0.6);
    --brd: rgba(255, 255, 255, 0.1);
    --brds: rgba(255, 255, 255, 0.05);
    
    --accent: #4A78FF;
    --ab: rgba(74, 120, 255, 0.3);
    --ag: rgba(74, 120, 255, 0.1);
    
    --g: #22C968;
    --gb: rgba(34, 201, 104, 0.3);
    --gbg: rgba(34, 201, 104, 0.1);
    
    --danger: #EF4444;
    --danger-b: rgba(239, 68, 68, 0.3);
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --t1: #FFFFFF;
    --t2: #A1A1AA;
    --t3: #71717A;
    
    --rf: 99px;
    --rx: 24px;
    --rl: 16px;
    
    --shg: 0 10px 30px rgba(0,0,0,0.5);
    --e: cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme="dark"] {
    margin: 0;
    padding: 0;
    background-color: #030305;
    color: var(--t1);
    font-family: 'Satoshi', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Glows (From Augmen.io) */
.hero-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 50% 45% at 50% 50%, rgba(74,120,255,.07), transparent 55%),
                radial-gradient(ellipse 35% 30% at 65% 55%, rgba(34,201,104,.035), transparent 45%);
    pointer-events: none;
}

.call-container {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    padding: 2.5rem;
    box-sizing: border-box;
    z-index: 10;
}

/* --- Top Bar & Glass Pills --- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.custom-select-trigger, .connection-indicator {
    background: rgba(20, 20, 25, 0.4);
    color: var(--t1);
    border: 1px solid var(--brd);
    padding: 0.6rem 1.2rem;
    border-radius: var(--rf);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s var(--e);
}

.custom-select-trigger:hover, .connection-indicator:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(30, 30, 35, 0.6);
}

.custom-select-wrapper {
    position: relative;
    z-index: 100;
}

.custom-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: rgba(15, 15, 18, 0.85);
    border: 1px solid var(--brd);
    border-radius: var(--rl);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shg);
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s var(--e);
    min-width: 180px;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: var(--t2);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s var(--e);
}

.custom-option:hover {
    background: var(--ag);
    color: var(--t1);
}

.custom-option.selected {
    background: var(--ab);
    color: var(--accent);
}

/* Connection Status */
.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--t3);
    box-shadow: 0 0 8px var(--t3);
    transition: all 0.3s var(--e);
}

.connection-indicator.connected .connection-dot {
    background: var(--g);
    box-shadow: 0 0 12px var(--g);
}

.connection-text {
    font-size: 0.85rem;
    color: var(--t2);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Center Area (Neural Core) --- */
.call-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.hero-h1-wrapper {
    text-align: center;
    margin-bottom: 4rem;
    z-index: 20;
}

.hero-h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin: 0;
}

.hero-lang-word {
    background: linear-gradient(135deg, var(--accent) 20%, var(--g) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.call-status {
    font-size: 0.95rem;
    color: var(--t3);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    min-height: 48px; /* Room for 2 lines */
    max-width: 400px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.call-active .call-status {
    color: var(--accent);
}

/* --- Neural Core Wrapper --- */
.neural-core-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

/* The Sphere */
.core-sphere {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(74, 120, 255, 0.4), rgba(10, 10, 15, 0.8) 70%);
    box-shadow: inset 0 0 30px rgba(74, 120, 255, 0.3), 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(74, 120, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    transition: all 0.5s var(--e);
}

.core-glow-inner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
    opacity: 0.2;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ai-logo {
    width: 50px;
    height: 50px;
    z-index: 10;
    opacity: 0.8;
}

/* Orbiting Rings */
.core-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--brds);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: border-color 0.5s ease;
}

.ring-1 {
    width: 180px;
    height: 180px;
    border-top: 1px solid var(--accent);
    animation: spin 8s linear infinite;
}

.ring-2 {
    width: 230px;
    height: 230px;
    border: 1px dashed rgba(255,255,255,0.1);
    border-bottom: 1px solid var(--g);
    animation: spin-reverse 12s linear infinite;
}

.ring-3 {
    width: 280px;
    height: 280px;
    border-right: 1px solid rgba(74, 120, 255, 0.4);
    animation: spin 15s linear infinite;
}

@keyframes spin {
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-reverse {
    100% { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Visualizer Integration */
.visualizer-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.5s var(--e);
    pointer-events: none;
}

.call-active .visualizer-wrapper {
    opacity: 1;
}

/* Active Call States */
.call-active .core-sphere {
    box-shadow: inset 0 0 50px rgba(34, 201, 104, 0.4), 0 0 60px rgba(34, 201, 104, 0.2);
    border-color: rgba(34, 201, 104, 0.4);
}

.call-active .core-glow-inner {
    opacity: 0.6;
    background: radial-gradient(circle, var(--g) 0%, transparent 60%);
    animation: breathe 2s ease-in-out infinite alternate;
}

@keyframes breathe {
    0% { transform: scale(0.9); opacity: 0.4; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

.call-active .ring-1 { border-top-color: var(--g); animation-duration: 4s; }
.call-active .ring-2 { border-bottom-color: var(--accent); animation-duration: 6s; }
.call-active .ring-3 { border-right-color: var(--g); animation-duration: 8s; }

/* --- Bottom Controls --- */
.call-controls {
    display: flex;
    justify-content: center;
    padding-bottom: 2rem;
    z-index: 20;
}

.btn-call {
    position: relative;
    height: 64px;
    padding: 0 48px;
    border-radius: var(--rf);
    border: 1px solid rgba(255,255,255,0.1);
    background: var(--bgc);
    color: var(--t1);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Satoshi', sans-serif;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s var(--e);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-text {
    position: relative;
    z-index: 2;
    letter-spacing: 0.02em;
}

.btn-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    z-index: 1;
    transition: transform 0.5s ease;
}

.btn-call:hover {
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.btn-call:hover .btn-glow {
    transform: translateX(100%);
}

.btn-call:active {
    transform: translateY(1px) scale(0.98);
}

/* Button States */
.btn-start {
    background: rgba(74, 120, 255, 0.1);
    border-color: var(--ab);
    box-shadow: 0 0 20px rgba(74, 120, 255, 0.15);
}

.btn-start:hover {
    background: rgba(74, 120, 255, 0.2);
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(74, 120, 255, 0.3);
}

.btn-connecting {
    background: rgba(229, 165, 48, 0.1);
    border-color: rgba(229, 165, 48, 0.3);
    color: #E5A530;
    animation: pulse-conn 1.5s infinite alternate;
}

@keyframes pulse-conn {
    0% { box-shadow: 0 0 10px rgba(229, 165, 48, 0.1); }
    100% { box-shadow: 0 0 30px rgba(229, 165, 48, 0.3); }
}

.btn-end {
    background: var(--danger-bg);
    border-color: var(--danger-b);
    color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.btn-end:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3);
}

.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .call-container {
        padding: 1.5rem;
    }
    
    .neural-core-wrapper {
        transform: scale(0.85);
    }
    
    .hero-h1 {
        font-size: 2.5rem;
    }
    
    .btn-call {
        width: 100%;
        max-width: 300px;
    }
}
