/* Theme tokens and base globals */
:root {
    color-scheme: dark;
    --bg-main: #2c0b38;
    --bg-gradient: radial-gradient(circle at 50% 0%, #4a195c 0%, #2c0b38 80%);
    --text-primary: #ffffff;
    --text-muted: #dfe6e9;
    --accent: #6c5ce7;
    --accent-strong: #4834d4;
    --accent-contrast: #ffffff;
    --brand-yellow: #ffeb3b;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-strong: rgba(0, 0, 0, 0.3);
    --border-soft: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --shadow-strong: 0 4px 20px rgba(0,0,0,0.4);
    --sidebar-bg: linear-gradient(180deg, #6c5ce7 0%, #2d3436 70%);
    --toprow-bg: rgba(255, 255, 255, 0.05);
    --toprow-border: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-main: #f7f5ff;
    --bg-gradient: radial-gradient(circle at 50% 0%, #ede8ff 0%, #f7f5ff 80%);
    --text-primary: #1e1c2a;
    --text-muted: #4a485a;
    --accent: #5544c8;
    --accent-strong: #4336a2;
    --accent-contrast: #ffffff;
    --brand-yellow: #e6a400;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: rgba(255, 255, 255, 0.97);
    --border-soft: #e4e6f1;
    --border-strong: #cfd2e5;
    --shadow-strong: 0 8px 20px rgba(17, 18, 38, 0.08);
    --sidebar-bg: linear-gradient(180deg, #f2f0ff 0%, #e5e9f7 70%);
    --toprow-bg: rgba(255, 255, 255, 0.9);
    --toprow-border: #e4e6f1;
}

/* Global layout, typography, and background settings */
html, body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
}

/* Consistent box sizing for responsive layouts */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Heading typography */
h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Fredoka', sans-serif;
    letter-spacing: 0.5px;
}

/* Accessibility focus outline removal */
h1:focus {
    outline: none;
}

/* Base link styling */
a, .btn-link {
    color: var(--brand-yellow);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

/* Link hover state */
a:hover, .btn-link:hover {
    color: var(--text-primary);
    text-decoration: none;
}

/* Primary button styling */
.btn-primary {
    background-color: var(--accent);
    border: none;
    box-shadow: 0 4px 0 var(--accent-strong);
    color: var(--accent-contrast);
    font-weight: 700;
    font-family: 'Fredoka', sans-serif;
    transition: transform 0.1s, box-shadow 0.1s;
}

/* Primary button hover state */
.btn-primary:hover {
    background-color: var(--accent-strong);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--accent-strong);
    color: var(--accent-contrast);
}

/* Primary button active state */
.btn-primary:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 var(--accent-strong);
}

/* Bootstrap focus override */
.btn:focus, .btn:active:focus {
    box-shadow: none; 
}

/* Main content padding */
.content {
    padding-top: 1.1rem;
}

/* Blazor error UI container */
#blazor-error-ui {
    background: #ff7675;
    color: var(--accent-contrast);
    bottom: 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    text-align: center;
    font-weight: bold;
}

/* Error UI dismiss button */
    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 1rem;
    }

/* Code block text color */
code {
    color: #ff7675;
}

/* Light-mode helpers for bootstrap text utilities */
:root[data-theme="light"] .text-white {
    color: #1e1c2a !important;
}

:root[data-theme="light"] .text-white-50 {
    color: rgba(0,0,0,0.55) !important;
}
