@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

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

body {
    background-color: #050505;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

.overlay {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

/* UTILITY CLASSES */
.scrollable { overflow-y: auto; pointer-events: auto; }
.flex-center { justify-content: center; align-items: center; pointer-events: auto; }

.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
    background: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
}
.center-logo { justify-content: center; margin-bottom: 2rem; }

.neon-icon {
    color: #ff2a5f;
    filter: drop-shadow(0 0 8px rgba(255, 42, 95, 0.8));
}

.badge {
    background: linear-gradient(90deg, #ff2a5f, #ff7e5f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 0.8rem;
    vertical-align: top;
}
.neon-text { color: #ff2a5f; }

.status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a0a0a0;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #00ffcc;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ffcc;
    animation: pulse-anim 2s infinite;
}

@keyframes pulse-anim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 204, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 204, 0); }
}

.chat-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-panel {
    background: rgba(15, 15, 20, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.chat-panel {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.1s ease-out;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    scroll-behavior: smooth;
}

.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-track { background: transparent; }
.chat-history::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.message-bubble {
    max-width: 80%;
    padding: 1.2rem 1.5rem;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.4s forwards cubic-bezier(0.16, 1, 0.3, 1);
    word-wrap: break-word;
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(255, 42, 95, 0.15), rgba(255, 42, 95, 0.05));
    border: 1px solid rgba(255, 42, 95, 0.3);
    border-bottom-right-radius: 4px;
    color: #fff;
}

.ai-message {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
    color: #e0e0e0;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem 1.5rem;
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
    width: 6px;
    height: 6px;
    background: #ff2a5f;
    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; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); box-shadow: 0 0 8px #ff2a5f; }
}

.input-area {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1rem;
    align-items: center;
}

#chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.2rem 1.5rem;
    border-radius: 14px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 42, 95, 0.5);
    box-shadow: 0 0 20px rgba(255, 42, 95, 0.1);
}

.glow-btn {
    background: linear-gradient(135deg, #ff2a5f, #ff7e5f);
    border: none;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 42, 95, 0.4);
}

.glow-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 42, 95, 0.6);
}

.glow-btn:active { transform: scale(0.95); }

/* BUTTONS & LINKS */
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a, .text-btn { color: #fff; text-decoration: none; font-weight: 600; transition: color 0.3s; background: none; border: none; font-size: 1rem; cursor: pointer; font-family: 'Inter', sans-serif; }
.nav-links a:hover, .text-btn:hover { color: #ff2a5f; }

.glow-btn-small { background: rgba(255, 42, 95, 0.1); border: 1px solid #ff2a5f; padding: 0.5rem 1.5rem; border-radius: 50px; color: #ff2a5f !important; font-weight: 600; transition: all 0.3s ease; display: inline-block; text-decoration: none; }
.glow-btn-small:hover { background: #ff2a5f; color: #fff !important; box-shadow: 0 0 15px rgba(255, 42, 95, 0.4); }

.glow-btn-large { background: linear-gradient(135deg, #ff2a5f, #ff7e5f); border: none; padding: 1rem 3rem; border-radius: 50px; color: white; font-size: 1.2rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 0 20px rgba(255, 42, 95, 0.4); text-decoration: none; display: inline-block; }
.glow-btn-large:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(255, 42, 95, 0.6); }
.full-width { width: 100%; margin-top: 1rem; }

/* LANDING PAGE / HERO / FEATURES */
.hero-section { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 2rem; pointer-events: auto; }
.hero-title { font-size: 4rem; font-weight: 800; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.2rem; color: #a0a0a0; max-width: 600px; margin-bottom: 3rem; line-height: 1.6; }

.features-section { display: flex; gap: 2rem; padding: 4rem; justify-content: center; flex-wrap: wrap; pointer-events: auto; }
.feature-card { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.05); padding: 2rem; border-radius: 16px; width: 300px; text-align: center; transition: transform 0.3s; }
.feature-card:hover { transform: translateY(-10px); background: rgba(255, 255, 255, 0.06); }
.feature-icon { width: 48px; height: 48px; color: #ff2a5f; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: #a0a0a0; font-size: 0.9rem; line-height: 1.5; }

/* APP LAYOUT & SIDEBAR STYLES */
.app-body { background-color: #050505; display: flex; height: 100vh; overflow: hidden; }
.app-layout { display: flex; width: 100%; height: 100%; z-index: 10; }
.glass-sidebar { width: 280px; background: rgba(10, 10, 15, 0.6); border-right: 1px solid rgba(255, 255, 255, 0.05); display: flex; flex-direction: column; backdrop-filter: blur(20px); }
.sidebar-header { padding: 1.5rem; }
.new-chat-btn { width: 100%; padding: 1rem; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; color: #fff; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; transition: 0.3s; font-weight: 600; }
.new-chat-btn:hover { background: rgba(255, 42, 95, 0.2); border-color: rgba(255, 42, 95, 0.5); }
.sidebar-history { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.history-item { padding: 1rem; border-radius: 10px; cursor: pointer; color: #a0a0a0; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: 0.3s; }
.history-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.history-item.active { background: rgba(255, 42, 95, 0.15); color: #ff2a5f; border-left: 3px solid #ff2a5f; }
.sidebar-footer { padding: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.user-profile { display: flex; align-items: center; gap: 1rem; cursor: pointer; }
.avatar { width: 40px; height: 40px; background: linear-gradient(135deg, #ff2a5f, #ff7e5f); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: 800; }
.chat-header { padding: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); display: flex; justify-content: flex-end; }

/* AUTH PANEL STYLES */
.auth-panel { width: 100%; max-width: 450px; padding: 3rem; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.auth-form input { background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1); padding: 1.2rem; border-radius: 12px; color: #fff; font-size: 1rem; outline: none; transition: 0.3s; }
.auth-form input:focus { border-color: #ff2a5f; box-shadow: 0 0 15px rgba(255, 42, 95, 0.2); }
.auth-switch { margin-top: 2rem; font-size: 0.9rem; color: #a0a0a0; }
.error-text { color: #ff2a5f; margin-top: 1rem; font-size: 0.9rem; min-height: 20px; }

/* MODALS */
.modal-hidden { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 100; justify-content: center; align-items: center; pointer-events: auto; }
.modal-content { max-width: 600px; padding: 3rem; text-align: center; }
.terms-text { margin: 2rem 0; text-align: left; color: #a0a0a0; line-height: 1.8; max-height: 40vh; overflow-y: auto; }

/* --- MOBILE RESPONSIVENESS --- */
.mobile-menu-btn { display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 0.5rem; }

@media (max-width: 768px) {
    .glass-header { flex-direction: column; padding: 1rem; gap: 1rem; }
    .nav-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .hero-title { font-size: 2.5rem; }
    .badge { font-size: 2.5rem !important; }
    .hero-subtitle { font-size: 1rem; padding: 0 1rem; }
    .features-section { padding: 2rem 1rem; flex-direction: column; align-items: center; }
    .feature-card { width: 100%; max-width: 350px; }
    .auth-panel { padding: 2rem 1.5rem; margin: 1rem; width: 90%; }

    .app-body { 
        height: 100dvh;
        width: 100vw;
        overflow: hidden; 
    }
    
    .app-layout { 
        flex-direction: column; 
        position: relative; 
        height: 100%; 
        width: 100%;
    }

    .mobile-menu-btn { display: block; }
    
    .glass-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 300px;
        height: 100%;
        z-index: 100;
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(25px);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .glass-sidebar.open { transform: translateX(0); }
    
    .chat-wrapper { 
        padding: 0; 
        height: 100%;
        width: 100%;
    }
    
    .chat-panel { 
        height: 100%; 
        border-radius: 0; 
        border: none; 
        display: flex;
        flex-direction: column;
    }

    .chat-header { 
        justify-content: space-between; 
        padding: 1rem; 
        flex-shrink: 0; 
    }

    .chat-history {
        padding: 1rem; 
        flex: 1; 
        overflow-y: auto;
    }

    .message-bubble { 
        max-width: 95%; 
        font-size: 0.9rem; 
        padding: 1rem; 
    }
    
    .input-area { 
        padding: 0.8rem; 
        padding-bottom: calc(0.8rem + env(safe-area-inset-bottom)); 
        flex-shrink: 0;
        gap: 0.8rem;
    }

    #chat-input {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 12px;
    }

    .glow-btn {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
        border-radius: 12px;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}
