/* ═══════════════════════════════════════════════════════════════════════
   BlackLab Platform - Design System
   Dark theme: #0A0A0A base, #F7C948 accent (yellow)
   Font: Manrope
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-card: #161616;
    --bg-card-hover: #1a1a1a;
    --bg-input: #1a1a1a;
    --border: #2a2a2a;
    --border-hover: #3a3a3a;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666;
    --accent: #F7C948;
    --accent-hover: #f5d76e;
    --accent-dim: rgba(247, 201, 72, 0.15);
    --success: #28ca41;
    --error: #ff5f57;
    --warning: #ffaa00;
    --info: #79c0ff;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --transition: 0.2s ease;
    --font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --container-max: 1200px;
    --container-sm: 800px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* ── Container ────────────────────────────────────────────────────────── */
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: var(--container-sm); }

/* ── Navbar ───────────────────────────────────────────────────────────── */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}
.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 32px;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 1.1rem;
    color: var(--text-primary); white-space: nowrap;
}
.brand-icon, .brand-icon-sm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--accent); color: #000;
    font-weight: 800; font-size: 1rem;
}
.brand-icon-sm { width: 24px; height: 24px; font-size: 0.75rem; border-radius: 6px; }
.brand-text { color: var(--text-primary); }
.brand-suffix { color: var(--text-secondary); font-weight: 400; margin-left: 4px; }
.nav-links {
    display: flex; gap: 24px; flex: 1;
}
.nav-links a {
    color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
    padding: 8px 0; border-bottom: 2px solid transparent;
    transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary); border-bottom-color: var(--accent);
}
.nav-actions { display: flex; gap: 12px; align-items: center; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-family: var(--font); font-weight: 600; font-size: 0.9rem;
    cursor: pointer; border: none; transition: all var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); color: #000; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #e04e47; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-link { cursor: pointer; display: block; }
.card-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── Badge ────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; padding: 4px 10px;
    border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    background: var(--accent-dim); color: var(--accent);
}
.badge-accent { background: var(--accent); color: #000; }
.badge-success { background: rgba(40, 202, 65, 0.15); color: var(--success); }
.badge-error { background: rgba(255, 95, 87, 0.15); color: var(--error); }
.badge-info { background: rgba(121, 192, 255, 0.15); color: var(--info); }

/* ── Forms ────────────────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="url"],
input[type="date"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color var(--transition);
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--accent);
}
label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.form-group { margin-bottom: 16px; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
    padding: 80px 0 60px;
}
.hero-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.hero h1 { font-size: 2.8rem; line-height: 1.15; font-weight: 800; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); max-width: 500px; }
.text-accent { color: var(--accent); }
.text-lg { font-size: 1.2rem; }

/* ── Gate Card ────────────────────────────────────────────────────────── */
.gate-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
}
.gate-card h2 { margin-bottom: 8px; }
.gate-card p { color: var(--text-secondary); margin-bottom: 20px; font-size: 0.9rem; }
.gate-actions { margin-bottom: 20px; }
.gate-divider {
    display: flex; align-items: center; gap: 16px; margin: 20px 0;
    color: var(--text-muted); font-size: 0.85rem;
}
.gate-divider::before, .gate-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.gate-request { display: flex; flex-direction: column; gap: 12px; }
.gate-status { font-size: 0.85rem; margin-top: 8px; }
.gate-status.success { color: var(--success); }
.gate-status.error { color: var(--error); }

/* ── Modules Grid ─────────────────────────────────────────────────────── */
.modules-section, .features-section { padding: 60px 0; }
.section-title { font-size: 1.5rem; margin-bottom: 32px; text-align: center; }
.modules-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.module-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    transition: all var(--transition); display: block;
}
.module-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.module-icon { font-size: 2rem; margin-bottom: 12px; }
.module-card h3 { margin-bottom: 8px; color: var(--text-primary); }
.module-card p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 12px; }
.module-badge { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ── Features ─────────────────────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.feature-item {
    padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg-card);
}
.feature-item h3 { margin-bottom: 8px; font-size: 1rem; }
.feature-item p { color: var(--text-secondary); font-size: 0.85rem; }

/* ── Page Section ─────────────────────────────────────────────────────── */
.page-section { padding: 60px 0; }
.page-section h1 { font-size: 2rem; margin-bottom: 24px; }

/* ── Legal ────────────────────────────────────────────────────────────── */
.legal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.legal-document { }
.legal-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; font-size: 0.85rem; color: var(--text-secondary); }
.legal-content { line-height: 1.8; color: var(--text-secondary); }
.legal-content h1, .legal-content h2, .legal-content h3 { color: var(--text-primary); margin: 24px 0 12px; }
.legal-content h1 { font-size: 1.5rem; }
.legal-content h2 { font-size: 1.2rem; }
.legal-content h3 { font-size: 1rem; }
.legal-content table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.legal-content th, .legal-content td {
    padding: 10px 14px; border: 1px solid var(--border); text-align: left; font-size: 0.85rem;
}
.legal-content th { background: var(--bg-card); font-weight: 600; }

/* ── Stats Grid ───────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
}
.stat-card .stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-card .stat-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
th, td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
}
th { color: var(--text-secondary); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
td { color: var(--text-primary); }
tr:hover td { background: var(--bg-card-hover); }

/* ── Upload Zone ──────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 48px; text-align: center; cursor: pointer;
    transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent); background: var(--accent-dim);
}
.upload-zone h3 { margin-bottom: 8px; }
.upload-zone p { color: var(--text-secondary); font-size: 0.85rem; }

/* ── Progress Bar ─────────────────────────────────────────────────────── */
.progress-bar {
    width: 100%; height: 8px; background: var(--bg-input);
    border-radius: 4px; overflow: hidden; margin: 16px 0;
}
.progress-fill {
    height: 100%; background: var(--accent); border-radius: 4px;
    transition: width 0.3s ease; width: 0%;
}

/* ── FAQ ──────────────────────────────────────────────────────────────── */
.faq-item { margin-bottom: 24px; }
.faq-item h4 { margin-bottom: 8px; color: var(--accent); }
.faq-item p { color: var(--text-secondary); font-size: 0.9rem; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 32px;
    margin-top: 80px;
}
.footer-container { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.footer-tagline { color: var(--text-muted); font-size: 0.85rem; }
.footer-col h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 12px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 0.85rem; padding: 4px 0; transition: color var(--transition); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; }
.footer-bottom p { color: var(--text-muted); font-size: 0.8rem; text-align: center; }

/* ── Pagination ───────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: var(--radius-xs);
    border: 1px solid var(--border); color: var(--text-secondary);
    font-size: 0.85rem; transition: all var(--transition);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); color: #000; border-color: var(--accent); }

/* ── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px; max-width: 500px; width: 90%;
    max-height: 80vh; overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 1100; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 12px 20px; border-radius: var(--radius-sm);
    font-size: 0.85rem; animation: slideIn 0.3s ease;
    border: 1px solid var(--border); background: var(--bg-card);
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Spinner ──────────────────────────────────────────────────────────── */
.spinner {
    width: 32px; height: 32px; border: 3px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; align-items: center; padding: 48px; }

/* ── Empty State ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }
.empty-state h3 { margin-bottom: 8px; color: var(--text-secondary); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero h1 { font-size: 2.2rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .modules-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
