/* GXTiming global design system — shared across AdminApp, PilotApp, ManualTimingApp */

:root {
    --gx-bg: #050816;
    --gx-surface: #0F172A;
    --gx-card: #111827;
    --gx-card-hover: #1E293B;
    --gx-primary: #F97316;
    --gx-primary-hover: #FB923C;
    --gx-primary-pressed: #EA580C;
    --gx-success: #22C55E;
    --gx-warning: #FACC15;
    --gx-danger: #EF4444;
    --gx-info: #38BDF8;
    --gx-text-primary: #FFFFFF;
    --gx-text-secondary: #CBD5E1;
    --gx-text-disabled: #94A3B8;
    --gx-border: rgba(255, 255, 255, 0.12);
    --gx-border-subtle: rgba(255, 255, 255, 0.08);
    --gx-shadow-card: 0 4px 16px rgba(0, 0, 0, 0.35);
    --gx-shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.45);
    --gx-transition: 150ms ease;
    --gx-focus-ring: 0 0 0 2px var(--gx-bg), 0 0 0 4px var(--gx-primary);
}

html, body {
    background-color: var(--gx-bg);
    color: var(--gx-text-primary);
}

/* ── Typography ─────────────────────────────────────────────── */

.mud-typography-body1 {
    color: var(--gx-text-primary);
}

.mud-typography-body2,
.mud-typography-caption,
.mud-typography-subtitle2 {
    color: var(--gx-text-secondary);
}

.mud-typography-subtitle1,
.mud-typography-h6 {
    color: var(--gx-text-primary);
}

.gx-text-secondary {
    color: var(--gx-text-secondary) !important;
}

.gx-text-disabled {
    color: var(--gx-text-disabled) !important;
}

/* ── Surfaces & cards ─────────────────────────────────────── */

.mud-paper,
.mud-card {
    background-color: var(--gx-card) !important;
    border: 1px solid var(--gx-border-subtle);
    box-shadow: var(--gx-shadow-card);
    transition: background-color var(--gx-transition),
                border-color var(--gx-transition),
                box-shadow var(--gx-transition);
}

.gx-surface-card,
.settings-section {
    background-color: var(--gx-card) !important;
    border: 1px solid var(--gx-border-subtle) !important;
    box-shadow: var(--gx-shadow-card);
}

.gx-surface-card:hover,
.settings-section:hover {
    background-color: var(--gx-card-hover) !important;
    border-color: var(--gx-border) !important;
}

.gx-summary-card {
    border: 1px solid var(--gx-border-subtle);
    box-shadow: var(--gx-shadow-card);
}

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

.mud-button-root {
    transition: background-color var(--gx-transition),
                border-color var(--gx-transition),
                color var(--gx-transition),
                box-shadow var(--gx-transition),
                transform var(--gx-transition);
}

.mud-button-filled.mud-button-filled-primary {
    background-color: var(--gx-primary) !important;
    color: var(--gx-text-primary) !important;
}

.mud-button-filled.mud-button-filled-primary:hover {
    background-color: var(--gx-primary-hover) !important;
}

.mud-button-filled.mud-button-filled-primary:active {
    background-color: var(--gx-primary-pressed) !important;
}

.mud-button-filled.mud-button-filled-secondary,
.mud-button-filled.mud-button-filled-default {
    background-color: var(--gx-card-hover) !important;
    color: var(--gx-text-primary) !important;
    border: 1px solid var(--gx-border-subtle);
}

.mud-button-filled.mud-button-filled-secondary:hover,
.mud-button-filled.mud-button-filled-default:hover {
    background-color: var(--gx-surface) !important;
    border-color: var(--gx-border);
}

.mud-button-outlined {
    border-color: var(--gx-border) !important;
    color: var(--gx-text-primary) !important;
}

.mud-button-outlined.mud-button-outlined-primary {
    border-color: var(--gx-primary) !important;
    color: var(--gx-primary-hover) !important;
}

.mud-button-outlined.mud-button-outlined-primary:hover {
    background-color: rgba(249, 115, 22, 0.12) !important;
}

.mud-button-outlined.mud-button-outlined-secondary {
    border-color: var(--gx-border) !important;
    color: var(--gx-text-secondary) !important;
}

.mud-button-outlined.mud-button-outlined-secondary:hover {
    color: var(--gx-text-primary) !important;
    border-color: var(--gx-border) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
}

.mud-button-text {
    color: var(--gx-text-secondary) !important;
}

.mud-button-text:hover {
    color: var(--gx-text-primary) !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
}

/* ── Focus (accessibility) ────────────────────────────────── */

.mud-button-root:focus-visible,
.mud-icon-button:focus-visible,
.mud-fab:focus-visible,
.mud-switch:focus-visible .mud-switch-button,
.mud-checkbox:focus-visible .mud-button-root,
.mud-nav-link:focus-visible,
.mud-list-item:focus-visible,
.mud-tab:focus-visible {
    outline: none;
    box-shadow: var(--gx-focus-ring) !important;
}

.mud-input-control:focus-within .mud-input-outlined-border {
    border-color: var(--gx-primary) !important;
    box-shadow: 0 0 0 1px var(--gx-primary);
}

/* ── Inputs & selects ─────────────────────────────────────── */

.mud-input-outlined-border {
    border-color: var(--gx-border) !important;
    transition: border-color var(--gx-transition), box-shadow var(--gx-transition);
}

.mud-input-label,
.mud-input-label-inputcontrol {
    color: var(--gx-text-secondary) !important;
}

.mud-input,
.mud-select,
.mud-input-slot {
    color: var(--gx-text-primary) !important;
}

.mud-input-adornment,
.mud-input-helper-text {
    color: var(--gx-text-secondary) !important;
}

.mud-select-input {
    color: var(--gx-text-primary) !important;
}

/* ── Navigation ───────────────────────────────────────────── */

.mud-appbar {
    background-color: var(--gx-surface) !important;
    border-bottom: 1px solid var(--gx-border-subtle);
}

.mud-drawer {
    background-color: var(--gx-surface) !important;
    border-right: 1px solid var(--gx-border-subtle);
}

.mud-drawer .mud-nav-link {
    color: var(--gx-text-secondary);
    transition: color var(--gx-transition), background-color var(--gx-transition);
}

.mud-drawer .mud-nav-link.active,
.mud-drawer .mud-nav-link:hover {
    color: var(--gx-text-primary);
    background-color: rgba(249, 115, 22, 0.1);
}

.mud-drawer .mud-nav-link .mud-nav-link-icon {
    color: inherit;
}

/* ── Tables ───────────────────────────────────────────────── */

.mud-table {
    background-color: var(--gx-card);
}

.mud-table-head .mud-table-cell {
    color: var(--gx-text-secondary);
    border-bottom: 1px solid var(--gx-border);
}

.mud-table-body .mud-table-cell {
    color: var(--gx-text-primary);
    border-bottom: 1px solid var(--gx-border-subtle);
}

.mud-table-row:hover {
    background-color: var(--gx-card-hover) !important;
}

/* ── Dialogs & overlays ───────────────────────────────────── */

.mud-dialog {
    background-color: var(--gx-card) !important;
    border: 1px solid var(--gx-border);
    box-shadow: var(--gx-shadow-elevated);
}

.mud-dialog-title {
    color: var(--gx-text-primary);
}

.mud-overlay-scrim {
    background-color: rgba(5, 8, 22, 0.72) !important;
}

/* ── Snackbars ────────────────────────────────────────────── */

.mud-snackbar {
    border: 1px solid var(--gx-border);
    box-shadow: var(--gx-shadow-elevated);
}

.mud-snackbar-content-message {
    color: var(--gx-text-primary);
}

/* ── Chips & badges ───────────────────────────────────────── */

.mud-chip {
    border: 1px solid var(--gx-border-subtle);
}

.mud-chip-color-default {
    background-color: var(--gx-card-hover) !important;
    color: var(--gx-text-primary) !important;
}

/* ── Lists ────────────────────────────────────────────────── */

.mud-list-item {
    color: var(--gx-text-primary);
}

.mud-list-item-text-secondary {
    color: var(--gx-text-secondary) !important;
}

/* ── Tabs ─────────────────────────────────────────────────── */

.mud-tab {
    color: var(--gx-text-secondary) !important;
    transition: color var(--gx-transition);
}

.mud-tab.mud-tab-active {
    color: var(--gx-primary-hover) !important;
}

.mud-tabs-toolbar {
    border-bottom: 1px solid var(--gx-border-subtle);
}

/* ── Mobile navigation (shared pattern) ─────────────────── */

.mobile-navbar,
.pilot-bottom-nav {
    background-color: var(--gx-surface) !important;
    border-top: 1px solid var(--gx-border) !important;
}

.mobile-nav-item,
.pilot-nav-item {
    color: var(--gx-text-secondary) !important;
    transition: color var(--gx-transition), transform var(--gx-transition);
}

.mobile-nav-item.active,
.pilot-nav-item.active {
    color: var(--gx-primary) !important;
}

/* ── Links ────────────────────────────────────────────────── */

a, .btn-link {
    color: var(--gx-primary-hover);
    transition: color var(--gx-transition);
}

a:hover, .btn-link:hover {
    color: var(--gx-primary);
}

/* ── Loading spinner ──────────────────────────────────────── */

.loading-progress circle {
    stroke: var(--gx-card-hover);
}

.loading-progress circle:last-child {
    stroke: var(--gx-primary);
}

/* ── Blazor error UI ──────────────────────────────────────── */

#blazor-error-ui {
    background: var(--gx-card);
    color: var(--gx-text-primary);
    border-top: 1px solid var(--gx-border);
}

code {
    color: var(--gx-primary-hover);
}
