/* ═══════════════════════════════════════════════════════════
   MaxAI Dashboard - Main Styles (Responsive)
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #1a1a25;
    --bg-input: #1a1a25;
    --border: #2a2a3a;
    --border-focus: #6366f1;
    --text: #e4e4e7;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --info: #3b82f6;
    --gradient: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
    --topbar-height: 60px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* ─── Sidebar Overlay (shared by dashboard + admin) ──────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ─── Navbar ─────────────────────────────────────────────── */

.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.logo-icon { font-size: 24px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover { color: var(--text); }

/* Mobile nav hamburger */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* ─── Buttons ────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 0 20px var(--primary-glow); }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-arrow { font-size: 18px; }

/* ─── Hero ───────────────────────────────────────────────── */

.hero {
    padding: 160px 0 80px;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-glow);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-hover);
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

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

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
    flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Features ───────────────────────────────────────────── */

.features { padding: 80px 0; }

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

.feature-icon { font-size: 32px; margin-bottom: 16px; }

.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }

.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ─── Code Section ───────────────────────────────────────── */

.code-section { padding: 80px 0; }

.code-block {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
}

.code-block.small { max-width: 100%; }

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #161b22;
    border-bottom: 1px solid var(--border);
}

.code-dot { width: 12px; height: 12px; border-radius: 50%; }
.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-title { margin-left: auto; font-size: 12px; color: var(--text-muted); }

.code-block pre {
    padding: 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
}

.code-block code { color: #c9d1d9; }
.keyword { color: #ff7b72; }
.string { color: #a5d6ff; }
.number { color: #79c0ff; }

/* ─── Pricing ────────────────────────────────────────────── */

.pricing { padding: 80px 0; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover { border-color: var(--primary); transform: translateY(-4px); }

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
}

.popular-badge {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pricing-name { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

.pricing-price { font-size: 48px; font-weight: 800; margin-bottom: 24px; }

.pricing-price span { font-size: 16px; font-weight: 400; color: var(--text-muted); }

.pricing-features { list-style: none; margin-bottom: 32px; text-align: left; }

.pricing-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.pricing-features li::before { content: '✓ '; color: var(--success); font-weight: 600; }

/* ─── Footer ─────────────────────────────────────────────── */

.footer { padding: 60px 0 30px; border-top: 1px solid var(--border); margin-top: 80px; }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-grid h4 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }

.footer-grid a { display: block; color: var(--text-muted); font-size: 14px; padding: 4px 0; }

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
}

/* ─── Modal ──────────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    z-index: 1;
}

/* ─── Auth Forms ─────────────────────────────────────────── */

.auth-form h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth-form > p { color: var(--text-muted); margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* ─── Forms ──────────────────────────────────────────────── */

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.input,
.select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.input:focus,
.select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-group { display: flex; gap: 8px; }

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
}

.input-group .input { flex: 1; }

.error-msg { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 20px; }

/* ─── Key Display ────────────────────────────────────────── */

.key-display h2 { text-align: center; margin-bottom: 8px; }
.key-display p { text-align: center; color: var(--text-muted); margin-bottom: 20px; }

.key-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.key-box code {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--success);
}

/* ─── Toast ──────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: calc(100vw - 48px);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

/* ─── Mobile Nav Links (hamburger dropdown) ──────────────── */

.nav-mobile-links {
    display: none;
    position: fixed;
    top: 57px; left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    flex-direction: column;
    gap: 12px;
    z-index: 99;
    animation: slideDown 0.2s ease;
}

.nav-mobile-links.active { display: flex; }

.nav-mobile-links a {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.nav-mobile-links a:last-child { border-bottom: none; }

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

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════ */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .hero h1 { font-size: 48px; letter-spacing: -1px; }
    .hero { padding: 120px 0 60px; }
    .hero-stats { gap: 32px; }
    .stat-value { font-size: 26px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .section-title { font-size: 30px; }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .container { padding: 0 16px; }

    /* Navbar */
    .nav-links { display: none; }
    .nav-hamburger { display: block; }

    /* Hero */
    .hero { padding: 100px 0 40px; }
    .hero h1 { font-size: 32px; letter-spacing: -0.5px; }
    .hero-subtitle { font-size: 15px; margin-bottom: 28px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 300px; }
    .hero-stats { gap: 20px; }
    .stat-value { font-size: 22px; }

    /* Features */
    .features { padding: 40px 0; }
    .features-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
    .feature-card { padding: 24px; }

    /* Pricing */
    .pricing { padding: 40px 0; }
    .pricing-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 32px; }
    .pricing-price { font-size: 36px; }

    /* Code */
    .code-section { padding: 40px 0; }
    .code-block pre { padding: 14px; font-size: 12px; }

    /* Footer */
    .footer { margin-top: 40px; padding: 40px 0 20px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }

    /* Forms */
    .form-row { grid-template-columns: 1fr; }

    /* Modal */
    .modal-content { padding: 24px 20px; max-height: 95vh; }

    /* Toast */
    .toast { left: 16px; right: 16px; bottom: 16px; }
}

/* Small mobile (< 400px) */
@media (max-width: 399px) {
    .hero h1 { font-size: 26px; }
    .hero-badge { font-size: 11px; padding: 4px 12px; }
    .section-title { font-size: 24px; }
    .btn-lg { padding: 12px 20px; font-size: 14px; }
}
