/* ---- Theme tokens ---- */
:root {
    --gt-body-bg:       #f8f9fa;
    --gt-app-bg:        #ffffff;
    --gt-app-shadow:    rgba(0,0,0,0.08);
    --gt-primary:       #1b6ec2;
    --gt-primary-muted: #e8f0fe;
    --gt-topbar-bg:     #1b6ec2;
    --gt-topbar-fg:     #ffffff;
    --gt-nav-bg:        #ffffff;
    --gt-nav-border:    #e0e0e0;
    --gt-nav-text:      #888888;
    --gt-border:        #e0e0e0;
    --gt-border-subtle: #f0f0f0;
    --gt-text-muted:    #555555;
    --gt-card-bg:       #ffffff;
    --gt-stat-value:    #1b6ec2;
    --gt-stat-label:    #555555;
}

[data-bs-theme="dark"] {
    --gt-body-bg:       #111827;
    --gt-app-bg:        #1f2937;
    --gt-app-shadow:    rgba(0,0,0,0.4);
    --gt-primary:       #60a5fa;
    --gt-primary-muted: #1e3a5f;
    --gt-topbar-bg:     #111827;
    --gt-topbar-fg:     #e5e7eb;
    --gt-nav-bg:        #1f2937;
    --gt-nav-border:    #374151;
    --gt-nav-text:      #9ca3af;
    --gt-border:        #374151;
    --gt-border-subtle: #2d3748;
    --gt-text-muted:    #d1d5db;
    --gt-card-bg:       #1f2937;
    --gt-stat-value:    #60a5fa;
    --gt-stat-label:    #d1d5db;
}

/* ---- Base ---- */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--gt-body-bg);
}

/* ---- App shell ---- */
.gt-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    background: var(--gt-app-bg);
    box-shadow: 0 0 20px var(--gt-app-shadow);
}

/* ---- Top bar ---- */
.gt-topbar {
    background: var(--gt-topbar-bg);
    color: var(--gt-topbar-fg);
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.gt-logo {
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

/* ---- Theme toggle button ---- */
.gt-theme-toggle {
    background: none;
    border: none;
    color: var(--gt-topbar-fg);
    font-size: 1.1rem;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 6px;
    opacity: 0.85;
    transition: opacity 0.15s;
    line-height: 1;
}

.gt-theme-toggle:hover {
    opacity: 1;
}

/* ---- Content ---- */
.gt-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: 80px; /* room for bottom nav */
    overflow-y: auto;
}

/* ---- Bottom nav ---- */
.gt-bottom-nav {
    background: var(--gt-nav-bg);
    border-top: 1px solid var(--gt-nav-border);
    height: 64px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    z-index: 100;
}

.gt-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--gt-nav-text);
    text-decoration: none;
    font-size: 0.7rem;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 16px;
    border-radius: 8px;
    transition: color 0.15s;
}

.gt-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.gt-nav-item.active,
.gt-nav-item:hover {
    color: var(--gt-primary);
}

/* ---- Forms ---- */
.form-control, .form-select {
    font-size: 1rem;
    min-height: 44px;
}

.btn {
    min-height: 44px;
    font-size: 1rem;
}

.btn-sm {
    min-height: 36px;
}

/* ---- Cards ---- */
.car-card {
    border: 1px solid var(--gt-border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
    background: var(--gt-card-bg);
}

.car-card:hover {
    box-shadow: 0 2px 12px var(--gt-app-shadow);
    color: inherit;
}

.log-row {
    border-bottom: 1px solid var(--gt-border-subtle);
    padding: 0.6rem 0;
}

/* ---- Stats ---- */
.stat-badge {
    background: var(--gt-primary-muted);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.stat-badge .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gt-stat-value);
}

.stat-badge .stat-label {
    font-size: 0.75rem;
    color: var(--gt-stat-label);
}

/* ---- Misc ---- */
a, .btn-link {
    color: var(--gt-primary);
}

.validation-message {
    color: #e50000;
    font-size: 0.85rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

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

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
