:root {
    --color-background: white;
    --color-on-background: black;
    --color-background-hover: #eee;
    --color-on-background-hover: black;
    --color-primary: #000000;
    --color-on-primary: white;
    --color-primary-disabled: #1f213c;
    --color-error: #de0000;
    --color-on-error: white;
}

/* Dark-mode variables when applied to body/main/header that has .dark */
body.dark,
main.dark,
header.dark {
    color-scheme: dark;
    --color-background: #36393F; /* updated dark background */
    --color-on-background: white;
    --color-background-hover: #27262c;
    --color-on-background-hover: white;
    --color-primary: #000000;
    --color-on-primary: white;
    --color-error: #de0000;
    --color-on-error: white;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: var(--color-background);
    color: var(--color-on-background);
}

/* HEADER */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 4.5rem;
    min-height: 4.5rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--color-on-primary);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* Light-mode header overrides:
   - white, semi-transparent background
   - black text and icons
   - header bottom light-gray solid line
*/
header:not(.dark) {
    background-color: rgba(255, 255, 255, 0.78); /* white but slightly transparent */
    color: var(--color-on-background); /* black */
    border-bottom: 1px solid rgba(0,0,0,0.08); /* subtle light gray line */
}

/* ensure the logo behaviour remains */
header .logo {
    display: none;
}

/* NAVIGATION */
.nav {
    display: flex;
    flex: 1;
    justify-content: center;
    height: 100%;
    align-items: center;
}

.nav-buttons {
    display: flex;
    height: 100%;
    margin: 0;
}

/* default nav button styles (kept) */
.nav-buttons .nav__tab,
.nav-buttons .nav__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-basis: auto;
    height: 100%;
    padding: 0 1.5rem;
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--color-on-primary);
    text-decoration: none;
    border: none;
    margin: 0;
    transition: background-color 0.2s;
    border-radius: 0;
    box-sizing: border-box;
    white-space: nowrap;
}

.nav-buttons .nav__tab:last-child,
.nav-buttons .nav__cta:last-child {
    flex-basis: 16rem; /* Submit Record wider */
}

/* default hover/active */
.nav-buttons .nav__tab:hover,
.nav-buttons .nav__cta:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.nav-buttons .nav__tab:active,
.nav-buttons .nav__cta:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* remove underlines for nav buttons */
.nav-buttons .nav__tab,
.nav-buttons .nav__tab span,
.nav-buttons .nav__cta,
.nav-buttons .nav__cta span {
    text-decoration: none !important;
}

/* utilities right side */
.utilities {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    height: 100%;
    margin-left: 0.5rem;
}

.nav__icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

.nav__icon img {
    height: 2rem;
    width: auto;
    transition: filter 0.12s ease;
}

/* MAIN CONTENT */
main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) minmax(16rem, 2fr) minmax(16em, 1fr);
    column-gap: 2rem;
    background-color: var(--color-background);
    color: var(--color-on-background);
    grid-template-rows: minmax(0, 1fr);
    padding-top: 4.5rem; /* offset for fixed header */
}

main > div {
    overflow-y: auto;
}

.spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    grid-column: span 3;
}

/* INPUTS */
input[type="checkbox"] {
    height: 1.25rem;
    width: 1.25rem;
    cursor: pointer;
    margin: 0;
}

/* Flag Styling for the Leaderboard */
.country-flag {
    width: 2rem;
    height: auto;
    margin-right: 0.5rem; /* Space between flag and username */
    vertical-align: middle; /* Ensure flag aligns well with text */
    display: inline-block; /* Ensures flag aligns horizontally */
}

.user {
    display: flex; /* Make the user container a flex container */
    align-items: center; /* Vertically align content in the center */
    gap: 0.5rem; /* Space between flag and player name */
}

.flag-icon {
    border-radius: 5px; /* Adjust the value to make it more or less rounded */
    width: 24px; /* Ensure the flags are the right size */
    height: 16px;
    display: inline-block;
}
/* REMOVE UNDERLINES GLOBALLY */
a, a:visited, a:hover, a:active, button {
    text-decoration: none;
    outline: none;
}

/* ===== Light-mode specific header & nav overrides =====
   These ensure nav buttons & icons appear black and backgrounds
   switch from transparent white -> transparent gray on hover.
   We scope them to `header:not(.dark)` so dark mode uses your
   existing color variables.
*/
header:not(.dark) .nav-buttons .nav__tab,
header:not(.dark) .nav-buttons .nav__cta {
    /* box behind nav text: transparent white */
    background-color: rgba(255,255,255,0.55);
    color: var(--color-on-background); /* black */
}

/* on hover, make it a subtle transparent gray so it changes */
header:not(.dark) .nav-buttons .nav__tab:hover,
header:not(.dark) .nav-buttons .nav__cta:hover {
    background-color: rgba(0,0,0,0.06); /* transparent gray */
}

/* active state in light mode */
header:not(.dark) .nav-buttons .nav__tab:active,
header:not(.dark) .nav-buttons .nav__cta:active {
    background-color: rgba(0,0,0,0.04);
}

/* Make the icon images dark/black in light mode (for SVGs/PNGs) */
header:not(.dark) .nav__icon img {
    /* force a dark/black appearance for icons */
    filter: brightness(0) saturate(100%);
}

/* If you need a slightly less aggressive icon color, use:
   filter: grayscale(100%) brightness(0.12);
   but brightness(0) makes them solid black for clear contrast.
*/

/* LEVEL BOXES - default (dark-mode friendly default values)
   (If you had more rules here originally, keep them below)
*/
.page-list .level-box {
    /* placeholder: keep existing behavior from your other CSS files */
}

/* === Light-mode full-page background for all pages === */
main:not(.dark) {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #ffffff; /* fallback in case image fails */
}



/* END OF FILE */
