/* ================================================================
   VOICE TUTOR (IMMERSIVE MODE) — Jovan AI Premium
   ================================================================ */

.voice-immersive-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e1e2f 0%, #0c0c14 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Background Animated Gradient Orbs */
.voice-bg-orb {
    position: absolute;
    width: 60vh;
    height: 60vh;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    animation: drift 15s infinite alternate ease-in-out;
}
.voice-bg-orb.primary { background: var(--primary, #4f46e5); top: -10%; left: -10%; }
.voice-bg-orb.secondary { background: var(--secondary, #d946ef); bottom: -10%; right: -10%; animation-delay: -5s; }

/* Top Header */
.voice-header {
    position: absolute;
    top: 40px;
    width: 100%;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.voice-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.voice-back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.voice-status-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.voice-status-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #52525b;
}
.voice-status-badge.listening .dot { background: #ef4444; animation: pulse-dot 1s infinite; }
.voice-status-badge.speaking .dot { background: #3b82f6; animation: pulse-dot 1s infinite; }

/* Subtitles Area */
.voice-subtitles {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 40px;
    z-index: 10;
    text-align: center;
    pointer-events: none;
    padding-bottom: 250px; /* Space for orb */
}

.ai-subtitle, .user-subtitle {
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.ai-subtitle.show, .user-subtitle.show {
    opacity: 1;
    transform: translateY(0);
}

.ai-subtitle {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.user-subtitle {
    font-size: 20px;
    font-weight: 500;
    color: #94a3b8;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* AI Orb */
.voice-orb-wrapper {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.ai-orb {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #4f46e5), var(--secondary, #8b5cf6));
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.4), inset 0 0 20px rgba(255,255,255,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ai-orb:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(79, 70, 229, 0.6), inset 0 0 20px rgba(255,255,255,0.4);
}

.ai-orb.listening {
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.6);
    animation: orb-breathe-listen 2s infinite;
}

.ai-orb.speaking {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    box-shadow: 0 0 50px rgba(59, 130, 246, 0.6);
    animation: orb-breathe-speak 1.5s infinite;
}

.ai-orb.thinking {
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.5);
    animation: orb-spin 2s linear infinite;
}

.orb-hint {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: fade-in-out 3s infinite;
}

/* Helper Buttons */
.voice-controls {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.vt-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #cbd5e1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vt-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.vt-btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
}

/* Animations */
@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.1); }
}

@keyframes pulse-dot {
    0% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes orb-breathe-listen {
    0% { transform: scale(1); box-shadow: 0 0 50px rgba(239, 68, 68, 0.6); }
    50% { transform: scale(1.1); box-shadow: 0 0 80px rgba(239, 68, 68, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 50px rgba(239, 68, 68, 0.6); }
}

@keyframes orb-breathe-speak {
    0% { transform: scale(1); box-shadow: 0 0 40px rgba(59, 130, 246, 0.4); }
    25% { transform: scale(1.05); box-shadow: 0 0 70px rgba(59, 130, 246, 0.8); }
    75% { transform: scale(0.95); box-shadow: 0 0 30px rgba(59, 130, 246, 0.3); }
    100% { transform: scale(1); box-shadow: 0 0 40px rgba(59, 130, 246, 0.4); }
}

@keyframes orb-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fade-in-out {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

@media (max-width: 768px) {
    .ai-subtitle { font-size: 24px; }
    .voice-header { top: 20px; padding: 0 20px; }
    .ai-orb { width: 90px; height: 90px; font-size: 30px; }
    .voice-orb-wrapper { bottom: 60px; }
}
