/* =====================================================================
   GLOBAL RESET & DARK GEMINI THEME
   ===================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at center, #0c111d 0%, #05070c 100%);
    color: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    perspective: 1000px;
}

/* Main UI Wrapper for Mobile & Desktop Center Orientation */
.assistant-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 75vh;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    z-index: 10;
}

/* =====================================================================
   BRAND HEADER & TOP LAYOUT
   ===================================================================== */
.brand-header {
    text-align: center;
    margin-top: 10px;
}

.brand-header h2 {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 6px;
    color: #f1f5f9;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.secure-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.05);
}

/* =====================================================================
   THE PLASMA NEON SPHERE INTERFACE (GEMINI STYLE CORE)
   ===================================================================== */
.plasma-wrapper {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background Soft Ambient Glow Layer */
.glow-layer {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    filter: blur(45px);
    opacity: 0.45;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Listening Mode: Cool Digital Cyan/Blue Glow */
.pulse-blue {
    background: radial-gradient(circle, #00f2fe 0%, #4facfe 100%);
    animation: blueBreathing 4s infinite ease-in-out;
}

/* Speaking Mode: Warm High-Fidelity Plasma Crimson Glow */
.pulse-red {
    background: radial-gradient(circle, #ff0844 0%, #9b51e0 100%);
    animation: redBreathing 2s infinite ease-in-out;
}

/* Physical Floating Glassmorphic Center Core */
.plasma-core {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        inset 0 0 15px rgba(255, 255, 255, 0.05),
        0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s cubic-bezier(0.1, 0.8, 0.2, 1); /* Ultra snappy responsive sizing for mic input */
}

/* Inner Pulsing Rings inside the core */
.inner-ring {
    width: 70%;
    height: 70%;
    border-radius: 50%;
    border: 1px dashed rgba(56, 189, 248, 0.2);
    animation: rotateRing 12s linear infinite;
}

.ai-speaking .inner-ring {
    border-color: rgba(244, 63, 94, 0.3);
    animation: rotateRing 4s linear infinite;
}

/* =====================================================================
   OPERATIONAL STATUS INDICATOR (BOTTOM LAYOUT)
   ===================================================================== */
.status-indicator {
    font-size: 0.8rem;
    font-weight: 400;
    color: #475569;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.4s ease;
    margin-bottom: 25px;
}

.status-indicator.ready {
    color: #94a3b8;
    text-shadow: 0 0 8px rgba(148, 163, 184, 0.2);
}

/* =====================================================================
   ANIMATIONS KEYFRAMES
   ===================================================================== */

/* Subtle Idle Floating State for Ambient Glow (Blue) */
@keyframes blueBreathing {
    0% { transform: scale(1) translate(0, 0); opacity: 0.4; filter: blur(45px); }
    33% { transform: scale(1.15) translate(4px, -6px); opacity: 0.55; filter: blur(40px); }
    66% { transform: scale(0.9) translate(-4px, 4px); opacity: 0.35; filter: blur(50px); }
    100% { transform: scale(1) translate(0, 0); opacity: 0.4; filter: blur(45px); }
}

/* Hyper-Active Fluid State for AI Processing & Speaking (Crimson/Violet) */
@keyframes redBreathing {
    0% { transform: scale(1.1); opacity: 0.6; filter: blur(35px); }
    50% { transform: scale(1.35); opacity: 0.75; filter: blur(30px); }
    100% { transform: scale(1.1); opacity: 0.6; filter: blur(35px); }
}

/* Rotation effect for inner geometric rings */
@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Native Mobile View Optimization Overrides */
@media (max-width: 480px) {
    .assistant-container {
        height: 80vh;
    }
    .plasma-wrapper {
        width: 240px;
        height: 240px;
    }
    .plasma-core {
        width: 100px;
        height: 100px;
    }
}

/* =====================================================================
   SUBTITLE & BILINGUAL MATH HIGHLIGHTING (INTEGRATED)
   ===================================================================== */
.subtitle-container {
    margin-top: 40px;
    text-align: center;
    font-size: 1.6rem !important; /* Larger font */
    color: #ffffff !important;    /* Force white color */
    min-height: 5rem;
    max-width: 90%;
    width: 100%;
    transition: all 0.3s ease;
    line-height: 1.8;
    font-family: sans-serif;
    z-index: 99999 !important; /* On top of everything */
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2); /* Slight background for readability */
    border-radius: 10px;
}
.word-span {
    margin: 0 5px;
    display: inline-block;
    transition: all 0.2s ease;
    color: #94a3b8; /* Dim default */
}
.word-highlight {
    color: #00f2fe !important; /* Bright neon blue */
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.9);
    transform: scale(1.1);
    font-weight: bold;
}
/* Mathematical terms visual difference (Academic Gold) */
.math-highlight {
    color: #ffcc00 !important; 
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.9);
}