/* =========================
   Exam Study Aid — Dark Theme (Full Site)
   Cleaned + No Duplicates
========================= */

/* ---------- Theme Variables ---------- */
:root{
  /* Backgrounds */
  --bg: #0b1118;
  --bg-2: #0c131b;
  --bg-3: #0e1620;
  --topbar-1: #0e141c;
  --topbar-2: #0b1118;

  /* Text */
  --text: rgba(255,255,255,0.88);
  --muted: rgba(255,255,255,0.62);
  --faint: rgba(255,255,255,0.45);

  /* Accents */
  --accent: #22c1ff;
  --accent-2: #60a5fa;
  --danger: #ff5a5f;

  /* Borders + shadows */
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.12);
  --shadow: 0 18px 40px rgba(0,0,0,0.55);

  /* Radius */
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
}

/* ---------- Base / Reset ---------- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(1200px 700px at 20% 0%, rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(34,193,255,0.06), transparent 55%),
    var(--bg);
  color: var(--text);
}

body{
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Links */
a { color: var(--accent); }
a:hover { color: #8fe6ff; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6rem 0;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.2px;
}

p { color: var(--text); line-height: 1.6; }
small { color: var(--muted); }

hr{
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

/* Lists (global) */
ul { padding-left: 1.3rem; }
li { margin-bottom: 0.55rem; color: var(--text); }

/* ---------- Layout Helpers ---------- */
.container{
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
}

/* Main content wrapper you already use */
.content {
  width: min(1100px, calc(100% - 48px));
  margin: 22px auto;
  padding: 24px;

  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 14px 35px rgba(0,0,0,0.35);
}

/* =========================
   Top Bar
========================= */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;

  height: 70px;              /* fixed height (navbar doesn't grow) */
  padding: 0 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(180deg, var(--topbar-1) 0%, var(--topbar-2) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Logo (single definition) */
.logo{
  display: flex;
  align-items: center;
  gap: 14px;

  height: 100%;
  text-decoration: none;
  color: #fff;

  font-weight: 800;
  font-size: 20px;           /* text size stays like you wanted */
  letter-spacing: 0.2px;
}

.logo-img{
  height: 105px;              /* BIG logo, but contained */
  width: auto;
  display: block;
  object-fit: contain;
}

.logo-text{
  line-height: 1.05;
}

/* Nav */
.nav{
  display: flex;
  align-items: center;
  gap: 26px;

  margin-left: auto;
  margin-right: auto;
}

/* top-level nav links */
.nav-link{
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.6px;
  text-transform: uppercase;

  padding: 10px 10px;
  border-radius: 12px;

  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.nav-link:hover{
  color: #fff;
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.nav-link:active{
  transform: translateY(0);
}
.dropdown-trigger{
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 10px 10px;
  box-shadow: none;
}

.dropdown-trigger:hover{
  background: rgba(255,255,255,0.06);
  border-color: transparent;
}

.dropdown-trigger:focus{
  outline: none;
}

.dropdown-trigger:focus-visible{
  outline: 2px solid rgba(34,193,255,0.45);
  outline-offset: 2px;
}

/* Account link/button */
.account a{
  color: rgba(255,255,255,0.74);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 12px;
  transition: color 0.18s ease, background 0.18s ease;
}

.account a:hover{
  color: #fff;
  background: rgba(255,255,255,0.06);
}

/* =========================
   Dropdown (IGCSE / A-Levels)
========================= */
.dropdown{
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* dropdown panel */
.dropdown-menu{
  position: absolute;
  top: calc(100% + 12px);
  left: 0;

  min-width: 200px;
  padding: 10px;

  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  z-index: 2000;

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

/* show */
.dropdown:hover .dropdown-menu{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* dropdown items */
.dropdown-menu a{
  display: flex;
  align-items: center;

  padding: 10px 12px;
  border-radius: 12px;

  color: rgba(255,255,255,0.86) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;

  transition: background 0.16s ease, color 0.16s ease;
}

.dropdown-menu a:hover{
  background: rgba(255,255,255,0.07);
  color: #fff !important;
}

/* invisible hover bridge (prevents flicker) */
.dropdown::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:100%;
  height:14px;
}

/* =========================
   Buttons (general)
========================= */
button,
.btn{
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: background 0.18s ease, transform 0.18s ease, border 0.18s ease;
}

button:hover,
.btn:hover{
  background: rgba(255,255,255,0.10);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

button:active,
.btn:active{
  transform: translateY(0);
}

/* primary button */
.btn-primary{
  background: rgba(34,193,255,0.14);
  border-color: rgba(34,193,255,0.25);
  color: #dff7ff;
}

.btn-primary:hover{
  background: rgba(34,193,255,0.20);
}

/* =========================
   Inputs
========================= */
input, select, textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  outline: none;
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(34,193,255,0.35);
  box-shadow: 0 0 0 4px rgba(34,193,255,0.12);
}

/* =========================
   Cards / Panels
========================= */
.card{
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.card-title{
  font-weight: 800;
  letter-spacing: 0.2px;
}

.muted{ color: var(--muted); }

/* =========================
   Footer
========================= */
.footer{
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 22px 28px;

  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border-top: 1px solid var(--border);

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.footer-quote{
  font-weight: 600;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.2px;
}

.footer-credit{
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.35px;
  font-size: 13px;
}

/* =========================
   Account Page / Menu
========================= */
.account-container{
  max-width: 460px;
  margin: 70px auto;
  padding: 26px;

  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 45px rgba(0,0,0,0.45);

  color: #fff;
}

.account-container h1{
  text-align: center;
  margin-bottom: 16px;
  font-size: 1.7rem;
}

.account-username,
.account-note{
  text-align: center;
  margin-bottom: 16px;
  color: var(--muted);
}

/* Account menu list (overrides global UL styling) */
.account-menu{
  list-style: none;
  padding: 0;
  margin: 0;
}

.account-menu li{
  margin: 0 0 12px 0;
}

/* remove default form spacing */
.account-menu form{ margin: 0; }

/* menu items */
.account-menu a,
.account-menu button{
  width: 100%;
  display: block;
  padding: 12px 14px;
  text-align: center;

  border-radius: 14px;
  border: 1px solid var(--border);

  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.88);

  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;

  transition: background 0.18s ease, transform 0.16s ease, border 0.18s ease;
}

.account-menu a:hover,
.account-menu button:hover{
  background: rgba(255,255,255,0.10);
  border-color: var(--border-2);
  transform: translateY(-1px);
}

.account-menu a:active,
.account-menu button:active{
  transform: translateY(0);
}

/* Premium button */
.account-menu .premium-btn{
  background: rgba(34,193,255,0.14);
  border-color: rgba(34,193,255,0.25);
  color: #dff7ff;
}

.account-menu .premium-btn:hover{
  background: rgba(34,193,255,0.20);
}

/* Logout button */
.account-menu .logout-btn{
  background: rgba(255,90,95,0.14);
  border-color: rgba(255,90,95,0.25);
  color: rgba(255,255,255,0.92);
}

.account-menu .logout-btn:hover{
  background: rgba(255,90,95,0.20);
}

/* =========================
   Utility
========================= */
.highlight{
  color: var(--accent);
  font-weight: 800;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

/* =========================
   Responsive: logo on small screens
========================= */
@media (max-width: 520px){
  .logo-text{ display: none; }
  .logo-img{ height: 52px; }
}

/* =========================
   Subject Index Pages
   (IGCSE / Edexcel, IGCSE / CIE, etc.)
========================= */

.subject-index-page{
  padding: 2rem 1rem 4rem;
}

/* override the default .content card a bit for these landing pages */
.content.subject-index-page{
  width: min(1240px, calc(100% - 48px));
  padding: 28px;
}

.subject-index-card{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  border-radius: 24px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.subject-index-card h1{
  margin: 0 0 2rem;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.subjects-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 2rem;
}

.subject-card{
  position: relative;
}

.subject-btn{
  width: 100%;
  min-height: 82px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  color: #ffffff;
  font-size: 1.7rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  box-shadow: none;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.subject-btn:hover{
  transform: translateY(-2px);
  border-color: rgba(138,220,255,0.65);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
}

.subject-btn:active{
  transform: translateY(0);
}

.subject-dropdown{
  display: none;
  margin-top: 0.8rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: rgba(8,14,22,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 12px 28px rgba(0,0,0,0.30);
}

.subject-dropdown.open{
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.subject-dropdown a{
  display: block;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  color: #f3f7fb;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease;
}

.subject-dropdown a:hover{
  background: rgba(138,220,255,0.14);
  color: #9fe7ff;
}

/* ---------- Subject index responsive ---------- */
@media (max-width: 980px){
  .subjects-grid{
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 640px){
  .content.subject-index-page{
    padding: 20px;
  }

  .subject-index-page{
    padding: 1.2rem 0 3rem;
  }

  .subject-index-card h1{
    font-size: 1.7rem;
    margin-bottom: 1.4rem;
  }

  .subjects-grid{
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .subject-btn{
    font-size: 1.35rem;
    min-height: 72px;
  }
}

/* =========================
   Auth Pages (login, signup, etc.)
========================= */

/* Outer centering wrapper */
.auth-page{
  min-height: 70vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem 6rem;
}

/* Card */
.auth-card{
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}

/* Heading */
.auth-title{
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
  margin: 0 0 1.5rem;
}

/* Google button — white, dark text, G icon left */
.google-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid #dadce0;
  background: #ffffff;
  color: #3c4043;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.google-btn svg{
  flex-shrink: 0;
  display: block;
}

.google-btn:hover{
  background: #f8f9fa;
  color: #3c4043;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  transform: translateY(-1px);
}

.google-btn:active{
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* or divider */
.auth-divider{
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.25rem 0;
}

.auth-divider::before,
.auth-divider::after{
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.auth-divider span{
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* Field: label stacked above input */
.auth-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 1rem;
}

.auth-field label{
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.auth-field input{
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.88);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-field input:focus{
  border-color: rgba(34,193,255,0.50);
  box-shadow: 0 0 0 4px rgba(34,193,255,0.12);
  outline: none;
}

/* Defeat Chrome autofill yellow */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:focus{
  -webkit-box-shadow: 0 0 0 1000px #0d1520 inset;
  -webkit-text-fill-color: rgba(255,255,255,0.88);
  caret-color: rgba(255,255,255,0.88);
}

/* Select field */
.auth-field select {
  padding: 0.6rem 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.auth-field select option {
  background: #0b1118;
  color: rgba(255,255,255,0.9);
}

.auth-field select + select {
  margin-top: 0;
}

.auth-field .date-select {
  flex: 1;
  min-width: 0;
}

.auth-field:has(select[name*='date']) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-field:has(select[name*='date']) label {
  width: 100%;
  margin-bottom: 4px;
}

.auth-field:has(select[name*='date']) select {
  flex: 1;
  min-width: 80px;
}

.date-row {
  display: flex;
  gap: 10px;
}

.date-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.date-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* Error message */
.auth-error{
  font-size: 13px;
  color: var(--danger);
  margin: -0.25rem 0 0.75rem;
}

/* Submit button */
.auth-btn{
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(34,193,255,0.35);
  background: rgba(34,193,255,0.18);
  color: #dff7ff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.auth-btn:hover{
  background: rgba(34,193,255,0.27);
  border-color: rgba(34,193,255,0.50);
  transform: translateY(-1px);
}

.auth-btn:active{
  transform: translateY(0);
}

/* Bottom links row */
.auth-links{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1.25rem;
  font-size: 14px;
  color: var(--muted);
}

.auth-links a{
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover{
  color: #8fe6ff;
}

.auth-subtitle{
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  text-align: center;
  margin: -0.5rem 0 1.5rem;
  line-height: 1.5;
}

.auth-help{
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  line-height: 1.4;
}

.account-subscription-status {
  list-style: none;
}

.account-subscription-status a,
.account-subscription-status span,
.account-subscription-status {
  display: block;
  width: 100%;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.08);
  color: #4ade80;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

/* =========================
   Date of Birth Row
========================= */
.date-birth-field .date-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.date-birth-field .date-row select {
  width: 100%;
}