/* CSCS Practice Test - Main Stylesheet */
/* Mobile-first responsive design */
/* Color scheme: Construction orange/dark */

:root {
  --primary: #ea580c;
  --primary-dark: #c2410c;
  --primary-light: #fb923c;
  --bg-warm: #fff7ed;
  --bg-white: #ffffff;
  --text-dark: #1e293b;
  --text-mid: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* HEADER */
.site-header {
  background: var(--text-dark);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}

.site-logo:hover { color: var(--primary-light); text-decoration: none; }

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-toggle {
  display: block;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.main-nav {
  display: none;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--text-dark);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 0;
  box-shadow: var(--shadow-lg);
}

.main-nav.active { display: block; }

.main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-nav li a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #cbd5e1;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s;
}

.main-nav li a:hover,
.main-nav li a.active {
  background: rgba(234,88,12,0.15);
  color: var(--primary-light);
  text-decoration: none;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--text-dark) 0%, #334155 100%);
  color: #fff;
  padding: 3rem 1rem;
  text-align: center;
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--primary-light); }

.hero p {
  font-size: 1.05rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.stat-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.stat-badge .stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
}

.stat-badge .stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234,88,12,0.35);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* MAIN CONTENT */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.content-section {
  padding: 3rem 1rem;
}

.content-narrow {
  max-width: 800px;
  margin: 0 auto;
}

/* PAGE HERO (smaller, for inner pages) */
.page-hero {
  background: linear-gradient(135deg, var(--text-dark) 0%, #334155 100%);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: #94a3b8;
  font-size: 0.95rem;
}

/* BREADCRUMB */
.breadcrumb {
  padding: 0.75rem 1rem;
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.breadcrumb-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-mid); }

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-warm);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.card p {
  color: var(--text-mid);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link:hover { text-decoration: none; }

/* ARTICLE CONTENT */
.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.article-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text-dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--bg-warm);
}

.article-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-dark);
}

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--text-mid);
}

.article-content ul, .article-content ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--text-mid);
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content strong {
  color: var(--text-dark);
}

/* INFO BOXES */
.info-box {
  padding: 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.info-box.tip { background: var(--success-bg); border-color: var(--success); }
.info-box.warning { background: var(--warning-bg); border-color: var(--warning); }
.info-box.info { background: var(--info-bg); border-color: var(--info); }
.info-box.danger { background: var(--error-bg); border-color: var(--error); }

.info-box-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* TABLES */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-wrap th {
  background: var(--text-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.table-wrap td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
}

.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:nth-child(even) { background: var(--bg-warm); }

/* QUIZ ENGINE STYLES */
.quiz-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.quiz-header {
  text-align: center;
  margin-bottom: 2rem;
}

.quiz-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Progress Bar */
.progress-wrap {
  margin-bottom: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

.progress-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Question Card */
.question-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.question-number {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
}

/* Options */
.options-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.option-item {
  margin-bottom: 0.5rem;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  line-height: 1.5;
}

.option-label:hover {
  border-color: var(--primary-light);
  background: var(--bg-warm);
}

.option-label input[type="radio"] {
  display: none;
}

.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--bg-warm);
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-mid);
  transition: all 0.2s;
}

.option-label:hover .option-letter {
  border-color: var(--primary-light);
  color: var(--primary);
}

.option-label.selected {
  border-color: var(--primary);
  background: #fff7ed;
}

.option-label.selected .option-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.option-label.correct {
  border-color: var(--success);
  background: var(--success-bg);
}

.option-label.correct .option-letter {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.option-label.incorrect {
  border-color: var(--error);
  background: var(--error-bg);
}

.option-label.incorrect .option-letter {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

.option-label.disabled {
  cursor: default;
  opacity: 0.7;
}

.option-label.disabled:hover {
  border-color: var(--border);
  background: transparent;
}

/* Explanation */
.explanation {
  display: none;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.explanation.show { display: block; }

.explanation.correct-exp {
  background: var(--success-bg);
  border: 1px solid rgba(22,163,74,0.2);
  color: #166534;
}

.explanation.incorrect-exp {
  background: var(--error-bg);
  border: 1px solid rgba(220,38,38,0.2);
  color: #991b1b;
}

.explanation strong { display: block; margin-bottom: 0.25rem; }

/* Navigation Buttons */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.quiz-nav .btn { min-width: 120px; justify-content: center; }

/* Results */
.quiz-results {
  display: none;
  text-align: center;
  padding: 2rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.quiz-results.show { display: block; }

.results-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
}

.results-circle.pass {
  background: var(--success-bg);
  border: 4px solid var(--success);
  color: var(--success);
}

.results-circle.fail {
  background: var(--error-bg);
  border: 4px solid var(--error);
  color: var(--error);
}

.results-circle .pct { font-size: 0.9rem; font-weight: 600; }

.results-status {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.results-status.pass { color: var(--success); }
.results-status.fail { color: var(--error); }

.results-detail {
  color: var(--text-mid);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.results-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

.breakdown-item {
  padding: 1rem;
  background: var(--bg-warm);
  border-radius: var(--radius);
}

.breakdown-item .num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.breakdown-item .label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* TIMER */
.quiz-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
}

/* AD SLOTS */
.ad-slot {
  background: var(--bg-warm);
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin: 2rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot-inline {
  margin: 1.5rem 0;
}

/* FAQ SECTION */
.faq-section { margin: 2rem 0; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: var(--bg-white);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.2s;
}

.faq-question:hover { background: var(--bg-warm); }

.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--primary);
  flex-shrink: 0;
  transition: transform 0.3s;
}

.faq-item.open .faq-question::after {
  content: '\2212';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* DISCLAIMER */
.disclaimer {
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
  font-size: 0.85rem;
  color: #92400e;
}

.disclaimer strong { color: #78350f; }

/* FOOTER */
.site-footer {
  background: var(--text-dark);
  color: #94a3b8;
  padding: 3rem 1rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li { margin-bottom: 0.5rem; }

.footer-col a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-col a:hover { color: var(--primary-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

.footer-bottom a { color: #94a3b8; }

/* UPDATED BADGE */
.updated-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--success-bg);
  color: var(--success);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* TOPIC TAGS */
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-mid);
  text-decoration: none;
  transition: all 0.2s;
}

.topic-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

/* INTERNAL LINKS SECTION */
.related-tests {
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}

.related-tests h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.related-tests-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.related-test-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s;
}

.related-test-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateX(4px);
}

.related-test-link .arrow { color: var(--primary); margin-left: auto; }

/* TABLET */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.1rem; }
  .page-hero h1 { font-size: 1.75rem; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .related-tests-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* DESKTOP */
@media (min-width: 1024px) {
  .hero { padding: 4rem 2rem; }
  .hero h1 { font-size: 2.75rem; }
  .page-hero h1 { font-size: 2rem; }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .content-section { padding: 4rem 2rem; }
  .article-content { padding: 3rem 2rem; }
  .article-content h2 { font-size: 1.6rem; }

  .nav-toggle { display: none; }

  .main-nav {
    display: flex;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
  }

  .main-nav ul {
    display: flex;
    gap: 0;
  }

  .main-nav li a {
    padding: 1rem 0.85rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .footer-grid { grid-template-columns: repeat(4, 1fr); }
  .results-breakdown { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1200px) {
  .hero h1 { font-size: 3rem; }
}

/* PRINT */
@media print {
  .site-header, .site-footer, .ad-slot, .quiz-nav, .nav-toggle { display: none; }
  .article-content { padding: 0; }
  body { font-size: 12pt; }
}
