/* CRITICAL FIX: Forces padding to stay INSIDE the 100% width on Android */
* { 
    box-sizing: border-box; 
}

:root {
    /* Changed to an Educational Blue theme */
    --primary: #00a8ff;
    --primary-glow: rgba(0, 168, 255, 0.4);
    --bg-dark: #0a0a0c;
    --glass-bg: rgba(20, 20, 25, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #e2e2e2;
}

html, body { 
    margin: 0; padding: 0; 
    width: 100%; 
    max-width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    color: var(--text-main); 
    background-color: transparent; 
    display: flex; justify-content: center; 
    align-items: flex-start; 
    overflow-y: auto; 
    overflow-x: hidden; 
}

/* --- CINEMATIC VIDEO STYLES --- */
.space-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: cover;
    z-index: -2; 
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 12, 0.75); 
    z-index: -1;
}

/* --- APP CONTAINER --- */
.app-container {
    width: 100%; height: 100%; max-width: 800px;
    min-height: 100vh; 
    padding: 15px; 
    display: flex; flex-direction: column;
}

.janith-gpt-3d-glass {
    flex-grow: 1; display: flex; flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px; padding: 15px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 15px var(--primary-glow);
}

.chat-header {
    text-align: center; border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px; margin-bottom: 10px;
}

.chat-header h3 { margin: 0; font-size: 1.5rem; color: #fff; text-shadow: 0 0 10px var(--primary); }

/* --- THE FULL-PAGE SCROLL FIX --- */
.glass-chat-history {
    flex-grow: 1; 
    height: auto; 
    overflow: visible; 
    padding: 15px;
    background: rgba(0,0,0,0.4); border-radius: 10px; margin-bottom: 10px;
    border: 1px inset var(--glass-border);
    display: flex; flex-direction: column; gap: 12px;
    line-height: 1.5; font-size: 0.95rem;
}

/* Utility Tools row */
.tools-row {
    display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; flex-shrink: 0;
}

/* --- INPUT AREA --- */
.chat-input-area { 
    display: flex; gap: 8px; height: 45px; align-items: center; 
    width: 100%; 
    position: sticky; 
    bottom: 15px; 
    background: rgba(20, 20, 25, 0.95); 
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5); 
    z-index: 10;
}

.glass-chat-input {
    flex-grow: 1; 
    min-width: 0; 
    background: rgba(0, 0, 0, 0.6); border: 1px solid var(--glass-border);
    color: #fff; padding: 0 15px; border-radius: 8px; outline: none; font-size: 1rem;
    height: 100%;
}
.glass-chat-input:focus { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }

.glass-btn {
    background: var(--primary); color: #fff; border: none;
    border-radius: 8px; padding: 0 15px; font-weight: bold; font-size: 1rem; cursor: pointer;
    transition: 0.3s; height: 100%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; 
}
.glass-btn:hover { background: #007bff; box-shadow: 0 0 15px var(--primary-glow); }
.glass-btn.mic-active { background: #ff3366; box-shadow: 0 0 15px #ff3366; animation: pulse 1.5s infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 450px) {
    .app-container { padding: 8px; }
    .janith-gpt-3d-glass { padding: 10px; }
    .glass-btn { padding: 0 10px; font-size: 0.9rem; }
    .glass-chat-input { padding: 0 10px; }
    .chat-input-area { bottom: 8px; }
}