/* =============================================================================
   BRANTWOOD WISTERIA KIOSK: MASTER CSS (v1.1.0-Kiosk)
   ============================================================================= */

   :root {
    --fell-green: #354a3a;   /* Moss/Forest Green */
    --slate-grey: #2f3e46;   /* Dark Slate */
    --stone-grey: #f2f4f3;   /* Background Stone */
    --wisteria: #b4a7d6;     /* Purple Accent */
    --wisteria-dark: #8e7cc3; 
}

/* 1. RESET & BASE */
* { box-sizing: border-box; }

body.kiosk-mode {
    margin: 0; padding: 0;
    overflow: hidden; /* Lock the iPad viewport */
    background: var(--stone-grey);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, serif;
}

#gemini-agent-wrapper {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100dvh !important; /* Forces it to fit precisely inside whatever space is left */
    z-index: 2147483647;
}

/* 2. THE MAIN WINDOW (Full Screen, Solid) */
#gemini-agent-window {
    display: flex !important; /* Force open */
    flex-direction: column;
    width: 100% !important;
    height: 100% !important;
    background: var(--stone-grey);
}

/* 3. THE HEADER (Scholarly & Fixed) */
#gemini-agent-header {
    height: 80px;
    background: var(--fell-green);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 4px solid var(--wisteria-dark);
}

.gemini-branding {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Kiosk Reset Button */
#kiosk-reset-btn {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: uppercase;
}

#gemini-agent-close-wrapper { display: none; } /* No closing the kiosk */

/* 4. THE MESSAGE AREA */
#gemini-agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    -webkit-overflow-scrolling: touch; /* Smooth iPad scrolling */
}

.gemini-msg {
    max-width: 85%;
    padding: 20px 25px;
    border-radius: 20px;
    font-size: 1.25rem; /* Larger for Kiosk readability */
    line-height: 1.5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* AI Responses */
.gemini-msg-model {
    align-self: flex-start;
    background: #ffffff;
    color: var(--slate-grey);
    border-left: 8px solid var(--wisteria);
    border-bottom-left-radius: 4px;
}

/* User Input */
.gemini-msg-user {
    align-self: flex-end;
    background: var(--slate-grey);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* System/Handover Messages (Roy's Black/White) */
.gemini-msg-system, .gemini-msg-handover {
    align-self: center;
    background: #000000;
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 30px;
}

/* 5. THE FOOTER (Interaction Zone) */
#gemini-agent-footer {
    background: #ffffff;
    padding: 25px 40px;
    border-top: 2px solid #ddd;
}

#gemini-agent-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

#gemini-agent-input {
    flex: 1;
    font-size: 1.3rem;
    padding: 15px 25px;
    border-radius: 35px;
    border: 2px solid #ccc;
    outline: none;
    transition: border-color 0.3s;
}
#gemini-agent-input:focus { border-color: var(--fell-green); }

#gemini-agent-send {
    width: 60px; height: 60px;
    background: var(--fell-green);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* 6. VOICE CONTROLS */
.kiosk-voice-controls { display: flex; gap: 12px; }

#kiosk-mic-btn, #kiosk-mute-btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #f8f9fa;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

#kiosk-mic-btn.recording {
    background: #ff4b2b; color: white;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 75, 43, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(255, 75, 43, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 75, 43, 0); }
}

/* Hide original triggers */
#gemini-agent-trigger { display: none !important; }

/* Welcome/Start Screen Overlay */
#kiosk-welcome-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100dvh;
    background: #354a3a; /* Fell Green */
    z-index: 2147483647; /* Top of everything */
    display: flex; align-items: center; justify-content: center; text-align: center;
    color: white; padding: 40px;
}
.welcome-content h1 { font-size: 3rem; margin-bottom: 0; font-family: serif; }
.welcome-content h2 { font-size: 1.5rem; color: #b4a7d6; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 30px; }
.welcome-content p { font-size: 1.2rem; max-width: 500px; margin: 0 auto 40px auto; line-height: 1.6; opacity: 0.9; }
#kiosk-start-btn {
    background: #b4a7d6; color: #fff; border: none; padding: 20px 60px;
    font-size: 1.4rem; font-weight: bold; border-radius: 50px; cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); transition: transform 0.2s;
}
#kiosk-start-btn:active { transform: scale(0.95); }