/* 
 * ==========================================
 * 1. CSS VARIABLES (THEME CONFIGURATION)
 * ==========================================
 * Light Theme "Cyber-Academic" Polish
 */
:root {
    /* Core Colors - GEMINI LIGHT THEME ENHANCED */
    --neon-cyan: #0088cc;        /* Primary Blue */
    --neon-cyan-dim: rgba(0, 136, 204, 0.08); 
    --bg-light: #f0f8ff;         
    --text-main: #1a202c;        /* Darker, sharper text */
    --text-dim: #64748b;         /* Slate grey */
    --accent-blue: #0ea5e9;      /* Sky blue accent */

    /* High-End Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.75); 
    --glass-border: rgba(255, 255, 255, 0.6);
    --blur-amount: 20px;         /* Increased blur for premium feel */
    --shadow-soft: 0 8px 32px rgba(0, 136, 204, 0.1);

    /* Fonts */
    --font-mono: 'Courier New', monospace; 
    --font-sans: system-ui, -apple-system, sans-serif;
}

/* 
 * ==========================================
 * 2. GLOBAL RESET & BASE STYLES
 * ==========================================
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    
    /* Background Pattern: Enhanced Gradient */
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #e0f2fe 100%);
    background-size: 200% 200%;
    animation: gradientBG 20s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 
 * ==========================================
 * 3. LAYOUT STRUCTURE (HEADER, MAIN, FOOTER)
 * ==========================================
 */
header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 40px;
    /* Filter drop-shadow creates a glow around the image's non-transparent pixels */
    filter: drop-shadow(0 0 5px var(--neon-cyan)); 
    animation: breathe 3s infinite ease-in-out; /* Custom animation defined below */
}

.system-status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--neon-cyan);
    border-radius: 50%;
    animation: blink 1s infinite;
}

/* Main Content Grid */
main {
    flex: 1; /* Takes up all remaining vertical space */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Split 50/50 on desktop */
    gap: 40px;
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - 81px); /* Approximate height minus header. Ensures grid stays within viewport */
    overflow: hidden; /* Prevent main scroll */
}

/* 
 * ==========================================
 * 4. COMPONENT: AI CHAT INTERFACE (LEFT PANEL)
 * ==========================================
 */
.chat-interface {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    /* backdrop-filter blurs whatever is behind this element */
    backdrop-filter: blur(var(--blur-amount)); 
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Contains the scrollable area */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    height: 100%; /* Force full height of grid cell */
}

.chat-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1); /* Lighter header */
    border-bottom: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
    color: var(--text-dim);
}

.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto; /* Allows scrolling if messages overflow */
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Custom Scrollbar for Webkit */
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) transparent;
}

/* Scrollbar styling */
.chat-window::-webkit-scrollbar {
    width: 6px;
}
.chat-window::-webkit-scrollbar-track {
    background: transparent;
}
.chat-window::-webkit-scrollbar-thumb {
    background-color: rgba(0, 136, 204, 0.3);
    border-radius: 3px;
}
.chat-window::-webkit-scrollbar-thumb:hover {
    background-color: var(--neon-cyan);
}


/* Chat Bubbles */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: slideIn 0.3s ease-out;
}

.message.ai {
    align-self: flex-start; /* Aligns to left */
    background: rgba(255, 255, 255, 0.8); /* Lighter bubble */
    border-top-left-radius: 2px; /* Visual cue for "speech" */
    border-left: 2px solid var(--neon-cyan);
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message.user {
    align-self: flex-end; /* Aligns to right */
    background: var(--neon-cyan); /* Blue bubble */
    color: white;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Typing Indicator (Three bouncing dots) */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 10px;
    align-self: flex-start;
}
.dot {
    width: 6px;
    height: 6px;
    background: var(--text-dim);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

/* Input Area */
.input-area {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

/* Chips: Pre-defined user prompts */
.suggestion-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dim);
}

.chip:hover {
    background: var(--neon-cyan-dim);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    background: rgba(255, 255, 255, 0.5); /* Lighter input background */
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-sans);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--neon-cyan);
    background: white;
}

button.send-btn {
    background: var(--neon-cyan);
    color: white; /* White text on blue button */
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
button.send-btn:hover { opacity: 0.9; }

/* 
 * ==========================================
 * 5. COMPONENT: CAROUSEL (RIGHT PANEL)
 * ==========================================
 */
.carousel-container {
    position: relative;
    /* Center content vertically and horizontally */
    display: flex;
    align-items: center; 
    justify-content: center;
    height: 100%; /* Fill the grid cell */
}

.carousel-slide {
    position: absolute;
    width: 100%;
    max-width: 500px;
    padding: 40px;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.25); /* Thinner border for premium feel */
    backdrop-filter: blur(var(--blur-amount));
    border-radius: 24px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1); /* Smooth easing */
    pointer-events: none; /* Prevent clicking hidden slides */
}

.carousel-slide.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    z-index: 2;
    box-shadow: 0 20px 60px rgba(0, 136, 204, 0.1); /* Softer, larger spread shadow */
}

.slide-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 136, 204, 0.5);
}

.slide-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.slide-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dim);
}

/* 
 * ==========================================
 * 6. ANIMATIONS & RESPONSIVE
 * ==========================================
 */
@keyframes breathe {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(0, 136, 204, 0.6)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 136, 204, 0.8)); transform: scale(1.02); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr; /* Stack panels */
        padding: 20px;
        overflow-y: auto; /* Enable scroll on mobile */
        height: auto;
    }
    
    body {
        overflow: auto; /* Allow body scroll on mobile */
        height: auto;
    }

    .carousel-container {
        min-height: 400px; /* Ensure space for carousel */
    }
}

/* 
 * ==========================================
 * 7. NEW NAVBAR & FOOTER STYLES
 * ==========================================
 */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
    /* Maintenance Mode: Gray out links */
    opacity: 0.5;
    pointer-events: none;
}

.main-nav a:hover {
    color: var(--neon-cyan);
}

.main-nav .btn-signin {
    padding: 8px 16px;
    border: 1px solid var(--neon-cyan);
    border-radius: 6px;
    color: var(--neon-cyan);
    /* Maintenance Mode: Glow but disabled look */
    opacity: 0.7;
    cursor: not-allowed;
    box-shadow: 0 0 10px rgba(0, 136, 204, 0.3);
}

.main-nav .btn-signin:hover {
    background: transparent;
    color: var(--neon-cyan);
}

footer {
    padding: 20px 40px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--neon-cyan);
}

/* Mobile Nav */
@media (max-width: 900px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    .main-nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}