:root {
    /* --- LIGHT THEME (Glassy & Clean) --- */
    --bg-main: #f0f4f8;
    --bg-main-rgb: 240, 244, 248;
    --bg-surface: rgba(255, 255, 255, 0.6);
    --bg-hover: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(255, 255, 255, 0.8);
    --text-high: #0f172a;
    --text-med: #475569;
    --text-low: #94a3b8;
    
    --accent-primary: #3b82f6; 
    --accent-secondary: #8b5cf6;
    --accent: var(--accent-primary);
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --accent-glow: rgba(59, 130, 246, 0.4);
    
    --border: rgba(15, 23, 42, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.8);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --sphere-1: #93c5fd;
    --sphere-2: #c4b5fd;
    --sphere-3: #fbcfe8;
}

.dark-theme {
    /* --- DARK THEME (Premium OLED & Neon) --- */
    --bg-main: #0B0E14;
    --bg-main-rgb: 11, 14, 20;
    --bg-surface: rgba(20, 24, 32, 0.5);
    --bg-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(15, 23, 42, 0.6);
    --text-high: #f8fafc;
    --text-med: #94a3b8;
    --text-low: #475569;
    
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent: var(--accent-primary);
    --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --accent-glow: rgba(56, 189, 248, 0.3);
    
    --border: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.15);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --sphere-1: rgba(14, 165, 233, 0.15);
    --sphere-2: rgba(99, 102, 241, 0.15);
    --sphere-3: rgba(168, 85, 247, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-high);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand-text {
    font-family: var(--font-heading);
}

/* --- Animated Background Bubbles --- */
.app-background {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-main);
}

.gradient-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.8;
    animation: float 20s infinite ease-in-out alternate;
}

.sphere-1 { width: 600px; height: 600px; background: var(--sphere-1); top: -100px; left: -100px; animation-delay: 0s; }
.sphere-2 { width: 500px; height: 500px; background: var(--sphere-2); bottom: -100px; right: -50px; animation-delay: -5s; }
.sphere-3 { width: 400px; height: 400px; background: var(--sphere-3); top: 40%; left: 50%; transform: translate(-50%, -50%); animation-delay: -10s; }

.noise-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    mix-blend-mode: overlay;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

/* --- Layout --- */
.app-layout {
    display: flex;
    height: 100%;
}

/* --- Reusable Glass Components --- */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glass);
}

.glow-hover {
    transition: var(--transition);
}
.glow-hover:hover {
    background: var(--bg-hover);
    box-shadow: 0 0 15px var(--accent-glow);
    color: var(--text-high);
}

/* --- Sidebar --- */
.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: relative;
    z-index: 2000;
    transition: var(--transition);
    border-right: 1px solid var(--border);
    border-radius: 0 24px 24px 0;
    margin: 10px 0 10px 10px;
    height: calc(100vh - 20px);
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-icon-btn, .icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-med);
    transition: var(--transition);
}

.nav-icon-btn:hover, .icon-btn:hover { 
    background: var(--bg-hover); 
    border-color: var(--border);
    color: var(--text-high); 
}

/* --- Premium Buttons --- */
.premium-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-high);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.premium-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}
.premium-btn:hover::before { left: 150%; }

.premium-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
    transform: translateY(-2px);
}

.premium-gradient-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.premium-gradient-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.premium-gradient-btn span { position: relative; z-index: 2; }

/* Sidebar History & Items */
.sidebar-history {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar-history::-webkit-scrollbar { width: 4px; }
.sidebar-history::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.history-section-label {
    padding: 0.5rem 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    position: relative;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-med);
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.glass-hover:hover {
    background: var(--bg-hover);
    color: var(--text-high);
    border-left: 3px solid var(--accent-primary);
    padding-left: 0.65rem;
}

.danger-hover:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.accent-icon { color: var(--accent-primary); }
.accent-secondary-icon { color: var(--accent-secondary); }

.location-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    color: var(--text-low);
    background: rgba(0,0,0,0.03);
    border-radius: 100px;
    margin-top: 0.5rem;
    border: 1px solid var(--border);
}

.dark-theme .location-info { background: rgba(255,255,255,0.03); }

.location-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.pulse-anim {
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* --- Settings Menu --- */
.relative-menu-trigger { position: relative; }

.settings-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 260px;
    background: var(--bg-surface);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    display: none;
    padding: 0.5rem;
    z-index: 2005;
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-dropdown.active { display: block; }

.settings-section { padding: 0.5rem; }
.settings-label { font-size: 0.75rem; color: var(--text-low); margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; }

.theme-switch {
    display: flex;
    background: rgba(0,0,0,0.05);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
}
.dark-theme .theme-switch { background: rgba(0,0,0,0.2); border: 1px solid var(--border); }

.theme-opt {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.4rem 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-low);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.theme-opt.active {
    background: var(--bg-main);
    color: var(--text-high);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-highlight);
}

.settings-divider { height: 1px; background: var(--border); margin: 0.5rem 0; }
.settings-option { padding: 0.75rem; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; font-weight: 500; transition: var(--transition); color: var(--text-med); }
.settings-option:hover { background: var(--bg-hover); color: var(--text-high); }

/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.main-header {
    height: 70px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    position: relative;
    z-index: 1000;
}

.header-left, .header-right { display: flex; align-items: center; gap: 1rem; }

.glass-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    transition: var(--transition);
}

.glass-pill:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.model-selector-container { position: relative; }

.model-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 260px;
    background: var(--bg-surface);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    padding: 0.5rem;
    display: none;
    z-index: 1001;
    animation: slideUpFade 0.3s;
}

.model-menu.active { display: block; }

.model-menu-item {
    padding: 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.model-menu-item:hover { background: var(--bg-hover); transform: translateX(5px); }
.model-menu-item.active { background: rgba(59, 130, 246, 0.1); border: 1px solid var(--accent-glow); }
.model-menu-item strong { display: block; font-size: 0.95rem; font-family: var(--font-heading); color: var(--text-high); }
.model-menu-item span { font-size: 0.8rem; color: var(--text-low); }

/* Avatar Profile */
.avatar-btn { border-radius: 50%; overflow: hidden; border: 2px solid transparent; background: var(--bg-surface); padding: 0; }
.avatar-btn:hover { border-color: var(--accent-primary); }

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    position: relative;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 2rem 2rem;
    scroll-behavior: smooth;
}
.messages-list::-webkit-scrollbar { display: none; }

/* Welcome Screen */
.welcome-view {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 0;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.5rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    color: var(--accent-primary);
    border: 1px solid var(--accent-glow);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    animation: pulseBadge 3s infinite;
}

@keyframes pulseBadge {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(14, 165, 233, 0); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.welcome-content { max-width: 800px; width: 100%; }

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.gradient-text-animated {
    background: linear-gradient(to right, #38bdf8, #818cf8, #e879f9, #38bdf8);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 4s linear infinite;
}

@keyframes shine { to { background-position: 200% center; } }

.welcome-content .subtitle {
    font-size: 1.25rem;
    color: var(--text-med);
    margin-bottom: 3.5rem;
    font-weight: 500;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    width: 100%;
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-lift:hover {
    border-color: var(--accent-glow);
    background: var(--bg-hover);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2), 0 0 20px var(--accent-glow);
}

.card-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.bg-gradient-1 { background: linear-gradient(135deg, #FF6B6B, #FF8E53); }
.bg-gradient-2 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.bg-gradient-3 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.bg-gradient-4 { background: linear-gradient(135deg, #fa709a, #fee140); }

.glass-card p { font-size: 0.9rem; font-weight: 500; color: var(--text-high); line-height: 1.4; }

/* Messages styling */
.message-row {
    padding: 1.5rem 1rem;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}
@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

.ai-icon { width: 34px; height: 34px; background: var(--accent-gradient); border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white; box-shadow: 0 4px 10px var(--accent-glow); }
.user-icon { width: 34px; height: 34px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.content-box { flex: 1; font-size: 1.05rem; line-height: 1.7; color: var(--text-high); }

/* Submitting Input Area */
.input-area-container {
    padding: 0 2rem 1.5rem;
    background: linear-gradient(to top, var(--bg-main) 60%, transparent);
    z-index: 100;
}

.glass-input-panel {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-input);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 32px;
    border: 1px solid var(--border-highlight);
    box-shadow: var(--shadow-glass);
    overflow: hidden;
    transition: var(--transition);
}

.glass-input-panel:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), var(--shadow-glass);
}

.input-bar { display: flex; align-items: flex-end; padding: 0.6rem 1rem; gap: 0.5rem; }

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 4px;
    font-size: 1.05rem;
    font-family: var(--font-body);
    color: var(--text-high);
    resize: none;
    max-height: 200px;
    line-height: 1.5;
}

#chat-input::placeholder { color: var(--text-low); }

.input-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-med);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    margin-bottom: 6px;
}
.input-icon-btn:hover { background: rgba(100,100,100,0.1); color: var(--text-high); }

.premium-send {
    background: var(--text-high);
    color: var(--bg-main);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    transition: var(--transition);
    transform-origin: center;
}
.premium-send:disabled { background: var(--bg-surface); color: var(--text-low); border: 1px solid var(--border); opacity: 0.5; }
.premium-send:not(:disabled):hover { transform: scale(1.05); background: var(--accent-primary); color: white; box-shadow: 0 4px 15px var(--accent-glow); }

.preview-panel { padding: 1rem 1.5rem 0; display: flex; gap: 10px; border-bottom: 1px solid var(--border); }
.preview-item { position: relative; width: 60px; height: 60px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.close-preview { position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; background: rgba(0,0,0,0.7); color: white; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 2px; }

.disclaimer { text-align: center; font-size: 0.75rem; color: var(--text-low); margin-top: 0.75rem; }

/* Auth Modal Overlay */
.glass-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none; align-items: center; justify-content: center; z-index: 5000;
}
.glass-overlay.active { display: flex; animation: fadeIn 0.3s; }

.premium-glass-card {
    background: var(--bg-surface);
    width: 90%; max-width: 440px;
    padding: 3rem 2.5rem;
    border-radius: 32px;
    border: 1px solid var(--border-highlight);
    box-shadow: 0 25px 60px rgba(0,0,0,0.4), inset 0 0 20px rgba(255,255,255,0.05);
    position: relative;
    text-align: center;
}

.auth-close { position: absolute; top: 1.5rem; right: 1.5rem; background: rgba(255,255,255,0.1); border: none; width: 36px; height: 36px; border-radius: 50%; color: var(--text-med); cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.auth-close:hover { background: rgba(255,255,255,0.2); color: var(--text-high); transform: rotate(90deg); }

.auth-icon-badge {
    width: 64px; height: 64px;
    background: var(--accent-gradient);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    color: white; margin: 0 auto 1.5rem;
    box-shadow: 0 10px 25px var(--accent-glow);
    transform: rotate(-10deg);
}

.auth-icon-badge i { width: 32px; height: 32px; }

.auth-header h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; font-family: var(--font-heading); }
.auth-header p { font-size: 0.95rem; color: var(--text-low); margin-bottom: 2.5rem; }

.input-group { position: relative; margin-bottom: 1rem; }
.input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-low); width: 18px; }
.auth-form input {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    padding: 1rem 1rem 1rem 2.8rem;
    border-radius: 16px;
    color: var(--text-high);
    font-size: 1rem;
    outline: none; transition: 0.3s;
}
.light-theme .auth-form input { background: rgba(255,255,255,0.5); }
.auth-form input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }

.auth-action-btn { width: 100%; padding: 1rem; font-size: 1.05rem; margin-top: 0.5rem; }

.auth-divider { display: flex; align-items: center; text-align: center; margin: 1.5rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.auth-divider span { padding: 0 10px; color: var(--text-low); font-size: 0.8rem; font-weight: 700; }

.google-auth-btn-prime {
    display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
    background: rgba(255,255,255,0.05); color: var(--text-high);
    border: 1px solid var(--border); padding: 1rem; border-radius: 16px;
    font-size: 1rem; font-weight: 600; cursor: pointer; transition: 0.3s;
}
.google-auth-btn-prime:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); border-color: rgba(255,255,255,0.3); }
.google-auth-btn-prime img { width: 22px; height: 22px; }

.auth-footer { margin-top: 2rem; font-size: 0.9rem; color: var(--text-low); }
.auth-switch-link { color: var(--accent-primary); font-weight: 700; cursor: pointer; transition: 0.2s; }
.auth-switch-link:hover { color: var(--accent-secondary); text-decoration: underline; }

/* Voice Screen */
.voice-anim-container { position: relative; margin-bottom: 2rem; }
.voice-glow { position: absolute; top: 50%; left: 50%; width: 150px; height: 150px; transform: translate(-50%, -50%); background: var(--accent-primary); filter: blur(60px); opacity: 0.5; border-radius: 50%; animation: pulse-glow 2s infinite alternate; }
@keyframes pulse-glow { to { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; } }

.voice-anim { display: flex; gap: 8px; position: relative; z-index: 2; height: 80px; align-items: center; justify-content: center; }
.voice-anim .bar { width: 6px; background: white; border-radius: 6px; animation: sound-wave 1s ease-in-out infinite alternate; }
.voice-anim .bar:nth-child(1) { height: 30%; animation-delay: 0.1s; }
.voice-anim .bar:nth-child(2) { height: 60%; animation-delay: 0.2s; }
.voice-anim .bar:nth-child(3) { height: 100%; animation-delay: 0.3s; }
.voice-anim .bar:nth-child(4) { height: 70%; animation-delay: 0.4s; }
.voice-anim .bar:nth-child(5) { height: 40%; animation-delay: 0.5s; }

@keyframes sound-wave { 0% { transform: scaleY(0.1); } 100% { transform: scaleY(1); } }
.voice-status { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 2rem; font-weight: 700; color: white; }
.voice-close.outlined { background: transparent; border: 2px solid rgba(255,255,255,0.5); color: white; padding: 10px 30px; border-radius: 100px; }
.voice-close.outlined:hover { border-color: white; background: rgba(255,255,255,0.1); }

/* Live Support Widget */
.premium-glass-widget {
    position: fixed; bottom: 30px; right: 30px;
    width: 360px; height: 550px;
    background: var(--bg-surface); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-highlight); border-radius: 24px;
    box-shadow: var(--shadow-glass); display: none; flex-direction: column; z-index: 3000; overflow: hidden;
    animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.premium-glass-widget.active { display: flex; }

.premium-gradient-bg { background: var(--accent-gradient); color: white; padding: 1.25rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.support-agent-info { display: flex; align-items: center; gap: 12px; }
.support-avatar { width: 40px; height: 40px; background: rgba(255,255,255,0.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.online-badge { position: relative; }
.online-badge::after { content: ''; position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; background: #10b981; border: 2px solid var(--accent-secondary); border-radius: 50%; }
.support-name { font-weight: 700; font-size: 0.95rem; font-family: var(--font-heading); }
.support-status { font-size: 0.75rem; opacity: 0.9; }
.support-close { background: transparent; border: none; color: white; cursor: pointer; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: 0.2s; }
.support-close:hover { background: rgba(255,255,255,0.2); }

.scroll-pretty { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.support-messages { flex: 1; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; background: rgba(0,0,0,0.1); }
.support-msg { max-width: 85%; }
.support-msg .msg-content { padding: 0.8rem 1.2rem; border-radius: 18px; font-size: 0.9rem; line-height: 1.5; box-shadow: var(--shadow-sm); }
.support-msg.bot { align-self: flex-start; }
.support-msg.bot .msg-content { background: var(--bg-surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.support-msg.user { align-self: flex-end; }
.support-msg.user .msg-content { background: var(--accent-gradient); color: white; border-bottom-right-radius: 4px; }

.support-input-area { padding: 1rem; display: flex; gap: 0.75rem; border-top: 1px solid var(--border); background: var(--bg-surface); }
.support-input-area input { flex: 1; border: 1px solid var(--border); background: rgba(0,0,0,0.1); padding: 0.75rem 1.25rem; border-radius: 100px; outline: none; color: var(--text-high); font-family: var(--font-body); transition: 0.3s; }
.dark-theme .support-input-area input { background: rgba(255,255,255,0.05); }
.support-input-area input:focus { border-color: var(--accent-primary); }
.premium-icon-btn { background: var(--accent-primary); color: white; border: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px var(--accent-glow); }
.premium-icon-btn:hover { background: var(--accent-secondary); transform: scale(1.05); }

/* Staff dashboard fixes */
.staff-msg-container { align-self: flex-start; display: flex; flex-direction: column; gap: 4px; margin-bottom: 1rem; }
.staff-avatar-circle { width: 28px; height: 28px; background: var(--accent-gradient); border-radius: 50%; color: white; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; }
.staff-header-info { color: var(--accent-primary); font-weight: 700; font-size: 0.8rem; }
.staff-bubble-content { background: var(--bg-surface); border: 1px solid var(--border); padding: 1rem; border-radius: 16px; border-bottom-left-radius: 4px; color: var(--text-high); }

/* --- Mobile Responsive & Sidebar Toggle UI --- */
.sidebar {
    transition: width 0.3s ease, left 0.3s ease, transform 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
}

@media (max-width: 768px) {
    .app-layout {
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        margin: 0;
        height: 100vh;
        border-radius: 0;
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        width: 85%;
        max-width: 320px;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .main-content {
        width: 100%;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .welcome-content .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .features-row {
        gap: 6px;
        margin-bottom: 1.5rem;
    }
    
    .feature-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .suggestion-header {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .suggestion-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .glass-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .card-icon-wrapper {
        width: 30px;
        height: 30px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .glass-card p {
        font-size: 0.8rem;
    }
    
    .glass-card p span {
        display: none; /* Hide description on mobile to save space */
    }
    
    .message-row {
        padding: 1rem 0.5rem;
        gap: 0.75rem;
    }
    
    .main-header {
        padding: 0 1rem;
    }
    
    .glass-input-panel {
        border-radius: 20px;
    }
    
    .input-area-container {
        padding: 0 1rem 1rem;
    }
    
    .premium-glass-card {
        padding: 2rem 1.5rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .premium-glass-widget {
        width: 90%;
        right: 5%;
        bottom: 20px;
        height: 80vh;
    }
}

/* Sidebar Footer */
.sidebar-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 10px;
    padding: 0 5px;
    justify-content: center;
}
.sidebar-footer-links a {
    color: var(--text-low);
    font-size: 0.7rem;
    text-decoration: none;
    transition: 0.2s;
}
.sidebar-footer-links a:hover {
    color: var(--text-med);
    text-decoration: underline;
}
.powered-by {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-low);
    margin-top: 2px;
}

/* Features Row */
.features-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.feature-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-med);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}
.feature-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-high);
    border-color: var(--border-highlight);
}
.feature-badge i {
    color: var(--accent-primary);
}
.dark-theme .feature-badge { background: rgba(0, 0, 0, 0.2); }

.trust-subtitle {
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 400;
    color: #10b981;
}

.suggestion-header {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text-med);
    font-weight: 600;
}
