/* css/base.css */
:root {
  --body-bg: #0d0d0d;
  --header-color: #cba6f7;
  --stats-color: #a6e3a1;
  --box-bg: #1e1e2e;
  --box-border: #7f1bfa;
  --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;
  align-items: center; /* Centers vertically */
  justify-content: center;
  min-height: 100vh;
  background-color: var(--body-bg);
  color: var(--header-color);
  overflow-y: auto;
  padding: 0; /* No padding for full centering */
}

.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 {
  overflow-y: auto; /* Make scrollable if too tall */
  max-height: 100vh; /* Prevent overflowing the viewport */
  padding: 1rem; /* Add some internal padding for sleekness */
  background: var(--box-bg); /* Subtle background */
  border-right: 1px solid var(--box-border); /* Visual separation from typing area */
  border-radius: 8px; /* Rounded corners for modern look */
}

.settings-group {
  margin-bottom: 1.5rem; /* More space between groups */
  padding: 1rem; /* Internal padding */
  background: rgba(255, 255, 255, 0.05); /* Very subtle highlight */
  border-radius: 6px; /* Sleek rounding */
  border: 1px solid var(--box-border); /* Light border for definition */
}

.settings-group h4 {
  margin: 0 0 0.75rem 0; /* Tight spacing under heading */
  font-size: 1rem; /* Not too large */
  font-weight: bold;
  color: var(--header-color); /* Match theme */
  text-transform: uppercase; /* Sleek, modern feel */
  letter-spacing: 0.5px; /* Subtle spacing */
}

.settings label {
  margin-right: 0.75rem; /* Reduce horizontal spacing */
  white-space: nowrap; /* Prevent wrapping for sleekness */
}

.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;
  }
}

