:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --secondary: #475569;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-alt: #F1F5F9;
    --text-main: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --success: #10B981;
    --error: #EF4444;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.full-width {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 1rem;
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.25rem;
}

.auth-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.25rem;
}

/* Chat Limit Indicator */
.chat-limit-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

.chat-limit-indicator a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.confirm-modal {
    max-width: 320px;
    text-align: center;
}

.confirm-message {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    height: 70px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    width: 85%;
}

.navbar-container {
    max-width: 100%;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.navbar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-menu {
    display: none;
    gap: 32px;
    align-items: center;
}

@media (min-width: 1024px) {
    .navbar-menu {
        display: flex;
    }
}

.navbar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.navbar-link:hover {
    color: var(--primary);
}

.navbar-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dropdown-toggle:hover {
    color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 8px;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1100;
}

.navbar-dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu.dropdown-menu-right {
    left: auto;
    right: 0;
    transform: translateY(10px);
    min-width: 180px;
}

.dropdown-menu.dropdown-menu-right.show {
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--surface-alt);
    color: var(--text-main);
}

/* Auth Buttons & Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Hide auth buttons on mobile if needed, but we keep them visible or move to drawer */
.auth-buttons-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .auth-buttons-desktop {
        display: flex;
        align-items: center;
        gap: 12px;
    }
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 8px 16px;
    transition: color 0.2s;
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 10px 24px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile Toggle */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

@media (min-width: 1024px) {
    .mobile-toggle {
        display: none;
    }
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: 0.3s;
}

/* Mobile Drawer */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: var(--surface);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1200;
    padding: 80px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: right 0.3s ease-in-out;
}

.mobile-drawer.active {
    right: 0;
}

.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1150;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    backdrop-filter: blur(2px);
}

.mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.mobile-auth {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-auth .btn-text,
.mobile-auth .btn-primary {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* App Container */
.app-container {
    padding-top: 120px; /* Navbar height + spacing */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero & Search Screen */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 24px;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    background: var(--surface);
    border-radius: var(--radius-full);
    padding: 8px;
    display: flex;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    max-width: 640px;
    margin: 0 auto 60px;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 16px 24px;
    font-size: 1.1rem;
    background: transparent;
    outline: none;
    color: var(--text-main);
}

.ask-ai-button {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 0 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ask-ai-button:hover {
    opacity: 0.9;
}

/* Floating Features */
.floating-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.floating-text {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    animation: floatIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
    animation-delay: var(--delay);
}

.floating-text.featured {
    background: #EFF6FF; /* Blue 50 */
    color: var(--primary);
    border-color: #BFDBFE; /* Blue 200 */
    font-weight: 500;
}

@keyframes floatIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Screen New - Full Screen Mode */
#chatScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--background);
    z-index: 1100; /* Above navbar */
    overflow: hidden;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-container-new {
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    background-color: #ffffff;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 24px 24px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header-new {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10;
}

.chat-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 900px; /* Constrain width for better readability */
}

.chat-messages-new {
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: transparent;
    scroll-behavior: smooth;
}

/* Constrain message width */
.message-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.message {
    display: flex;
    gap: 16px;
    max-width: 85%;
    animation: messageIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.message:hover .message-avatar {
    transform: scale(1.05);
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: white;
    border-radius: 12px 12px 12px 4px;
}

.message.user .message-avatar {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 12px 12px 4px 12px;
}

.message-content {
    background: var(--surface);
    padding: 18px 24px;
    border-radius: 20px;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    line-height: 1.6;
    color: var(--text-main);
    font-size: 1rem;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.message.user .message-content {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: white;
    border-radius: 20px;
    border-top-right-radius: 4px;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Markdown Styles in Chat */
.message-content p {
    margin-bottom: 1em;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, .message-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.message-content li {
    margin-bottom: 0.5em;
}

.message-content strong {
    font-weight: 600;
}

/* Code blocks in chat */
.message-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1em 0;
    font-family: monospace;
    font-size: 0.9em;
}

.message.user .message-content pre {
    background: rgba(0,0,0,0.2);
}

/* Input Area */
.chat-input-container-full {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}

.chat-input-wrapper {
    padding: 24px;
    background: transparent;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

#chatInputNew {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 16px 24px;
    font-size: 1.05rem;
    resize: none;
    max-height: 150px;
    background: var(--surface-alt);
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

#chatInputNew:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.send-button-inline {
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.send-button-inline:hover {
    background: var(--primary-hover);
    transform: scale(1.1) rotate(-10deg);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.send-button-inline:active {
    transform: scale(0.95);
}

.send-button-inline svg {
    width: 24px;
    height: 24px;
    margin-left: -2px; /* Visual centering adjustment */
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 20px;
    border-top-left-radius: 4px;
    border: 1px solid var(--border);
    width: fit-content;
    margin-left: 56px; /* Align with avatar spacing */
    margin-bottom: 24px;
    animation: messageIn 0.3s ease-out;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* User Profile & Dropdown */
.user-profile-container {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.user-profile-btn:hover {
    background: var(--surface-alt);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #EFF6FF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #BFDBFE;
}

.user-name {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

/* Sections */
.section {
    padding: 80px 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 48px;
    text-align: center;
    letter-spacing: -0.5px;
}

/* About Grid */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.about-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}

.about-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 80px 0 32px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 60px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
}

.footer-description {
    color: var(--text-secondary);
    max-width: 480px;
    margin-bottom: 32px;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.social-link {
    color: var(--text-muted);
    transition: color 0.2s;
}

.social-link:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary);
}

/* Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
.fade-out-scale {
    animation: fadeOutScale 0.4s ease-out forwards;
    pointer-events: none;
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding-top: 100px;
    }

    .navbar {
        width: 95%;
        top: 10px;
        height: 60px;
        padding: 0 16px;
    }

    .navbar.scrolled {
        width: 95%;
    }

    .navbar-container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .search-box {
        flex-direction: column;
        padding: 6px;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .search-box input {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-full);
        margin-bottom: 12px;
        box-shadow: var(--shadow-md);
    }
    
    .ask-ai-button {
        width: 100%;
        padding: 12px;
        box-shadow: var(--shadow-md);
    }

    .chat-container-new {
        height: 100%;
        margin: 0;
        width: 100%;
        border-radius: 0;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}


/* =========================================
   ADDITIONAL AUTH & PASSWORD STYLES
   ========================================= */

/* Password Strength Meter */
.password-strength-meter {
    height: 4px;
    background-color: var(--border);
    border-radius: var(--radius-full);
    margin-top: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    position: relative;
}

.strength-bar {
    height: 100%;
    width: 0;
    background-color: var(--error);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
    font-size: 0.8rem;
    margin-bottom: 12px;
    font-weight: 500;
}

.password-requirements ul {
    list-style: none;
    padding: 0;
    margin-top: 8px;
}

.password-requirements li {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.password-requirements li::before {
    content: "○";
    display: inline-block;
    width: 14px;
}

.password-requirements li.met {
    color: var(--success);
}

.password-requirements li.met::before {
    content: "✓";
    font-weight: bold;
}

/* Auth Page Styles */
.auth-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    padding: 20px;
}

.auth-container {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s;
    background: var(--surface-alt);
    color: var(--text-main);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 12px;
}

.auth-button:hover {
    background: var(--primary-hover);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 10px;
    font-size: 0.9rem;
}

.auth-link {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-link a:hover {
    text-decoration: underline;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}


/* =========================================
   MISSING CHAT HEADER & HISTORY STYLES
   (Required for index.html elements not in vercel-styles.css)
   ========================================= */

.chat-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title-new {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.chat-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-btn:hover {
    background: var(--surface-alt);
    color: var(--primary);
}

.chat-action-btn.delete-btn:hover {
    color: var(--error);
    background: #FEF2F2;
}

.chat-action-btn svg {
    width: 20px;
    height: 20px;
}

/* History Drawer */
.history-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: var(--surface);
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    z-index: 1200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.history-drawer.active {
    transform: translateX(0);
}

.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 1150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.history-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.history-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-item {
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.history-item:hover {
    background: var(--surface-alt);
    border-color: var(--border);
}

.history-item-title {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.clear-history-btn {
    margin: 16px;
    padding: 12px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--error);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-history-btn:hover {
    background: #FEF2F2;
}
