body {
  background-color: #f7f9fc; /* soft light blue-gray */
}

/* Container styling for consistent spacing */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* HERO: Exam header as banner */
/* HERO: Exam header as banner */
.exam-header{
  position: relative;
  margin: 0 0 1.75rem;
  border-radius: 18px;
  overflow: hidden;
  text-align: center;
  color: #eaf2ff;                        /* light text */
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  padding: clamp(36px, 6vw, 80px) clamp(20px, 5vw, 56px);
}

/* gradient background sits BEHIND the text */
.exam-header::before{
  content:"";
  position:absolute; inset:0;
  z-index: 0;                            /* <-- important */
  background:
    radial-gradient(1200px 320px at 90% -20%, rgba(96,165,250,.25), transparent 55%),
    linear-gradient(180deg, #123061 0%, #0f2550 100%);
}

/* ensure text is above the overlay and inherits the light color */
.exam-header > *{ position: relative; z-index: 1; }
.exam-header h1,
.exam-header p{ color: inherit !important; }

html.dark-mode .exam-header{ color: #cfe7ff; }
html.dark-mode .exam-header::before{
  background:
    radial-gradient(1200px 320px at 95% -20%, rgba(96,165,250,.18), transparent 55%),
    linear-gradient(180deg, #0f1f3e 0%, #0b1833 100%);
}


/* Section containers with white background */
.exam-section {
  background: #ffffff;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

/* Section headings */
.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.2rem;
  color: #2c3e50;
}

/* Grid remains same */
.paper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem; /* Adjust spacing between cards */
  margin: 2rem; /* Optional: balance internal padding */
}


/* Card style */
.paper-card {
  background: #fcfcfc;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #e4e4e4;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.paper-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.main-heading {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: #1a3c5d;
}

.subtext {
  font-size: 1rem;
  text-align: center;
  margin-bottom: 2rem;
  color: #555;
}

.flip-card {
  background-color: transparent;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 200px;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 1rem;
  backface-visibility: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flip-card-front {
  background-color: #d6e3ec; 
}

.flip-card-back {
 background-color: #d0dde7;
  transform: rotateY(180deg);
  gap: 0.5rem;
}

.exam-section {
  background: #e5eff5; /* a bit darker, cool pastel blue-gray */
  padding: 2rem;
  margin-bottom: 3rem;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
}

.see-all-link {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  color: white;
  background-color: #3f87a6; /* main Reko Study blue */
  border-radius: 30px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: background-color 0.3s, transform 0.2s;
}

.see-all-link:hover {
  background-color: #336c88;
  transform: translateY(-2px);
}

.button.small {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  background-color: #3f87a6;
  margin: 0.5rem;
  color: white;
  border: none;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.button.small:hover {
  background-color: #336c88;
  transform: translateY(-1px);
}

/* 🌐 Page Background */
body {
  background-color: #f5f8fb;
}

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* 🎯 FILTER SECTION */
.exam-filter-card {
  background-color: #e6eff7;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.exam-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
}

/* Card shell */
.exam-filter-card{
  --brand:#3f87a6;
  --brand-dark:#326d88;
  --ink:#2c3e50;

  background:
    radial-gradient(800px 220px at 110% -20%, rgba(96,165,250,.18), transparent 60%),
    linear-gradient(180deg, #eef5fb, #e8f1f8);
  border: 1px solid rgba(63,135,166,.18);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 10px 22px rgba(0,0,0,.05), inset 0 1px 0 rgba(255,255,255,.5);
  margin-bottom: 1.5rem;
}

/* Layout */
.exam-filter-form{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem 1.25rem;
  align-items: end;
}

.filter-group label{
  display:block;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 .35rem;
  letter-spacing:.2px;
}

/* Pretty selects with custom chevron */
.select-wrap{ position: relative; }
.select-wrap::after{
  content: "▾";
  position: absolute;
  right: .65rem; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #64748b;
  font-size: .9rem;
}
.select-wrap select{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  width: 100%;
  padding: .55rem .95rem;
  padding-right: 2rem; /* room for chevron */
  border-radius: 10px;
  border: 1px solid #c9d6e2;
  background: #ffffff;
  color: #1f2937;
  font-size: .95rem;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.select-wrap select:focus{
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(63,135,166,.18);
}

/* Buttons */
.filter-buttons{
  display:flex;
  gap:.6rem;
  align-items:center;
}
.button.small{
  padding: .5rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
}
/* Apply Filters button brand color */
.primary-btn{
  background-color: #1e40af !important;
  color: #fff !important;
  border: none;
}
.primary-btn:hover{
  background-color: #17358f !important; /* slightly darker hover */
}
.primary-btn:focus-visible{
  outline: 3px solid rgba(30,64,175,.35);
  outline-offset: 2px;
}

/* Dark mode keeps same brand */
html.dark-mode .primary-btn{
  background-color: #1e40af !important;
}
html.dark-mode .primary-btn:hover{
  background-color: #17358f !important;
}

.secondary-btn{
  background: #f1f5f9;
  color: #334155 !important;
  border: 1px solid #d2dee8;
}
.secondary-btn:hover{ background:#e8eef5; }

/* Dark mode */
html.dark-mode .exam-filter-card{
  background:
    radial-gradient(800px 220px at 110% -20%, rgba(96,165,250,.14), transparent 60%),
    linear-gradient(180deg, #1b2230, #151c28);
  border-color: rgba(148,163,184,.22);
  box-shadow: 0 10px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.03);
}
html.dark-mode .filter-group label{ color:#e5e7eb; }
html.dark-mode .select-wrap::after{ color:#94a3b8; }
html.dark-mode .select-wrap select{
  background:#0f172a;
  color:#e5e7eb;
  border:1px solid #334155;
  box-shadow:none;
}
html.dark-mode .select-wrap select:focus{
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(63,135,166,.22);
}
html.dark-mode .secondary-btn{
  background:#0f172a;
  color:#e2e8f0 !important;
  border:1px solid #334155;
}

/* 🧾 HEADER */
.exam-header h1 {
  font-size: 1.8rem;
  color: #1c3a4f;
  margin-bottom: 0.5rem;
}

.exam-header p {
  color: #555;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* 🧮 EXAM CARDS */
.exam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.exam-card {
  background-color: #ffffff;
  padding: 1.2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.exam-info h3 {
  font-size: 1.1rem;
  color: #2d2d2d;
  margin-bottom: 0.5rem;
}

.exam-info h4 {
  font-size: 0.95rem;
  color: #444;
  margin-bottom: 0.25rem;
}

.exam-meta {
  font-size: 0.9rem;
  color: #666;
}

/* 📂 BUTTON GROUPS */
.exam-actions {
  margin-top: 1rem;
}

.button-group-horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.button {
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: 20px;
  background-color: #1e40af;
  color: white;
  text-decoration: none;
  border: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.button:hover {
  background-color: #336c88;
  transform: translateY(-1px);
}

.secondary-button {
  background-color: #e0e0e0;
  color: #333;
}

.secondary-button:hover {
  background-color: #d0d0d0;
}

/* 📢 ADS */
.ads-section {
  margin: 2rem 0;
  text-align: center;
}

.ad-placeholder {
  background-color: #dbe7f1;
  color: #555;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px dashed #a5b6c6;
  padding: 1.5rem;
  text-align: center;
}

.ad-placeholder.leaderboard {
  min-height: 90px;
}

.ad-placeholder.rectangle {
  min-height: 280px;
}


.mock-set-section {
  margin-bottom: 3rem;
}

.set-title {
  font-size: 1.6rem;
  margin: 2rem 0 1rem;
  color: #003366;
}

.exam-set-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
}

/* Ensure 3 cards per row on large screens */
.exam-set-row .exam-card {
  flex: 0 1 32%;
  max-width: 32%;
  min-width: 260px;
  box-sizing: border-box; /* ✅ this line is critical */
}


/* On tablets: 2 per row */
@media (max-width: 1024px) {
  .exam-set-row .exam-card {
    flex: 1 1 calc(50% - 1rem);
  }
}

/* On phones: 1 per row */
@media (max-width: 600px) {
  .exam-set-row .exam-card {
    flex: 1 1 100%;
  }
}

/* Unified grid for paper cards */
.exam-grid.papers{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
  align-items: stretch;
}

/* Card: equal height + nicer hover */
.exam-card{
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e6eef5;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.exam-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.08);
  border-color: #d7e5f0;
}

.exam-info{ flex: 1; }
.exam-info h3{
  margin: 0 0 .35rem;
  font-size: 1.05rem;
  color: #11324a;
}

/* Tag row (level + board) */
.tags{
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  margin: .2rem 0 .5rem;
}
.badge{
  display: inline-block;
  padding: .22rem .55rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(0,0,0,.06);
}
.badge.level.foundation{ background: #fff7cc; color:#8a5a00; }
.badge.level.higher{     background: #e6f0ff; color:#1e40af; }

/* simple brand-y board colors (tweak if you like) */
.badge.board.edexcel{ background:#eef2ff; color:#1e40af; }
.badge.board.aqa{     background:#fff1f2; color:#b91c1c; }
.badge.board.ocr{     background:#ecfdf5; color:#065f46; }
.badge.board.custom{  background:#f1f5f9; color:#0f172a; }

.exam-meta{ color:#5b6b76; font-size: .92rem; }

/* Buttons pinned to bottom */
.exam-actions{ margin-top: .8rem; }
.button-group-horizontal{
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

/* Secondary button a bit subtler than primary */
.button.secondary-button{
  background-color: #eef3f7;
  color: #1f2b37;
}
.button.secondary-button:hover{
  background-color: #e3ebf2;
}

/* Dark mode polish */
html.dark-mode .exam-grid.papers{ gap: 1.1rem; }
html.dark-mode .exam-card{
  background: #1f2937;
  border-color: #334155;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
html.dark-mode .exam-card:hover{
  border-color: #3b5166;
  box-shadow: 0 12px 28px rgba(0,0,0,.3);
}
html.dark-mode .exam-info h3{ color:#e5e7eb; }
html.dark-mode .exam-meta{ color:#cbd5e1; }

html.dark-mode .badge{
  border-color: rgba(255,255,255,.06);
}
html.dark-mode .badge.level.foundation{ background:#3b2f0a; color:#f6e9b0; }
html.dark-mode .badge.level.higher{     background:#1b2a62; color:#a7c4ff; }

html.dark-mode .badge.board.edexcel{ background:#1c2552; color:#9ab6ff; }
html.dark-mode .badge.board.aqa{     background:#4a0e12; color:#ffc4c7; }
html.dark-mode .badge.board.ocr{     background:#103a2e; color:#9fe3cc; }
html.dark-mode .badge.board.custom{  background:#1f2937; color:#e5e7eb; }
