/* -------------------------------------------------------------
   THELANGUAGEFELLOW.COM SOBER THEMES (CSP-COMPLIANT)
   ------------------------------------------------------------- */

:root, .theme-scholarly-parchment {
  /* Default: Scholarly Parchment (Warm Academic Light) */
  --bg: #fdfbf7;
  --bg-rgb: 253, 251, 247;
  --surface: #f6f3ea;
  --surface-rgb: 246, 243, 234;
  --text: #241e17;
  --text-muted: #786e64;
  --accent: #8b1e0f;      /* Classic Muted Oxblood/Maroon */
  --border: #e6dfd3;
  --orange: #ad7a1a;      /* Muted Gold */
  --pink: #9c413c;        /* Faded Terracotta */
  
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'EB Garamond', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

:root.theme-oxford-library {
  --bg: #0f121a;
  --bg-rgb: 15, 18, 26;
  --surface: #1a1f2c;
  --surface-rgb: 26, 31, 44;
  --text: #d1d7e0;
  --text-muted: #7a8799;
  --accent: #cca285;      /* Muted Brass/Gold */
  --border: #262d3d;
  --orange: #fed7aa;
  --pink: #fca5a5;
  
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'EB Garamond', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

:root.theme-eink-graphite {
  --bg: #1c1c1e;
  --bg-rgb: 28, 28, 30;
  --surface: #2c2c2e;
  --surface-rgb: 44, 44, 46;
  --text: #e5e5ea;
  --text-muted: #8e8e93;
  --accent: #d1d1d6;      /* Brushed Silver */
  --border: #3a3a3c;
  --orange: #fafafa;
  --pink: #cbd5e1;
  
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'EB Garamond', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Add the other 17 themes below as needed using the same :root.theme-class pattern */

/* -------------------------------------------------------------
   GLOBAL TYPOGRAPHY & ELEMENT STYLING
   ------------------------------------------------------------- */

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  transition: color 0.25s;
}

/* -------------------------------------------------------------
   STRUCTURAL RESETS (PREVENTS COLLAPSES & NESTED BOXES)
   ------------------------------------------------------------- */

.outerContainer,
.container,
.navBarDiv,
.navBarDivContainer,
.theme-selector-group,
.divPageLinks,
.table,
.copyrightLine,
footer div {
  border: none !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}


.outerContainer {
  max-width: 1100px;             /* Sets a highly readable maximum width */
  margin: 3rem auto !important;  /* Centers the content block and adds top/bottom spacing */
  padding: 0 24px !important;    /* Soft breathing room on mobile and tablet screens */
  background-color: transparent !important;
  border: none !important;
}


/* Style only standard content panel containers */
.quotebox, 
.message, 
.postPageArticle {
  border: 1px solid var(--border) !important;
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 6px;
  padding: 15px !important;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

/* -------------------------------------------------------------
   GLOBAL BUTTON STYLING
   ------------------------------------------------------------- */

button, 
.btn, 
.button,
input[type="button"],
input[type="submit"] {
  cursor: pointer;
  background-color: var(--accent) !important;
  color: var(--bg) !important;                  /* Contrasts cleanly with the accent background */
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  font-family: var(--font-sans) !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  padding: 8px 16px !important;
  transition: background-color 0.2s, border-color 0.2s, transform 0.1s !important;
}

button:hover, 
.btn:hover, 
.button:hover,
input[type="button"]:hover,
input[type="submit"]:hover {
  background-color: var(--orange) !important;   /* Highlights to gold/amber on hover */
  border-color: var(--orange) !important;
  color: var(--bg) !important;
}

button:active, 
.btn:active, 
.button:active {
  transform: scale(0.98);
}

/* -------------------------------------------------------------
   GLOBAL FORM FIELDS
   ------------------------------------------------------------- */

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  padding: 6px 12px !important;
  font-family: var(--font-sans) !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent) !important;
}

/* -------------------------------------------------------------
   GLOBAL FONTS & LINKS
   ------------------------------------------------------------- */

pre, code, .mono-text, #fetchOutputHere, #formValue p {
  font-family: var(--font-mono) !important;
  font-size: 0.95rem;
}

.literary-block, .metaphor-text, .quotebox {
  font-family: var(--font-serif) !important;
  font-size: 1.15rem;
  line-height: 1.5;
  font-style: italic;
}

a {
  color: var(--pink);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   HEADER, NAVIGATION & FOOTER SPECS
   ------------------------------------------------------------- */

#logo h3 {
  background-color: var(--accent) !important;
  color: var(--bg) !important;
  padding: 20px;
  margin: 0;
  border-radius: 6px;
  font-size: 2.2rem;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.04em;
}

#logo h3 a {
  color: var(--bg) !important;
}

#navigation {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 0;
}

/* Enforce accent sizing on brand text logo */
.navBarDivContainerNav > a {
  color: var(--accent) !important;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.5rem !important;
  letter-spacing: -0.03em;
}

/* Regular Navbar list links */
.navBarDivContainerNav ul li a {
  color: var(--text) !important;
  font-family: var(--font-sans);
  font-weight: 500;
}

.navBarDivContainerNav ul li a:hover {
  color: var(--orange) !important;
}

/* Center and align navigation elements with the main content column */
.navBarDivContainerNav {
  max-width: 1100px;
  margin: 0 auto !important;
  padding: 0 24px !important;    /* Matches the content column's side padding */
  display: flex;
  justify-content: space-between;
  align-items: center;
}



/* Selector Group Info Text */
.theme-selector-group span {
  color: var(--text-muted) !important;
}

/* --- THEMATIC FOOTER --- */
.footer, footer {
  background-color: var(--surface) !important;
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border) !important;
  padding: 20px 0 !important;
  margin-top: 40px !important;
  font-family: var(--font-sans);
}

/* --- THEMATIC FOOTER --- */
.footer, footer {
  background-color: var(--surface) !important;
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border) !important;
  padding: 30px 24px !important; /* Soft padding on both sides */
  margin-top: 60px !important;
  font-family: var(--font-sans);
}


#footer-flexbox {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
}

.footerlink {
  color: var(--text-muted) !important;
  font-weight: 500;
}

.footerlink:hover {
  color: var(--accent) !important;
}
/* -------------------------------------------------------------
   UNIFIED CENTER-COLUMN PAGE LAYOUT (ALL PAGES)
   ------------------------------------------------------------- */

/* 1. Force a consistent 1100px max-width on all page layout containers */
.outerContainer,
.container,
.mainDiv,
.divContainerHeader,
.divContainer,
.xContainer,
.mainContainer {
  max-width: 1100px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}

/* 2. Style standard content panels with safe, theme-appropriate borders and surfaces */
.quotebox, 
.message, 
.postPageArticle,
.divContainer,
.divContainerHeader {
  border: 1px solid var(--border) !important;
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-radius: 6px;
  padding: 20px !important; /* Soft, readable breathing room inside boxes */
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

/* 3. Configure vertical spacing (top/bottom margins) for page layouts */
.outerContainer,
.divContainerHeader,
.mainDiv,
.xContainer {
  margin-top: 3rem !important;
  margin-bottom: 2rem !important;
}

/* Adjust spacing specifically for content columns */
.divContainerHeader {
  margin-top: 3rem !important;
  margin-bottom: 1rem !important;
}

.divContainer {
  margin-bottom: 4rem !important;
}

/* Anchors the control panel to the bottom of the container, preventing content shifts */
.controlpanel {
  position: sticky !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 99 !important;
  background-color: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  
  /* Margins & paddings designed to close gaps with the card container */
  padding: 15px 20px !important;
  margin: 25px -15px -15px -15px !important; /* Pulls boundaries flush to container edges */
  border-radius: 0 0 6px 6px !important;
}

/* Flexbox configuration ensuring buttons stay centered and neatly packed */
#control1 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px; /* Standardized spacing between navigation buttons */
  max-width: 100%;
  margin: 0 auto !important;
  border: none !important;
  background-color: transparent !important;
  padding: 0 !important;
}

/* Subtle focus indicator on the active question block */
#question-box {
  position: relative;
  overflow: visible !important;
}
/* -------------------------------------------------------------
   EXERCISE BOOK & QUIZ THEME INTEGRATION (COMPREHENSIVE)
   ------------------------------------------------------------- */

/* 1. Bulletproof Fixed Bottom Control Panel (Never shifts or jumps) */
.controlpanel {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 99999 !important;               /* Sits safely on top of all other elements */
  background-color: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  padding: 15px 24px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.12) !important;
}

/* Adds bottom padding so scrollable content is never covered by the fixed bar */
body, 
.CONTENT,
#question-box {
  padding-bottom: 95px !important;
}

/* 2. Force all exercise book containers, boxes, and modals to use variables */
#question-box,
.questionheader,
.containerStart,
#startBtnImg,
#textSummary,
#etype1,
#wmtypeX,
#MCQSCC,
#pickType,
#inputType,
#gapfill,
#matchBox,
.modal-content {
  background-color: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

/* Style inputs, table rows, and fields on the quiz page */
#inputField,
#wordsTable tr,
#adjectivesTable tr,
.tableRow,
.titleField,
.contentField {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}

/* Style the quiz table headers with the active theme accent */
.tableHeader, 
.tableHeader th {
  background-color: var(--accent) !important;
  color: var(--bg) !important;
  font-weight: 700;
}

/* Modals backdrop styling */
.modal {
  background-color: rgba(0, 0, 0, 0.6) !important;
}
