/* css/base.css */
:root {
  --body-bg: #0d0d0d;
  --header-color: #cba6f7;
  --stats-color: #a6e3a1;
  --box-bg: #1e1e2e;
  --box-border: #7f1bfa;
  --timer-color: #ffd966;
  --untyped-color: #aaa; /* lighter so you can see it */
  --correct-color: #fff;
  --incorrect-color: #f75f5f;
  --skipped-color: #8b0000;
  --ad-bg: #333; /* Placeholder color for ad banner */
}

/* Base layout */
body {
  margin: 0;
  font-family: monospace;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--body-bg);
  color: var(--header-color);
  overflow-y: auto;
  padding: 0;
}

.page-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-bottom: 3.5rem; /* room for fixed footer */
}

.site-footer {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--body-bg) 80%, rgba(0,0,0,.8));
  border-top: 1px solid color-mix(in srgb, var(--box-border) 70%, transparent);
  padding: 0.45rem 1rem;
  text-align: center;
  z-index: 1000;
  font-size: 0.78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.site-footer__links {
  display: inline-flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.site-footer__links a {
  color: var(--stats-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1rem;
  transition: color 150ms ease, border-color 150ms ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
  color: var(--highlight-color, var(--header-color));
  border-color: currentColor;
}

.container {
  display: flex;
  gap: 1rem;
  align-items: stretch;   /* stretch columns to the full row height */
  width: 100%;
  max-width: none;
  min-height: 100vh;      /* at least viewport height */
}


/* Left Ad column: full height background */
#ad-left {
  flex: 0 0 300px;
  width: 300px;
  align-self: stretch;
  background: var(--ad-bg);
  color: #fff;
  display: flex;
  min-height: 100vh;   /* always at least full viewport */
  height: auto;        /* grow if the page is taller */
  align-items: flex-start;  /* keep the sticky slot pinned from the top */
  justify-content: center;
  border-right: 1px solid var(--box-border);
  margin-left: 0;
  position: relative;
  padding: 0;
  overflow: hidden;    /* keeps content from leaking on transitions */
}


/* The actual sticky ad box (300×600 default, high viewability) */
#ad-left .ad-slot {
  position: sticky;
  top: 12px;
  width: 300px;
  height: 600px;            /* Half Page */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Make any creative (img/iframe/div) fit inside the box */
#ad-left .ad-slot > * {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

#ad-left .ad-slot iframe {
  width: 100%;
  height: 100%;
  border: 0;
}


/* Step down to 300×250 on tighter desktops/tablets */
@media (max-width: 1280px) {
  #ad-left .ad-slot {
    height: 250px;          /* Medium Rectangle */
  }
}

/* On narrow screens: collapse + slide the ad out to the right (with animation) */
@media (max-width: 1100px) {
  #ad-left {
    flex-basis: 0;       /* give its space to the settings panel */
    width: 0;
    max-width: 0;
    opacity: 0;
    transform: translateX(24px);  /* "slide out to the right" */
    padding: 0;
    border-right-width: 0;
    pointer-events: none;         /* not clickable while hidden */
  }
}


/* Smooth animate the ad column + the settings panel shifting */
#ad-left,
.settings-panel {
  transition:
    flex-basis 280ms ease,
    width 280ms ease,
    max-width 280ms ease,
    margin 280ms ease,
    padding 280ms ease,
    border-width 280ms ease,
    opacity 240ms ease,
    transform 280ms ease;
}




/* Settings Groups for cleaner organization */

.settings {
  display: flex;
  flex-direction: column; /* Stack labels vertically if needed */
  gap: 0.25rem; /* Tighter internal spacing */
  font-size: 0.85rem; /* Slightly smaller for simplicity */
}

.settings-panel {
  position: relative;
  overflow: hidden;
  overflow-y: auto;
  max-height: 100vh;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--box-border) 65%, transparent);
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--box-bg) 92%, rgba(255,255,255,.05)) 0%,
      color-mix(in srgb, var(--box-bg) 78%, rgba(0,0,0,.55)) 100%);
  box-shadow:
    0 28px 60px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
}
.settings-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% -10%,
      color-mix(in srgb, var(--highlight-color, var(--stats-color, #6ae)) 32%, transparent) 0%,
      transparent 55%);
  opacity: .45;
  pointer-events: none;
}

.settings-panel__spacer {
  height: clamp(140px, 18vh, 220px);
  flex-shrink: 0;
  pointer-events: none;
}

.settings-group {
  margin-bottom: 1.5rem; /* More space between groups */
  padding: 1rem;
  position: relative;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--box-bg) 88%, rgba(255,255,255,.06)) 0%,
      color-mix(in srgb, var(--box-bg) 72%, rgba(0,0,0,.6)) 100%);
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--box-border) 55%, transparent);
  box-shadow:
    0 14px 32px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(8px);
}
.settings-group::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--highlight-color, var(--stats-color, #7de)) 18%, transparent);
  opacity: .35;
  pointer-events: none;
}

.settings-group h4 {
  margin: 0 0 0.75rem 0; /* Tight spacing under heading */
  font-size: 1rem; /* Not too large */
  font-weight: 700;
  color: color-mix(in srgb, var(--header-color) 90%, #fff);
  text-transform: uppercase; /* Sleek, modern feel */
  letter-spacing: 0.5px; /* Subtle spacing */
}

.settings label {
  margin-right: 0.75rem;
  white-space: nowrap;
  color: color-mix(in srgb, var(--correct-color) 90%, rgba(255,255,255,.75));
  font-weight: 600;
}

.settings span { margin-right: 0.5rem; }

.settings-panel .settings,
.settings-panel .customizer {
  text-align: left;
  margin-bottom: 0.5rem;
}

/* Ensure custom inputs (like numbers) align nicely */
.settings input[type="number"] {
  background: var(--body-bg);
  border: 1px solid var(--untyped-color);
  border-radius: 4px;
  color: var(--correct-color);
  padding: 0.2rem 0.4rem;
}

.typing-panel {
  flex: 2;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center typing content vertically */
  align-items: center;
  text-align: center;
  min-height: 100vh; /* Full height for centering */
  position: relative;
}

.settings select {
  background: var(--body-bg);
  border: 1px solid var(--untyped-color);
  border-radius: 4px;
  color: var(--correct-color);
  padding: 0.2rem 0.4rem;
  font-family: monospace;
}

.subtoggle.hidden { display: none; }
.subtoggle { opacity: 0.9; }

@media (prefers-reduced-motion: reduce) {
  #ad-left, .settings-panel {
    transition: none !important;
  }
}

