:root {
  --white: #FFFFFF;
  --bg-soft: #F7F9FC;
  --primary: #4E5D94;
  --primary-2: #3A4A82;
  --primary-3: #2E3A6B;
  --muted: #8A96C0;
  --navy: #1A2242;
  --accent-coral: #FF6B6B;
  --accent-mint: #2DD4BF;
  --text: rgba(26, 34, 66, 0.92);
  --surface: rgba(255, 255, 255, 0.8);
  --glass: rgba(255, 255, 255, 0.5);
  --radius: 16px;
  --shadow: 0 12px 40px rgba(26, 34, 66, 0.08);
  --shadow-sm: 0 6px 24px rgba(26, 34, 66, 0.06);
  --transition: 220ms cubic-bezier(.2, .9, .3, 1);
  --theme-transition: 0.3s ease;
}

/* Smooth theme transitions */
html,
body,
.container-rev,
.brand-section,
.date-time,
#countdown,
.section,
.level-btn,
.serie-item,
h1, h2, h3, h4, h5, h6,
p, a, span {
  transition: 
    background-color var(--theme-transition),
    background-image var(--theme-transition),
    color var(--theme-transition),
    border-color var(--theme-transition),
    box-shadow var(--theme-transition);
}

html,
body {
  min-height: 100vh;
  margin: 0;
  background-image: linear-gradient(170deg, #E8ECF3 0%, #F7F9FC 100%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

.container-rev {
  max-width: 980px;
  margin: 40px auto;
  padding: 32px;
  background: var(--glass);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-section {
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(46, 58, 107, 0.08);
  padding-bottom: 24px;
}

.brand h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.brand .sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
}

.date-time {
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.6);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-sm);
}

.p-titles {
  margin: 0;
  font-weight: 600;
  color: var(--primary-2);
  font-size: 14px;
}

#countdown {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  padding: 6px 12px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid rgba(46, 58, 107, 0.05);
}

p {
  margin: 16px 0;
  font-size: clamp(15px, 1.2vw, 17px);
  color: rgba(43, 65, 151, 0.88)
}

.section {
  margin-top: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
}

/* Meet Session Link Button */
.meet-session-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

.meet-session-link:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.3);
}

.meet-session-link i {
  font-size: 1.1em;
}

body.dark-mode .meet-session-link {
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.meeting-link {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  background: linear-gradient(95deg, var(--accent-coral), var(--primary));
  color: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.2);
}

.meeting-link:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(255, 107, 107, 0.25);
}

.meeting-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16)
}

/* Responsive Design */
@media (max-width:720px) {
  .container-rev {
    margin: 20px;
    padding: 20px;
  }

  .brand-section {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .date-time {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: auto;
  }

  .brand h2 {
    font-size: 22px;
  }

  .serie-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .serie-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .meeting-link {
    font-size: 15px;
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  body {
    line-height: 1.45;
  }

  .container-rev {
    margin: 10px;
    padding: 15px;
  }

  .brand h2 {
    font-size: 20px;
  }

  .serie-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-download {
    justify-content: center;
  }
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(78, 93, 148, 0.08);
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
}

a:focus,
button:focus {
  outline: 4px solid rgba(78, 93, 148, 0.14);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Dark Mode - Exact Match to Main Site */
body.dark-mode,
[data-theme="dark"] {
  --white: #f3f4f6;
  --bg-soft: #111827;
  --primary: #818cf8;
  --primary-2: #6366f1;
  --primary-3: #4f46e5;
  --muted: #9ca3af;
  --navy: #d1d5db;
  --text: #f3f4f6;
  --surface: #1f2937;
  --glass: rgba(31, 41, 55, 0.95);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

body.dark-mode,
[data-theme="dark"] body {
  background-image: none;
  background-color: var(--bg-soft);
  min-height: 100vh;
  color: var(--text);
}

body.dark-mode .container-rev,
[data-theme="dark"] .container-rev {
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .brand-section,
[data-theme="dark"] .brand-section {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .date-time,
[data-theme="dark"] .date-time {
  background: rgba(31, 41, 55, 0.8);
  /* #1f2937 with transparency */
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #countdown,
[data-theme="dark"] #countdown {
  background: #1f2937;
  /* bg-secondary - matches main site */
  color: var(--primary);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .section,
[data-theme="dark"] .section {
  background: rgba(31, 41, 55, 0.6);
  /* #1f2937 with transparency - matches main site */
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .level-btn,
[data-theme="dark"] .level-btn {
  background: #374151;
  /* bg-tertiary - matches main site */
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .level-btn:hover,
body.dark-mode .level-btn.active,
[data-theme="dark"] .level-btn:hover,
[data-theme="dark"] .level-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

body.dark-mode .serie-item,
[data-theme="dark"] .serie-item {
  background: #1f2937;
  /* bg-secondary - matches main site */
  border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .serie-item:hover,
[data-theme="dark"] .serie-item:hover {
  background: #374151;
  /* bg-tertiary - matches main site */
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--navy);
}

/* Hide the old floating Theme Toggle when using shared header */
body.dark-mode #theme-toggle,
.site-header~#theme-toggle {
  display: none !important;
}

/* Floating Theme Toggle (legacy - kept for backwards compatibility) */
#theme-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}


body.dark-mode .coming-soon,
[data-theme="dark"] .coming-soon {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .coming-soon p,
[data-theme="dark"] .coming-soon p {
  color: var(--text);
}

.level-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  direction: rtl !important;
}

.level-btn {
  background: var(--surface);
  border: 1px solid rgba(78, 93, 148, 0.2);
  color: var(--primary);
  padding: 10px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.level-btn:hover {
  transform: translateY(-2px);
  background: var(--white);
  box-shadow: 0 8px 20px rgba(78, 93, 148, 0.15);
}

.level-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(78, 93, 148, 0.3);
}

.level-content {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.serie-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.serie-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.serie-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.serie-item .p-titles {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
}

.serie-actions {
  display: flex;
  gap: 12px;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  color: #1f2937;
  /* Black text for better contrast */
  background: linear-gradient(95deg, #bfdbfe, #93c5fd);
  /* Lighter blue gradient */
  border: 1px solid rgba(46, 58, 107, 0.2);
  transition: all var(--transition);
  box-shadow: 0 5px 15px rgba(58, 74, 130, 0.15);
}

.btn-download:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 25px rgba(58, 74, 130, 0.2);
}

.btn-download.correction {
  background: linear-gradient(95deg, #a7f3d0, #6ee7b7);
  /* Lighter mint gradient */
  color: #1f2937;
  /* Black text for better contrast */
  box-shadow: 0 5px 15px rgba(45, 212, 191, 0.2);
}

.btn-download.correction:hover {
  box-shadow: 0 10px 25px rgba(45, 212, 191, 0.25);
}

.btn-icon {
  font-size: 1.3em;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

/* .notes {                                                                                                                                    │
  list-style: none;                                                                                                                         │
  padding: 0;                                                                                                                               │
}                                                                                                                                           │
.notes li::before {                                                                                                                         │
  content: "⭐ ";                                                                                                                           │
  color: gold;                                                                                                                              │
}   */


.coming-soon {
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  border: 2px dashed var(--muted);
  margin: 20px 0;
}

.coming-soon p {
  font-size: 18px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}

/* Header & Footer Dark Mode Overrides */
body.dark-mode .main-nav,
[data-theme="dark"] .main-nav {
  background: rgba(17, 24, 39, 0.98);
  /* #111827 with slight transparency - matches main site */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .nav-links a,
[data-theme="dark"] .nav-links a {
  color: var(--text);
}

body.dark-mode .nav-links a:hover,
[data-theme="dark"] .nav-links a:hover {
  color: var(--primary);
}

body.dark-mode .nav-toggle,
[data-theme="dark"] .nav-toggle {
  color: var(--text);
}

body.dark-mode .social-footer,
[data-theme="dark"] .social-footer {
  background: var(--bg-soft);
  color: var(--text);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .social-footer h2,
[data-theme="dark"] .social-footer h2 {
  color: var(--navy);
}

body.dark-mode .social-media,
[data-theme="dark"] .social-media {
  background: transparent;
  color: var(--muted);
  border: none;
}

body.dark-mode .social-media:hover,
[data-theme="dark"] .social-media:hover {
  background: transparent;
  color: var(--primary);
  transform: translateY(-3px);
}

/* Logo Fix for Dark Mode - Keep original colors */
[data-theme="dark"] .logo-img,
body.dark-mode .logo-img {
  filter: none;
}

/* Additional Dark Mode Fixes for Revision */
body.dark-mode .btn-download {
  background: linear-gradient(95deg, #4f46e5, #6366f1);
  /* Darker purple gradient for dark mode */
  border-color: rgba(255, 255, 255, 0.1);
  color: white !important;
  /* Force white text */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-mode .btn-download.correction {
  background: linear-gradient(95deg, #059669, #10b981);
  /* Darker mint gradient for dark mode */
  color: white !important;
}

body.dark-mode .btn-download:hover {
  filter: brightness(1.1);
}

body.dark-mode .p-titles {
  color: var(--text);
}

body.dark-mode .sub {
  color: var(--muted);
}

body.dark-mode .icon {
  background: rgba(129, 140, 248, 0.15);
  color: var(--primary);
}

body.dark-mode .level-btn {
  color: var(--text);
  /* Make text visible */
}

body.dark-mode .level-btn.active {
  color: white;
  /* Active button text white */
}

/* ===== FIX: Remove bottom whitespace ===== */
#dynamic-content {
  min-height: calc(100vh - 80px); /* Account for header height */
  display: flex;
  flex-direction: column;
}

#page-content-wrapper {
  flex: 1;
}

/* ===== FIX: Keep header LTR regardless of page direction ===== */
html[dir="rtl"] .main-nav,
html[dir="rtl"] .nav-container,
html[dir="rtl"] .nav-links,
html[dir="rtl"] .nav-logo {
  direction: ltr;
}

html[dir="rtl"] .main-nav {
  text-align: left;
}