/* ============================================================
   NovaTracker — Stylesheet
   ============================================================ */

:root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-surface-hover: #334155;
    --color-border: #334155;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-success: #10b981;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.main-content { padding: 2rem 1rem; min-height: calc(100vh - 140px); }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--color-text-muted); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.hidden { display: none !important; }

/* ── Navbar ── */
.navbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.125rem;
}
.navbar-brand svg { color: var(--color-primary); }
.ml-2 { margin-left: 0.5rem; }
.navbar-links { display: flex; gap: 0.25rem; margin-left: 2rem; }
.navbar-link {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    transition: all 0.15s;
}
.navbar-link:hover { color: var(--color-text); background: var(--color-surface-hover); }
.navbar-link.active { color: var(--color-primary); background: rgba(99, 102, 241, 0.1); }
.navbar-user { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; color: var(--color-text-muted); }
.navbar-user a { color: var(--color-danger); }
.navbar-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.5rem;
}
.navbar-mobile {
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid var(--color-border);
}
.navbar-mobile-link {
    display: block;
    padding: 0.75rem;
    color: var(--color-text-muted);
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.navbar-mobile-link:hover { background: var(--color-surface-hover); color: var(--color-text); }
.navbar-mobile-link.active { color: var(--color-primary); }
.navbar-mobile-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--color-border);
}
.text-accent { color: var(--color-danger); }

@media (max-width: 768px) {
    .navbar-desktop { display: none !important; }
    .navbar-hamburger { display: block; }
}

/* ── Footer ── */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }

/* ── Page Header ── */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { color: var(--color-text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.stat-card-new { border-left: 3px solid var(--color-warning); }
.stat-card-new .stat-value { color: var(--color-warning); }
.stat-card-bug { border-left: 3px solid var(--color-danger); }
.stat-card-bug .stat-value { color: var(--color-danger); }
.stat-card-feature { border-left: 3px solid var(--color-info); }
.stat-card-feature .stat-value { color: var(--color-info); }
.stat-card-exported { border-left: 3px solid var(--color-success); }
.stat-card-exported .stat-value { color: var(--color-success); }

/* ── Section ── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.25rem; font-weight: 600; }

/* ── Cards ── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

/* ── Tables ── */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}
.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}
.clickable-row { cursor: pointer; transition: background 0.15s; }
.clickable-row:hover { background: var(--color-surface-hover); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-bug { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-feature { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-new { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-reviewed { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.badge-planned { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-ignored { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.badge-exported { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-archived { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}
.btn-primary:hover { background: var(--color-primary-hover); color: white; }
.btn-danger {
    background: transparent;
    border-color: var(--color-danger);
    color: var(--color-danger);
}
.btn-danger:hover { background: var(--color-danger); color: white; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--color-text-muted);
}
.form-input, .form-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 0.875rem;
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.filter-group { flex: 1; min-width: 150px; }
.filter-group label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.25rem; display: block; }

/* ── Flash Messages ── */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}
.flash-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #10b981; }
.flash-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #ef4444; }
.flash-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #f59e0b; }

/* ── Login ── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}
.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ── Detail View ── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1.5rem;
}
.detail-main { min-width: 0; }
.feedback-message {
    line-height: 1.8;
    color: var(--color-text);
    white-space: pre-wrap;
}
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
.detail-list dt { font-weight: 600; color: var(--color-text-muted); font-size: 0.875rem; }
.detail-list dd { font-size: 0.875rem; }

.github-link {
    color: var(--color-success);
    font-weight: 600;
}

@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utilities ── */
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }
