/* ============================================
   SpeedyAI - Base Styles & Variables
   ============================================ */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1c1c1c;
    --bg-sidebar: #1a1a1a;
    --bg-hover: #252525;
    --bg-active: #2f2f2f;
    --bg-input: #2f2f2f;
    --bg-user-msg: #2f2f2f;
    --bg-assistant-msg: transparent;
    --text-primary: #f0f0f0;
    --text-secondary: #a3a3a3;
    --text-muted: #6b6b6b;
    --border-color: #262626;
    --border-focus: #10a37f;
    --accent-color: #10a37f;
    --accent-hover: #0d8c6d;
    --accent-glow: rgba(16, 163, 127, 0.15);
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --success-color: #22c55e;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --sidebar-width: 260px;
    --transition: 0.2s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Chat page needs overflow hidden for fixed layout */
.chat-page {
    overflow: hidden;
}

/* Auth and admin pages should scroll */
.auth-page,
.admin-page {
    overflow: auto;
}

/* Also allow html to scroll for non-chat pages */
html:not(:has(body.chat-page)) {
    overflow: auto;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* ============================================
   Auth Pages (Login / Register)
   ============================================ */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-form h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
}

.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 20px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .chat-input-area {
        padding: 12px 16px 20px;
    }

    .message-inner {
        padding: 0 16px;
    }
}
