@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap');

/* ==========================================================================
   BBC Academy — new-design theme for the OLD pages (theme-new.css)
   Loaded AFTER styles.css on every page except index.html (which already
   uses new-home.css). Content, copy, forms, quiz and dashboards are
   untouched: this file only re-skins colours, fonts, buttons, cards,
   header and footer to the new main-page design system:
     cream #f6f2e9 / paper #fffdf8 / sand #e8dfd0
     navy #102a43 / navy-deep #0b2035 / navy-soft #183c59
     red #c94243 / red-deep #a83238 / muted #64727b
     serif Playfair Display (EN) / IBM Plex Sans Arabic (AR)
     buttons: solid red, 3px radius, hover translateY(-2px)
   ========================================================================== */

:root {
  --new-navy: #102a43;
  --new-navy-deep: #0b2035;
  --new-navy-soft: #183c59;
  --new-red: #c94243;
  --new-red-deep: #a83238;
  --new-cream: #f6f2e9;
  --new-paper: #fffdf8;
  --new-sand: #e8dfd0;
  --new-ink: #172d3d;
  --new-muted: #64727b;
  --new-line: rgba(16, 42, 67, .14);
  --new-serif: 'Playfair Display', Georgia, serif;
  --new-sans: 'DM Sans', sans-serif;
  --new-arabic: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}

/* ---------- Base ---------- */
html { overflow-x: hidden; }
body {
  background: var(--new-cream);
  color: var(--new-ink);
  font-family: var(--new-arabic), var(--new-sans);
  line-height: 1.75;
}
html[dir="ltr"] body { font-family: var(--new-sans), var(--new-arabic); }
html[dir="rtl"] body { font-family: var(--new-arabic), var(--new-sans); }
a { color: inherit; }
a:hover { color: var(--new-red); }
::selection { background: var(--new-red); color: #fff; }
:focus-visible { outline: 2px solid var(--new-red); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--new-navy); letter-spacing: -.02em; }
html[dir="ltr"] h1, html[dir="ltr"] h2, html[dir="ltr"] h3, html[dir="ltr"] h4 {
  font-family: var(--new-serif); font-weight: 600;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4 {
  font-family: var(--new-arabic); font-weight: 700; letter-spacing: 0;
}
.muted, .card p, .section-subtitle { color: var(--new-muted); }
section { padding: 72px 0; }
main.wrap { padding-top: 8px; padding-bottom: 48px; }

/* ---------- Header (matches new topbar: dark navy, white links) ---------- */
header.site {
  position: sticky; top: 0; z-index: 1000;
  background: var(--new-navy-deep);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.nav { height: 76px; }
/* New brand mark: three boxes, middle one red — same as new main page */
.logo, a.logo { display: inline-flex; align-items: center; gap: 12px; direction: ltr; flex-direction: row; line-height: 1.05; flex-shrink: 0; }
.logo:hover { color: inherit; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.brand-mark b { background: #fff; color: var(--new-navy); font: 700 12px/1 var(--new-sans); padding: 6px 5px 5px; letter-spacing: -.05em; }
.brand-mark b:nth-child(2) { background: var(--new-red); color: #fff; }
.brand-copy { line-height: 1.05; text-align: left; }
.brand-copy strong { font: 700 13px var(--new-sans); letter-spacing: .14em; display: block; color: #fff; }
.brand-copy small { color: rgba(255, 255, 255, .68); font: 500 9px var(--new-sans); letter-spacing: .15em; display: block; margin-top: 5px; text-transform: uppercase; }
nav.main a { color: rgba(255, 255, 255, .82); font-size: 13px; font-weight: 500; padding: 8px 11px; border-radius: 3px; }
nav.main a::after { background: var(--new-red); }
nav.main a:hover, nav.main a.active { color: #fff; }
.langbtn {
  background: transparent; border: 1px solid rgba(255, 255, 255, .34);
  color: #fff; padding: 8px 11px; border-radius: 3px; font-size: 12px; font-weight: 700;
}
.langbtn:hover { color: #fff; border-color: #fff; }
.hamburger { border: 1px solid rgba(255, 255, 255, .34); border-radius: 3px; }
.hamburger span { background: #fff; }

/* ---------- Buttons (new design: solid red, 3px, lift on hover) ---------- */
.btn, .btn-primary, a.btn-primary {
  background: var(--new-red); border: 1px solid var(--new-red); color: #fff;
  border-radius: 3px; box-shadow: none; padding: 14px 20px;
  font-size: 13px; font-weight: 700;
}
.btn::before { display: none; }
.btn:hover, .btn-primary:hover {
  background: var(--new-red-deep); border-color: var(--new-red-deep);
  transform: translateY(-2px); box-shadow: none; color: #fff;
}
.btn.small { padding: 9px 18px; font-size: .85rem; border-radius: 3px; }
/* Outline buttons on the light page background: navy, not white */
main .btn.outline {
  background: transparent; color: var(--new-navy);
  border: 1px solid rgba(16, 42, 67, .4); box-shadow: none;
}
main .btn.outline:hover {
  color: var(--new-red); border-color: var(--new-red); transform: translateY(-2px); box-shadow: none;
}
/* Outline buttons inside the dark header: white, as on the new main page */
header .btn.outline {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .48); box-shadow: none;
}
header .btn.outline:hover { color: #fff; border-color: #fff; }
/* Active filter (app.js adds .teal): solid red, overriding outline */
main .btn.teal {
  background: var(--new-red); border-color: var(--new-red); color: #fff; box-shadow: none;
}
main .btn.teal:hover { background: var(--new-red-deep); border-color: var(--new-red-deep); color: #fff; }

/* ---------- Cards, tags, prices ---------- */
.card {
  background: var(--new-paper); border: 1px solid var(--new-line);
  border-radius: 3px; box-shadow: none; overflow-wrap: break-word;
}
.card:hover { border-color: rgba(16, 42, 67, .3); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(16, 42, 67, .08); }
.card p { color: var(--new-muted); }
.tag {
  background: rgba(201, 66, 67, .08); color: var(--new-red);
  border: 1px solid rgba(201, 66, 67, .25); border-radius: 3px;
}
.price { color: var(--new-navy); font-family: var(--new-serif); }
html[dir="rtl"] .price { font-family: var(--new-arabic); }
.step-num { color: var(--new-red); font-family: var(--new-serif); }
html[dir="rtl"] .step-num { font-family: var(--new-arabic); }
.teacher-icon { color: var(--new-red); }

/* ---------- Page hero / section headers ---------- */
.hero {
  background: var(--new-navy-deep); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 3px; color: #fff;
}
.hero h1 { color: #fff; }
.hero p { color: rgba(255, 255, 255, .76); }
.hero-accent { color: #e8bca0; text-shadow: none; }
.hero-stat { background: var(--new-paper); border: 1px solid var(--new-line); border-radius: 3px; }
.hero-stat strong { color: var(--new-navy); }
.hero-stat span { color: var(--new-muted); }
.pill, .section-tag {
  border: 1px solid rgba(201, 66, 67, .35); color: var(--new-red); border-radius: 3px;
}
.section-title { color: var(--new-navy); }
.final-cta {
  background: var(--new-navy-deep); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 3px; color: #fff;
}
.final-cta h2 { color: #fff; }
.final-cta p { color: rgba(255, 255, 255, .65); }

/* ---------- Forms, tables, quiz, dashboards ---------- */
.field label { color: var(--new-navy); }
input, select, textarea {
  background: #fffefa; border: 1px solid #d9d5ce; border-radius: 2px;
  color: var(--new-ink);
}
input::placeholder, textarea::placeholder { color: #9aa3ab; }
input:focus, select:focus, textarea:focus {
  border-color: var(--new-navy-soft); box-shadow: 0 0 0 3px rgba(16, 42, 67, .08);
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--new-red); }
table { color: var(--new-ink); }
table th { color: var(--new-navy); border-bottom: 1px solid var(--new-line); }
table td { border-bottom: 1px solid var(--new-line); }
.bar { background: var(--new-sand); }
.bar i { background: var(--new-red); }
.quiz-opt {
  background: var(--new-paper); border: 1px solid var(--new-line);
  color: var(--new-ink); border-radius: 3px;
}
.quiz-opt:hover { border-color: var(--new-red); background: rgba(201, 66, 67, .06); }
.faq-item { background: var(--new-paper); border: 1px solid var(--new-line); border-radius: 3px; }
.faq-item summary:hover { color: var(--new-red); }
.alert { background: rgba(255, 180, 0, .08); border-color: rgba(255, 180, 0, .35); color: #8a6a00; }
.success { background: #e9f0e9; border-color: #5c806d; color: #294a3c; }
.badge-ok { background: rgba(92, 128, 109, .14); color: #294a3c; border-color: rgba(92, 128, 109, .35); }
.badge-pending { background: rgba(255, 180, 0, .12); color: #8a6a00; border-color: rgba(255, 180, 0, .35); }
.about-photo { border-radius: 3px; border: 1px solid var(--new-line); }

/* ---------- Footer (matches new footer: dark navy, 4 columns) ---------- */
footer {
  background: #091b2c; border-top: 0; margin-top: 48px; padding: 55px 0 24px; color: #fff;
}
footer .footer-grid { padding-bottom: 42px; }
.footer-brand p { color: rgba(255, 255, 255, .52); }
.footer-links h5 {
  font-family: var(--new-sans); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: #e4b498; margin-bottom: 16px;
}
.footer-links li { color: rgba(255, 255, 255, .68); font-size: 12px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 19px; }
.footer-bottom p { color: rgba(255, 255, 255, .42); font-size: 10px; }
.skip-link { background: var(--new-red); border-radius: 3px; }

/* ---------- Responsive (mirror new design breakpoints) ---------- */
@media (max-width: 1024px) {
  nav.main { background: var(--new-navy-deep); top: 76px; max-height: calc(100vh - 76px); border-bottom: 1px solid rgba(255, 255, 255, .14); }
  nav.main a { color: rgba(255, 255, 255, .82); }
  nav.main a:hover, nav.main a.active { color: #fff; }
  .nav-actions .btn { display: none; }
}
@media (max-width: 768px) {
  section { padding: 48px 0; }
  footer .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 640px) {
  section { padding: 32px 0; }
  .card { padding: 20px; }
}
