/* ============================================================
   Mastering.com Events — brand styles
   Colors, type & components from the supplied brand guidelines.
   ============================================================ */

/* ---- Self-hosted licensed fonts ---- */
@font-face {
  font-family: "Manier";
  src: url("/static/fonts/Manier-Heavy.otf") format("opentype");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src: url("/static/fonts/Gotham-Book.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src: url("/static/fonts/Gotham-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Gotham";
  src: url("/static/fonts/Gotham-Ultra.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #160835;
  --card: #22133B;
  --purple-1: #3E156D;
  --purple-2: #5C4A78;
  --purple-3: #75B590;
  --blue: #2B52DE;
  --gold: #D3AE6E;
  --text: #FFFFFF;
  --text-muted: #B9AECD;
  --radius: 14px;
  --font-heading: "Manier", Georgia, "Times New Roman", serif;
  --font-body: "Gotham", "Montserrat", system-ui, -apple-system, sans-serif;
  --maxw: 1100px;
}

/* Light theme — overrides the dark brand tokens on the landing page. */
body.theme-light {
  --bg: #FBF9FF;
  --card: #FFFFFF;
  --purple-2: #C9BFE0;
  --text: #1B0E3F;
  --text-muted: #5C4A78;
}
body.theme-light .signup-card,
body.theme-light .topic-card,
body.theme-light .faq-item { box-shadow: 0 6px 24px rgba(22,8,53,0.08); }
body.theme-light .signup-card input,
body.theme-light input[type=email] { background: #F2EEF8; color: #1B0E3F; border-color: #C9BFE0; }
body.theme-light .signup-card input::placeholder { color: #8B7BB0; }
body.theme-light .cd-unit { background: #F2EEF8; border-color: #C9BFE0; }
body.theme-light .topic-card { background: #FFFFFF; border-color: rgba(22,8,53,0.08); }
/* Virtual/info tags need dark text on the light background. */
body.theme-light .tag-virtual {
  color: var(--blue); background: rgba(43,82,222,0.10); border-color: rgba(43,82,222,0.45);
}
body.theme-light .tag { background: var(--purple-1); color: #fff; }
/* The brand logo is white (built for dark bg); darken it on the light theme. */
body.theme-light .site-nav .brand img { filter: invert(1) brightness(0.85); }
body.theme-light .site-nav .brand span { color: var(--text); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }
/* Keep the root background matching the light theme so no dark strip shows
   below the content on wide/short pages. */
html:has(.theme-light) { background: #FBF9FF; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
h3 { font-size: 1.3rem; }

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  line-height: 1.2;
  vertical-align: middle;
  padding: 14px 30px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--gold);
  color: var(--bg);
  text-decoration: none;
}
.btn-blue { border-color: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue); color: #fff; }
.btn-solid { background: var(--gold); color: var(--bg); }
.btn-solid:hover { background: #e4c184; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0,0,0,0.35); }
.card .icon-ring {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); margin-bottom: 16px;
}

/* ---- Navigation ---- */
.site-nav {
  display: flex; align-items: center; justify-content: center;
  padding: 18px 0;
}
.site-nav .brand img { height: 38px; display: block; }
.site-nav .brand span { font-family: var(--font-heading); font-size: 1.4rem; }
.nav-links { display: flex; gap: 26px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--text); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.85rem; font-weight: 500;
}
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 28px; height: 28px; }

/* ---- Hero / landing ---- */
.hero { padding: 22px 0 60px; }
.hero .lead { font-size: 1.25rem; color: var(--text-muted); max-width: 640px; }
.body-copy { white-space: pre-line; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-img { width: 100%; border-radius: var(--radius); display: block; }
.hero-img-mobile { display: none; }

/* Tags / badges on the landing page */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.tag {
  display: inline-block; padding: 6px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em;
  text-transform: uppercase; background: var(--purple-1); color: #fff;
}
.tag-virtual { background: rgba(43,82,222,0.18); color: #cdd7ff; border: 1px solid var(--blue); }

.signup-card { background: var(--card); border-radius: var(--radius); padding: 30px; }

/* Countdown timer */
.countdown { display: flex; gap: 10px; margin: 18px 0 4px; }
.cd-unit {
  flex: 1; background: #1b0e3f; border: 1px solid var(--purple-2);
  border-radius: 10px; padding: 10px 4px; text-align: center;
}
.cd-num { display: block; font-family: var(--font-heading); font-size: 1.7rem; color: var(--gold); line-height: 1; }
.cd-lbl { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-top: 4px; }
.cd-live { color: var(--purple-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 0; }
.signup-card input[type=email], .signup-card input[type=text] {
  width: 100%; padding: 14px; margin-bottom: 14px; border-radius: 10px;
  border: 1px solid var(--purple-2); background: #1b0e3f; color: #fff; font-family: var(--font-body);
}
.signup-card input::placeholder { color: #9c8fc0; }

.partner { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--text-muted); }
.partner img { height: 40px; background: rgba(255,255,255,0.05); padding: 6px; border-radius: 8px; }

.mentors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.mentor img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }

/* Day sections (image + title topic cards) */
.day-section { margin-top: 64px; text-align: center; }
.day-title { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 18px; }
.day-desc { color: var(--text-muted); max-width: 720px; margin: 0 auto 36px; font-size: 1.1rem; }
.day-topics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px; text-align: left;
}
.topic-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); overflow: hidden;
}
.topic-card img { width: 100%; height: 210px; object-fit: cover; display: block; }
.topic-title {
  font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem;
  padding: 18px 20px 24px;
}

/* FAQs */
.faq-section { margin-top: 64px; }
.faq-section .day-title { text-align: center; }
.faq-list { max-width: 760px; margin: 30px auto 0; }
.faq-item {
  background: var(--card); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 12px;
}
.faq-item summary {
  cursor: pointer; font-weight: 500; font-size: 1.05rem; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::after { content: "+"; color: var(--gold); font-size: 1.4rem; margin-left: 16px; }
.faq-item[open] summary::after { content: "–"; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-answer { color: var(--text-muted); margin-top: 12px; white-space: pre-line; }

/* Bottom call-to-action (shown when day sections exist) */
.bottom-cta { margin-top: 64px; text-align: center; padding: 40px 20px; }
.bottom-cta h2 { margin-bottom: 14px; }
.bottom-cta .btn { margin-top: 8px; }
/* Offset anchor scroll so the signup card isn't hidden under the fixed header height */
#register { scroll-margin-top: 24px; }

.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 24px; }
.event-meta { color: var(--text-muted); font-size: 0.9rem; }
.event-card { padding: 0; overflow: hidden; }
.event-card > :not(.event-card-img) { margin-left: 22px; margin-right: 22px; }
.event-card > .eyebrow { margin-top: 18px; }
.event-card > :last-child { margin-bottom: 22px; }
.event-card-img { width: 100%; height: 170px; object-fit: cover; display: block; }
.event-card:not(:has(.event-card-img)) { padding: 28px; }
.event-card:not(:has(.event-card-img)) > * { margin-left: 0; margin-right: 0; }

/* ---- Add to calendar dropdown ---- */
.cal-dropdown { position: relative; display: inline-block; }
.cal-menu {
  display: none; position: absolute; top: 110%; left: 0; min-width: 220px; z-index: 20;
  background: var(--card); border: 1px solid var(--purple-2); border-radius: 10px; overflow: hidden;
}
.cal-menu.open { display: block; }
.cal-menu a { display: block; padding: 12px 16px; color: var(--text); }
.cal-menu a:hover { background: var(--purple-1); text-decoration: none; }

/* ---- Flash messages ---- */
.flashes { list-style: none; padding: 0; margin: 16px 0; }
.flashes li { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; }
.flashes .success { background: rgba(117,181,144,0.18); border: 1px solid var(--purple-3); }
.flashes .error { background: rgba(255,90,60,0.16); border: 1px solid #ff5a3c; }
.flashes .warning { background: rgba(211,174,110,0.16); border: 1px solid var(--gold); }

footer.site-footer { padding: 40px 0; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.07); margin-top: 60px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--gold); }

/* ============================================================
   Admin
   ============================================================ */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 230px; background: #120628; padding: 24px 0; flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.admin-side .brand { padding: 0 22px 20px; }
.admin-side .brand img { height: 32px; }
.admin-side nav a {
  display: block; padding: 12px 22px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; font-weight: 500;
}
.admin-side nav a:hover, .admin-side nav a.active { color: var(--gold); background: rgba(255,255,255,0.04); text-decoration: none; }
.admin-main { flex: 1; padding: 32px 40px; max-width: 100%; overflow-x: auto; }

.sig-banner { padding: 12px 16px; border-radius: 10px; margin: 0 0 22px; font-size: 0.95rem; }
.sig-banner.win { background: rgba(117,181,144,0.18); border: 1px solid var(--purple-3); color: #cdebd9; }
.sig-banner.pending { background: rgba(211,174,110,0.14); border: 1px solid var(--gold); color: var(--gold); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 20px; margin-bottom: 30px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 24px; }
.stat .num { font-family: var(--font-heading); font-size: 2.6rem; color: var(--gold); }
.stat .label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--text-muted); }

table.data { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 12px 16px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.92rem; }
table.data th { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.75rem; color: var(--text-muted); }
table.data tr:last-child td { border-bottom: none; }

.form-grid { display: grid; gap: 18px; max-width: 760px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; background: #1b0e3f;
  border: 1px solid var(--purple-2); color: #fff; font-family: var(--font-body); font-size: 0.95rem;
}
textarea { min-height: 120px; resize: vertical; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.badge.published { background: rgba(117,181,144,0.22); color: #cdebd9; }
.badge.draft { background: rgba(211,174,110,0.18); color: var(--gold); }
.section-title { margin: 36px 0 16px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.muted { color: var(--text-muted); }
.inline { display: inline; }
.row-actions { display: flex; gap: 8px; }

/* ---- Responsive / mobile menu ---- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  /* On mobile, show the event image at the very top and hide the column one. */
  .hero-img-mobile {
    display: block; width: 100%; border-radius: var(--radius);
    margin-bottom: 18px; max-height: 240px; object-fit: cover;
  }
  .hero-grid .hero-img { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 70px; right: 16px; left: 16px;
    flex-direction: column; gap: 0; background: var(--card);
    border: 1px solid var(--purple-2); border-radius: var(--radius); padding: 10px; z-index: 50;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 10px; width: 100%; }
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; display: flex; flex-wrap: wrap; padding: 10px; }
  .admin-side .brand { width: 100%; }
  .admin-side nav { display: flex; flex-wrap: wrap; }
  .admin-main { padding: 20px; }
  .form-row.two { grid-template-columns: 1fr; }
}
