/* ── Design Tokens + Bootstrap variable overrides ──────────── */
:root {
    --bs-body-bg: transparent;
    --bs-body-color: #f1f5f9;
    --bs-table-bg: transparent;
    --bg-space: #07071a;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-hover: rgba(255, 255, 255, 0.09);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent-gold: #f59e0b;
    --accent-gold-dark: #d97706;
    --accent-cyan: #22d3ee;
    --accent-purple: #a855f7;
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ── Base ───────────────────────────────────────────────────── */
html {
    background: var(--bg-space);
    min-height: 100vh;
}

body {
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
}

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

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

h1:focus {
    outline: none;
}

/* ── Glassmorphism ──────────────────────────────────────────── */
.glass-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.glass-nav {
    background: rgba(7, 7, 26, 0.92);
    border-bottom: 1px solid var(--glass-border);
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-neon {
    background: linear-gradient(135deg, var(--accent-gold-dark), var(--accent-gold));
    color: #000;
    font-weight: 600;
    border: none;
    box-shadow: none;
    transition: box-shadow 0.2s, transform 0.1s;
}

.btn-neon:hover, .btn-neon:focus {
    background: linear-gradient(135deg, var(--accent-gold), #fbbf24);
    color: #000;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
    transform: translateY(-1px);
}

.btn-neon:active {
    transform: translateY(0);
}

.btn-neon:disabled, .btn-neon[disabled] {
    background: rgba(245, 158, 11, 0.3);
    color: rgba(0, 0, 0, 0.4);
    box-shadow: none;
    transform: none;
    pointer-events: none;
}

.btn-neon-outline {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-neon-outline:hover, .btn-neon-outline:focus {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
    border-color: var(--accent-gold);
}

.btn-neon-outline:disabled, .btn-neon-outline[disabled] {
    opacity: 0.35;
    pointer-events: none;
}

.btn-neon-cyan {
    background: transparent;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-neon-cyan:hover, .btn-neon-cyan:focus {
    background: rgba(34, 211, 238, 0.1);
    color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
    border-color: var(--accent-cyan);
}

.btn-neon-purple {
    background: transparent;
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
    font-weight: 500;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-neon-purple:hover, .btn-neon-purple:focus {
    background: rgba(168, 85, 247, 0.1);
    color: var(--accent-purple);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
    border-color: var(--accent-purple);
}

.btn-neon-gray {
    background: transparent;
    border: 1px solid #6b7280;
    color: #9ca3af;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-neon-gray:hover, .btn-neon-gray:focus {
    background: rgba(107, 114, 128, 0.15);
    color: #d1d5db;
    border-color: #9ca3af;
}

/* Override Bootstrap focus ring globally */
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.25);
}

/* Override Bootstrap btn-close for dark theme */
.btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.6;
}

.btn-close:hover {
    opacity: 1;
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-gold);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

input[type=number] {
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    border-radius: 6px;
}

input[type=number]:focus {
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 0 0.15rem rgba(245, 158, 11, 0.25) !important;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-color: var(--text-primary);
    --bs-table-border-color: var(--glass-border);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text-primary);
    border-bottom-color: var(--glass-border);
}

.table thead th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

.table-success {
    --bs-table-bg: rgba(34, 197, 94, 0.1);
    --bs-table-color: #86efac;
    --bs-table-hover-bg: rgba(34, 197, 94, 0.15);
}

.table-danger {
    --bs-table-bg: rgba(239, 68, 68, 0.1);
    --bs-table-color: #fca5a5;
    --bs-table-hover-bg: rgba(239, 68, 68, 0.15);
}

.table-warning {
    --bs-table-bg: rgba(245, 158, 11, 0.1);
    --bs-table-color: #fcd34d;
    --bs-table-hover-bg: rgba(245, 158, 11, 0.15);
}

/* ── Status Badges ──────────────────────────────────────────── */
.badge-active {
    display: inline-block;
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
    padding: 0.28em 0.65em;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-progress {
    display: inline-block;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
    padding: 0.28em 0.65em;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-finished {
    display: inline-block;
    background: rgba(107, 114, 128, 0.18);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
    padding: 0.28em 0.65em;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    border-radius: 10px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

/* ── Spinner ────────────────────────────────────────────────── */
.spinner-border {
    color: var(--accent-gold);
}

/* ── Utility ────────────────────────────────────────────────── */
.text-muted {
    color: var(--text-muted) !important;
}

.text-gold {
    color: var(--accent-gold);
}

.border-gold {
    border-color: var(--accent-gold) !important;
    opacity: 0.3;
}

hr.border-gold {
    border: none;
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    margin: 0.5rem 0 1.5rem;
}

/* ── Validation ─────────────────────────────────────────────── */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #4ade80;
}

.invalid {
    outline: 1px solid #ef4444;
}

.validation-message {
    color: #f87171;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ── Blazor Error UI ────────────────────────────────────────── */
.blazor-error-boundary {
    background: rgba(179, 33, 33, 0.9);
    backdrop-filter: blur(8px);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ── Bootstrap component overrides — dark surfaces ──────────── */
.card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.card-body {
    color: var(--text-primary);
}

.card-title {
    font-family: var(--font-display);
    color: var(--text-primary);
}

.list-group-item {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--text-primary);
}

.darker-border-checkbox.form-check-input {
    border-color: #4b5563;
}
