/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --azure-blue: #0078d4;
  --azure-dark: #005a9e;
  --azure-light: #deecf9;
  --text: #1a1a1a;
  --text-light: #555;
  --bg: #f9fafb;
  --white: #ffffff;
  --border: #e1e4e8;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* === Dark theme variables === */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --azure-blue: #4dabf5;
    --azure-dark: #6dc0ff;
    --azure-light: #1a2d42;
    --text: #e4e4e4;
    --text-light: #aaa;
    --bg: #121212;
    --white: #1e1e1e;
    --border: #333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  }
}

[data-theme="dark"] {
  --azure-blue: #4dabf5;
  --azure-dark: #6dc0ff;
  --azure-light: #1a2d42;
  --text: #e4e4e4;
  --text-light: #aaa;
  --bg: #121212;
  --white: #1e1e1e;
  --border: #333;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* === Dark theme overrides for components === */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-upcoming { background: #1a3a1a; color: #4ade80; }
  :root:not([data-theme="light"]) .badge-past { background: #2a2a2a; color: #999; }
  :root:not([data-theme="light"]) .site-footer { background: #1e1e1e; color: #ddd; }
  :root:not([data-theme="light"]) .site-footer a { color: #4dabf5; }
  :root:not([data-theme="light"]) .btn-outline-blue { color: #4dabf5; border-color: #4dabf5; }
  :root:not([data-theme="light"]) .btn-outline-blue:hover { background: rgba(77, 171, 245, 0.1); }
  :root:not([data-theme="light"]) .section-title { color: #ffffff; }
  :root:not([data-theme="light"]) .about-sidebar h3 { color: #ffffff; }
  :root:not([data-theme="light"]) iframe[data-tally-src] { filter: invert(0.88) hue-rotate(180deg); }
  :root:not([data-theme="light"]) .hero { background: linear-gradient(135deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.65)), url("../images/luboshouska-uppsala-434006_1920.jpg") center center / cover no-repeat scroll; }
  :root:not([data-theme="light"]) .hero h1,
  :root:not([data-theme="light"]) .hero p { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
  :root:not([data-theme="light"]) .hero { color: #ffffff; }
  :root:not([data-theme="light"]) .hero .btn-outline { color: #ffffff; border-color: #ffffff; }
  :root:not([data-theme="light"]) .filter-tab { background: #2a2a2a; border-color: #444; color: #e4e4e4; }
  :root:not([data-theme="light"]) .filter-tab:hover { border-color: #4dabf5; color: #4dabf5; }
  :root:not([data-theme="light"]) .filter-tab.active { background: #4dabf5; color: #ffffff; border-color: #4dabf5; }
  :root:not([data-theme="light"]) .signup-section { background: #252525; border: 1px solid #333; }
  :root:not([data-theme="light"]) .signup-section h3 { color: #ffffff; }
  :root:not([data-theme="light"]) .newsletter-cta { background: linear-gradient(135deg, #1a6bc4, #004080); }
  :root:not([data-theme="light"]) .newsletter-cta .section-title { color: #ffffff; }
  :root:not([data-theme="light"]) .faq-question { color: #e4e4e4; }
  :root:not([data-theme="light"]) .faq-item { border-color: #333; }
  :root:not([data-theme="light"]) .btn-primary { background: #1a6bc4; color: #ffffff; }
  :root:not([data-theme="light"]) .btn-primary:hover { background: #1558a8; }
  :root:not([data-theme="light"]) .reg-counter { background: #1a1a1a; border-color: #333; }
  :root:not([data-theme="light"]) .event-card-header { background: #1a2d42; }
  :root:not([data-theme="light"]) .event-card-header h3 { color: #ffffff; }
}

[data-theme="dark"] .badge-upcoming { background: #1a3a1a; color: #4ade80; }
[data-theme="dark"] .badge-past { background: #2a2a2a; color: #999; }
[data-theme="dark"] .site-footer { background: #1e1e1e; color: #ddd; }
[data-theme="dark"] .site-footer a { color: #4dabf5; }
[data-theme="dark"] .btn-outline-blue { color: #4dabf5; border-color: #4dabf5; }
[data-theme="dark"] .btn-outline-blue:hover { background: rgba(77, 171, 245, 0.1); }
[data-theme="dark"] .section-title { color: #ffffff; }
[data-theme="dark"] .about-sidebar h3 { color: #ffffff; }
[data-theme="dark"] iframe[data-tally-src] { filter: invert(0.88) hue-rotate(180deg); }
[data-theme="dark"] .hero { background: linear-gradient(135deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.65)), url("../images/luboshouska-uppsala-434006_1920.jpg") center center / cover no-repeat scroll; }
[data-theme="dark"] .hero h1,
[data-theme="dark"] .hero p { text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
[data-theme="dark"] .hero { color: #ffffff; }
[data-theme="dark"] .hero .btn-outline { color: #ffffff; border-color: #ffffff; }
[data-theme="dark"] .filter-tab { background: #2a2a2a; border-color: #444; color: #e4e4e4; }
[data-theme="dark"] .filter-tab:hover { border-color: #4dabf5; color: #4dabf5; }
[data-theme="dark"] .filter-tab.active { background: #4dabf5; color: #ffffff; border-color: #4dabf5; }
[data-theme="dark"] .signup-section { background: #252525; border: 1px solid #333; }
[data-theme="dark"] .signup-section h3 { color: #ffffff; }
[data-theme="dark"] .newsletter-cta { background: linear-gradient(135deg, #1a6bc4, #004080); }
[data-theme="dark"] .newsletter-cta .section-title { color: #ffffff; }
[data-theme="dark"] .faq-question { color: #e4e4e4; }
[data-theme="dark"] .faq-item { border-color: #333; }
[data-theme="dark"] .btn-primary { background: #1a6bc4; color: #ffffff; }
[data-theme="dark"] .btn-primary:hover { background: #1558a8; }
[data-theme="dark"] .reg-counter { background: #1a1a1a; border-color: #333; }
[data-theme="dark"] .event-card-header { background: #1a2d42; }
[data-theme="dark"] .event-card-header h3 { color: #ffffff; }

/* === Theme toggle button === */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.3rem 0.5rem;
  line-height: 1;
  transition: border-color 0.2s;
  color: var(--text);
}

.theme-toggle:hover {
  border-color: var(--azure-blue);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

a {
  color: var(--azure-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

/* === Layout === */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* === Header / Nav === */
.site-header {
  background: var(--white);
  border-bottom: 3px solid var(--azure-blue);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--azure-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links li {
  white-space: nowrap;
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--azure-blue);
  border-bottom-color: var(--azure-blue);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: 0.3s;
}

/* === Hero === */
.hero {
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.55)),
    url("../images/luboshouska-uppsala-434006_1920.jpg") center center / cover no-repeat scroll;
  color: #ffffff;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero .btn {
  font-size: 1.1rem;
  padding: 0.75rem 2rem;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.1s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--azure-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--azure-dark);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
}

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

.btn-outline-blue:hover {
  background: var(--azure-light);
}

/* === Sections === */
.section {
  padding: 3.5rem 0;
}

.section-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--azure-dark);
  text-align: center;
}

.section-subtitle {
  color: var(--text-light);
  margin-bottom: 2rem;
  text-align: center;
}

/* === Event Cards === */
.event-grid {
  display: grid;
  gap: 1.5rem;
}

.event-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.event-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.event-card-header {
  background: var(--azure-light);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--azure-blue);
}

.event-card-header h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

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

.event-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.event-card-body {
  padding: 1.25rem 1.5rem;
}

.event-card-body p {
  margin-bottom: 1rem;
}

/* === Countdown timer === */
.countdown {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.25rem 0 0.5rem;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--azure-blue);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  min-width: 70px;
}

.countdown-number {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  opacity: 0.85;
}

.countdown.event-live .countdown-item {
  background: #2e7d32;
}

.countdown.event-passed .countdown-item {
  background: var(--text-light);
}

@media (max-width: 480px) {
  .countdown { gap: 0.5rem; }
  .countdown-item { min-width: 55px; padding: 0.5rem 0.6rem; }
  .countdown-number { font-size: 1.2rem; }
}

/* === Registration counter === */
.reg-counter {
  margin: 1.25rem 0;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.reg-counter-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.reg-counter-label strong {
  font-size: 1.1rem;
}

.reg-counter-bar {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.reg-counter-fill {
  height: 100%;
  background: var(--azure-blue);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.reg-counter-fill.almost-full {
  background: #e8912d;
}

.reg-counter-fill.full {
  background: #d32f2f;
}

/* === FAQ === */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.25rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-question::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--azure-blue);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-question.open::after {
  content: "−";
}

.faq-question:hover {
  color: var(--azure-blue);
}

.faq-answer {
  display: none;
  padding: 0 0 1.25rem;
  color: var(--text-light);
  line-height: 1.7;
}

.faq-answer.open {
  display: block;
}

/* === Slides & Recordings === */
.resources {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.resources a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* === Agenda === */
.agenda {
  list-style: none;
  margin: 1rem 0;
}

.agenda li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.agenda li:last-child {
  border-bottom: none;
}

.agenda-time {
  font-weight: 600;
  color: var(--azure-blue);
  min-width: 90px;
  flex-shrink: 0;
}

/* === Upcoming badge === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-upcoming {
  background: #dff6dd;
  color: #1a7f37;
}

.badge-past {
  background: #eee;
  color: #666;
}

/* === Sign-up Form === */
.signup-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--azure-blue);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.15);
}

/* === About section === */
.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.about-sidebar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.about-sidebar h3 {
  margin-bottom: 0.75rem;
  color: var(--azure-dark);
}

.about-sidebar ul {
  list-style: none;
}

.about-sidebar li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.about-sidebar li:last-child {
  border-bottom: none;
}

/* === Footer === */
.site-footer {
  background: var(--text);
  color: #ccc;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 2rem;
}

.site-footer a {
  color: var(--azure-light);
}

/* === Filter tabs === */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--azure-blue);
  color: var(--azure-blue);
}

.filter-tab.active {
  background: var(--azure-blue);
  color: var(--white);
  border-color: var(--azure-blue);
}

/* === Collapsible agenda === */
.agenda-toggle {
  background: none;
  border: none;
  color: var(--azure-blue);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.agenda-toggle:hover {
  text-decoration: underline;
}

.agenda-toggle .arrow {
  transition: transform 0.2s;
  display: inline-block;
}

.agenda-toggle.open .arrow {
  transform: rotate(90deg);
}

.agenda-content {
  display: none;
}

.agenda-content.open {
  display: block;
}

/* === Newsletter CTA === */
.newsletter-cta {
  background: linear-gradient(135deg, var(--azure-blue), #005a9e);
  color: #ffffff;
}

/* === Responsive === */
@media (max-width: 900px) {
  .logo {
    font-size: 0.95rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav-links.open {
    display: flex;
  }
}
