:root {
    /* Font Families */
    --font-body: Arial, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
        Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

    /* Background Colors - Dark Theme with Black */
    --color-bg-0: #000000; /* Pure black background */
    --color-bg-1: #1a1a1a; /* Slightly lighter black */
    --color-bg-2: #2d2d2d; /* Dark gray */

    /* Theme Colors - Bold Yellow Palette */
    --color-theme-1: #F8CA00; /* Vibrant yellow accent color */
    --color-theme-2: #FFD633; /* Lighter yellow for hover effects */

    /* Text Colors */
    --color-text: #FFFFFF; /* White text for contrast */
    --color-text-light: #b8b8b8; /* Light grey for secondary content */
    --color-text-dark: #000000; /* Black text on yellow buttons */

    /* Header Colors */
    --header-text-color: #F8CA00;
    --subheader-text-color: #FFD633;

    /* Button Colors */
    --button-bg: #F8CA00;
    --button-bg-hover: #FFD633;
    --button-bg-disabled: #666666;
    --button-border: #2d2d2d;
    --button-border-hover: #F8CA00;
    --button-text-color-common: #000000; /* Black text on yellow buttons */

    /* Radio Button Colors */
    --radio-button-active: #F8CA00;
    --radio-button-inactive: #505050;

    /* Input Colors */
    --input-bg: #1a1a1a;
    --input-border: #404040;
    --input-border-focus: #F8CA00;

    /* Semantic Colors */
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-error: #dc3545;
    --color-info: #17a2b8;

    /* Shadows - Enhanced for dark theme */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 16px rgba(248, 202, 0, 0.3);

    /* Layout Variables */
    --column-width: 42rem;
    --column-margin-top: 4rem;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    font-family: var(--font-body);
    color: var(--color-text);
}

body {
    min-height: 100vh;
    margin: 0;
    background-attachment: fixed;
    background-color: var(--color-bg-0);
    background-size: 100vw 100vh;
    background-image: linear-gradient(135deg, var(--color-bg-0) 0%, var(--color-bg-1) 50%, var(--color-bg-2) 100%);
}

h1,
h2,
p {
    font-weight: 400;
}

p {
    line-height: 1.6;
}

a {
    color: var(--color-theme-1);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-theme-2);
    text-decoration: underline;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--header-text-color);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--subheader-text-color);
}

pre {
    font-size: 16px;
    font-family: var(--font-mono);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 1em;
    overflow-x: auto;
    color: var(--color-text);
}

.text-column {
    display: flex;
    max-width: 60rem;
    flex: 0.6;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
}

/* Input and Button Base Styles */
input,
button,
textarea,
select {
    font-size: inherit;
    font-family: inherit;
}

/* Button Styles */
button {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    background-color: var(--button-bg);
    color: var(--button-text-color-common);
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

button:hover {
    background-color: var(--button-bg-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

button:disabled {
    background-color: var(--button-bg-disabled);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    color: var(--color-text-light);
}

button:focus-visible {
    outline: 3px solid rgba(248, 202, 0, 0.6);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* Input Fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    background-color: var(--input-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    border-color: var(--input-border-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(248, 202, 0, 0.2);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="date"]:disabled,
input[type="time"]:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--color-bg-0);
    cursor: not-allowed;
    opacity: 0.5;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio Buttons */
.radio-button,
input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--radio-button-inactive);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}

.radio-button:checked,
input[type="radio"]:checked {
    border-color: var(--radio-button-active);
}

.radio-button:checked::after,
input[type="radio"]:checked::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: var(--radio-button-active);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

.radio-button:focus-visible,
input[type="radio"]:focus-visible {
    outline: 3px solid rgba(248, 202, 0, 0.6);
    outline-offset: 2px;
}

/* Checkboxes */
input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--radio-button-inactive);
    border-radius: var(--border-radius-sm);
    position: relative;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

input[type="checkbox"]:checked {
    background-color: var(--radio-button-active);
    border-color: var(--radio-button-active);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    color: black;
    font-size: 14px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:focus-visible {
    outline: 3px solid rgba(248, 202, 0, 0.6);
    outline-offset: 2px;
}

/* Headers and Subheaders */
.header {
    color: var(--header-text-color);
}

.subheader {
    color: var(--subheader-text-color);
}

/* Legend Text for Charts */
.legend-text {
    fill: var(--color-text);
    font-size: 12px;
}

@media (min-width: 720px) {
    h1 {
        font-size: 2.4rem;
    }
}

.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: auto;
    margin: 0;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    white-space: nowrap;
}
