/* --- Neon Green Theme Variables --- */
:root {
    --primary: #00ffaa;
    --primary-glow: rgba(0, 255, 170, 0.6);
    --bg-dark: #020a05;
    --text-main: #ffffff;
}

/* --- Base Reset & Layout --- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-main);
    overflow: hidden;
    background-color: var(--bg-dark); /* Fallback */
}

/* THE MISSING PIECE: .app-container 
   This ensures the container fills the screen and centers the glass panel.
*/
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Sits above the video background */
}

/* --- Cinematic Video Background --- */
.video-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
}

.video-bg-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

/* Dark green overlay for readability */
.global-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 15, 8, 0.4);
    z-index: -1;
}

/* --- Back Button --- */
.back-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 100;
    background: rgba(0, 255, 170, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 255, 170, 0.4);
    padding: 10px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: 0.3s ease;
}

.back-btn:hover {
    background: rgba(0, 255, 170, 0.3);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* --- Dark Frosted Glass Pop-up Panel --- */
.glass-panel {
    background: rgba(5, 25, 12, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 170, 0.3);
    border-top: 1px solid rgba(0, 255, 170, 0.6);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 
                0 0 40px rgba(0, 255, 170, 0.2),
                inset 0 0 20px rgba(0, 255, 170, 0.1);
    border-radius: 30px;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 90%;
    max-width: 400px;
    
    /* Pop-up Animation */
    opacity: 0;
    transform: translateY(50px) scale(0.9);
    animation: popUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popUp {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Typography --- */
h1 {
    margin: 0 0 40px 0;
    font-size: 1.8rem;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 0 15px var(--primary-glow);
}

.status-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin: 40px 0 10px 0;
    text-shadow: 0 0 10px var(--primary-glow);
    min-height: 28px;
}

.transcript {
    font-size: 0.95rem;
    color: #a0c2b0;
    margin: 0;
    height: 24px;
    opacity: 0.7;
    font-style: italic;
}

/* --- Neon Green AI Orb --- */
.siri-orb {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    filter: drop-shadow(0 0 20px rgba(0, 255, 170, 0.3));
    transition: all 0.4s ease;
}

.siri-orb:active { transform: scale(0.95); }

.siri-layer {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen; 
    filter: blur(12px);     
    opacity: 0.9;
    transition: all 0.5s ease;
}

/* Idle State Layers */
.layer-1 { width: 100px; height: 120px; background: #00ffaa; animation: fluidRotate 4s infinite linear; }
.layer-2 { width: 120px; height: 100px; background: #00ccff; animation: fluidRotate 5s infinite reverse; }
.layer-3 { width: 110px; height: 110px; background: #55ff00; animation: fluidPulse 3s infinite alternate ease-in-out; }

.siri-core {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 255, 170, 0.4);
    box-shadow: inset 0 0 20px #fff;
    filter: blur(4px);
    z-index: 10;
}

/* --- Dynamic States --- */

/* Listening */
.siri-orb.listening { filter: drop-shadow(0 0 40px rgba(85, 255, 0, 0.8)); }
.siri-orb.listening .layer-1 { background: #55ff00; animation: fluidRotate 1.5s infinite linear; width: 130px; height: 110px;}
.siri-orb.listening .layer-2 { background: #ccff00; animation: fluidRotate 2s infinite reverse; width: 110px; height: 130px;}
.siri-orb.listening .layer-3 { background: #00ffaa; animation: fluidPulse 1s infinite alternate; }

/* Thinking */
.siri-orb.thinking { filter: drop-shadow(0 0 30px rgba(0, 200, 255, 0.6)); }
.siri-orb.thinking .layer-1 { background: #00aaff; animation-duration: 5s; }
.siri-orb.thinking .layer-2 { background: #00ffaa; animation-duration: 6s; }
.siri-orb.thinking .layer-3 { background: #0066ff; animation-duration: 3s; }

/* Speaking */
.siri-orb.speaking { filter: drop-shadow(0 0 50px rgba(0, 255, 170, 0.9)); }
.siri-orb.speaking .layer-1 { background: #00ffaa; animation: fluidSpeak 0.3s infinite alternate; width: 130px; height: 130px; }
.siri-orb.speaking .layer-2 { background: #00ccff; animation: fluidSpeak 0.4s infinite alternate-reverse; width: 120px; height: 140px; }
.siri-orb.speaking .layer-3 { background: #55ff00; animation: fluidSpeak 0.2s infinite alternate; }
.siri-orb.speaking .siri-core { background: rgba(0, 255, 170, 0.9); box-shadow: inset 0 0 30px #fff; }

/* Animations */
@keyframes fluidRotate {
    0% { transform: rotate(0deg) translate(8px, 0px); }
    50% { transform: rotate(180deg) translate(-8px, 8px); }
    100% { transform: rotate(360deg) translate(8px, 0px); }
}
@keyframes fluidPulse {
    0% { transform: scale(0.9) translate(0px, 4px); }
    100% { transform: scale(1.1) translate(0px, -4px); }
}
@keyframes fluidSpeak {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 1; }
    

}
/* --- Text Chat Interface --- */
.chat-container {
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-user {
    background: rgba(0, 255, 170, 0.1);
    color: #ffffff;
    border-left: 2px solid var(--primary);
    align-self: flex-start;
    text-align: left;
}

.chat-ai {
    background: rgba(255, 255, 255, 0.05);
    color: #a0c2b0;
    border-right: 2px solid #00ccff;
    align-self: flex-end;
    text-align: left;
}

.chat-input-area {
    display: flex;
    width: 100%;
    margin-top: 15px;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 170, 0.3);
    color: white;
    padding: 12px;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

.chat-send-btn {
    background: rgba(0, 255, 170, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.chat-send-btn:hover {
    background: var(--primary);
    color: #020a05;
    box-shadow: 0 0 15px var(--primary-glow);
}