/* Custom Properties (Variables) */
:root {
  /* Core Colors */
  --primary: #81001c;
  --primary-container: #a6192e;
  --on-primary: #ffffff;

  --secondary: #515f7a;
  --secondary-container: #cfddfe;

  --tertiary: #735c00;
  --tertiary-container: #cba72f;

  --surface: #fcf9f6;
  --surface-low: #f6f3f0;
  --surface-lowest: #ffffff;
  --surface-container: #f0edea;
  --surface-highest: #e5e2df;

  --on-surface: #1c1c1a;
  --on-surface-variant: #594040;
  --on-background: #1c1c1a;
  --outline: #8d7070;
  --outline-variant: #e1bebe;

  /* Typography */
  --font-headline: "Noto Serif", serif;
  --font-body: "Inter", sans-serif;

  /* Layout */
  --nav-height: 5rem;
}

/* Base Reset & Setup */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background-color: var(--primary-container);
  color: var(--on-primary);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* Accessibility utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
.font-headline {
  font-family: var(--font-headline);
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  vertical-align: middle;
}

.icon-fill {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

/* Shadows */
.editorial-shadow {
  box-shadow: 0 8px 40px -12px rgba(129, 0, 28, 0.08);
}

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

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 3rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  transition: all 0.3s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn-full {
  width: 100%;
}

.flex-btn {
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background-color: var(--primary-container);
}

.btn-outline {
  background-color: var(--surface-lowest);
  color: var(--primary);
  border: 1px solid rgba(129, 0, 28, 0.2);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--on-primary);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: rgba(252, 249, 246, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(225, 190, 190, 0.2);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  color: var(--primary);
}

.logo {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links a {
  color: var(--secondary);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.25rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.icon-group {
  display: none;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .icon-group {
    display: flex;
  }
}

.icon-btn {
  color: var(--secondary);
  cursor: pointer;
  transition: color 0.3s;
}

.icon-btn:hover {
  color: var(--primary);
}

.mobile-menu-btn {
  display: block;
  color: var(--on-surface);
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Nav Menu Dropdown */
@media (max-width: 767px) {
  .nav-links.nav-open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: var(--surface-lowest);
    padding: 1rem 1.5rem 2rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    z-index: 999;
    gap: 0.5rem;
    align-items: flex-start;
    border-bottom: 1px solid var(--outline-variant);
  }

  .nav-links.nav-open a {
    width: 100%;
    padding: 1rem;
    border-bottom: 1px solid var(--surface-low);
    color: var(--secondary);
    text-align: center;
  }

  .nav-links.nav-open a:last-child {
    border-bottom: none;
  }
}

/* Page Layout */
.page-layout {
  display: flex;
  flex-direction: column;
  /* Stack on mobile */
  padding-top: var(--nav-height);
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .page-layout {
    flex-direction: row;
  }

  /* Side-by-side on desktop */
}

/* Sidebar Navigation - Responsive Overhaul */
.sidebar {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-height);
  height: auto;
  padding: 1rem 0;
  background-color: var(--surface);
  backdrop-filter: blur(10px);
  z-index: 40;
  border-bottom: 1px solid rgba(225, 190, 190, 0.3);
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    flex-direction: column;
    width: 16rem;
    height: calc(100vh - var(--nav-height));
    padding: 2rem 0;
    border-bottom: none;
    background-color: transparent;
  }
}

.sidebar-header {
  display: none;
}

/* Hide on mobile to save space */
@media (min-width: 1024px) {
  .sidebar-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0 2rem;
    margin-bottom: 2rem;
  }
}

.sidebar-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: rgba(129, 0, 28, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-icon .material-symbols-outlined {
  color: var(--primary);
}

.sidebar-title h3 {
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.status-badge {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--outline);
}

.sidebar-nav {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0;
    flex: 1;
  }
}

.mobile-form-selector {
  display: block;
  width: 100%;
  padding: 0 1.5rem;
}

@media (min-width: 1024px) {
  .mobile-form-selector {
    display: none;
  }
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.mobile-form-selector select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--on-surface);
  background-color: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: 9999px;
  cursor: pointer;
  line-height: 1.5;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.mobile-form-selector select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(129, 0, 28, 0.15);
}

.select-arrow {
  position: absolute;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--secondary);
  font-size: 1.5rem;
}

.sidebar-link {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  margin: 0;
  border-radius: 9999px;
  color: var(--secondary);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  /* Keep tabs single line */
  flex-shrink: 0;
  /* Prevent squishing on mobile */
}

@media (min-width: 1024px) {
  .sidebar-link {
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    margin: 0 1rem;
  }
}

.sidebar-link:hover {
  background-color: rgba(0, 0, 0, 0.03);
  color: var(--primary);
}

@media (min-width: 1024px) {
  .sidebar-link:hover {
    transform: translateX(4px);
  }
}

.sidebar-link.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(129, 0, 28, 0.2);
}

.sidebar-link.active:hover {
  transform: none;
  color: white;
}

.sidebar-footer {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar-footer {
    display: block;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(225, 190, 190, 0.3);
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

.support-card {
  background-color: var(--surface-low);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-top: 1rem;
}

.support-card p {
  font-size: 0.75rem;
  color: var(--secondary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 2rem 0;
  min-width: 0;
}

@media (min-width: 1024px) {
  .main-content {
    padding: 3rem;
  }
}

/* Alert Banner */
.alert-banner {
  position: relative;
  background-color: var(--primary);
  border-radius: 8px;
  padding: 2.5rem;
  color: white;
  overflow: hidden;
  margin-bottom: 4rem;
  box-shadow: 0 8px 40px -12px rgba(129, 0, 28, 0.15);
}

@media (min-width: 768px) {
  .alert-banner {
    padding: 3rem;
  }
}

.alert-content {
  position: relative;
  z-index: 10;
  max-width: 42rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.pulse-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: #4ade80;
  border-radius: 50%;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.alert-content h1 {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .alert-content h1 {
    font-size: 3rem;
  }
}

.alert-content p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.625;
}

.alert-bg {
  display: none;
}

@media (min-width: 768px) {
  .alert-bg {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40%;
  }

  .alert-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--primary) 0%, transparent 100%);
    z-index: 1;
  }

  .alert-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    mix-blend-mode: overlay;
  }
}

/* Resources Section */
.resources-section {
  margin-bottom: 5rem;
}

.section-header-flex {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .section-header-flex {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.header-text h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.header-line {
  height: 0.25rem;
  width: 5rem;
  background-color: var(--primary);
}

.view-toggles {
  display: flex;
  gap: 1rem;
}

.toggle-btn {
  padding: 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  background-color: var(--surface-low);
  transition: all 0.3s ease;
}

.toggle-btn.active,
.toggle-btn:hover {
  background-color: var(--surface-lowest);
  color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .resource-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.resource-card {
  background-color: var(--surface-lowest);
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px -12px rgba(129, 0, 28, 0.05);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.resource-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(129, 0, 28, 0.12);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.icon-box {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.icon-box .material-symbols-outlined {
  font-size: 1.875rem;
}

.icon-primary {
  background-color: rgba(129, 0, 28, 0.05);
  color: var(--primary);
}

.resource-card:hover .icon-primary {
  background-color: var(--primary);
  color: white;
}

.icon-tertiary {
  background-color: rgba(115, 92, 0, 0.05);
  color: var(--tertiary);
}

.resource-card:hover .icon-tertiary {
  background-color: var(--tertiary);
  color: white;
}

.icon-secondary {
  background-color: rgba(81, 95, 122, 0.05);
  color: var(--secondary);
}

.resource-card:hover .icon-secondary {
  background-color: var(--secondary);
  color: white;
}

.subject-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--outline);
}

.resource-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.resource-card p {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.625;
  margin-bottom: 2rem;
}

.mt-auto {
  margin-top: auto;
}

.resource-card .download-btn {
  cursor: pointer;
}

/* Bottom Information Section */
.info-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .info-section {
    grid-template-columns: 5fr 7fr;
  }
}

/* Important Dates Card */
.dates-card {
  background-color: var(--surface-low);
  border-radius: 8px;
  padding: 2.5rem;
}

.dates-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.dates-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.date-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.date-badge {
  background-color: var(--surface-lowest);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  min-width: 5rem;
  box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.05);
}

.date-badge .day {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
}

.date-badge .month {
  display: block;
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--outline);
  margin-top: 0.25rem;
}

.badge-primary .day {
  color: var(--primary);
}

.badge-tertiary .day {
  color: var(--tertiary);
}

.date-info h4 {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-body);
  margin-bottom: 0.25rem;
}

.date-info p {
  color: var(--secondary);
  font-size: 0.875rem;
}

.dates-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(225, 190, 190, 0.3);
}

.dates-footer p {
  font-size: 0.75rem;
  color: var(--outline);
  font-style: italic;
}

/* Secondary Graphic/Info */
.excellence-card {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  height: 100%;
}

.tag-accent {
  display: block;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.excellence-content h2 {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.excellence-content p {
  color: var(--on-surface-variant);
  font-size: 1.125rem;
  line-height: 1.625;
  margin-bottom: 2rem;
  max-width: 36rem;
}

.stats-row {
  display: flex;
  gap: 1.5rem;
}

.stat-box {
  background-color: var(--surface-lowest);
  padding: 1.5rem;
  border-radius: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.text-primary {
  color: var(--primary);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--outline);
}

.excellence-image {
  position: relative;
  height: 12rem;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  filter: grayscale(100%);
  transition: filter 0.7s ease;
}

.excellence-card:hover .excellence-image {
  filter: grayscale(0%);
}

.excellence-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(129, 0, 28, 0.2);
  mix-blend-mode: multiply;
}

/* Footer */
.footer {
  background-color: var(--surface-low);
  padding: 5rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-logo {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--on-background);
  margin-bottom: 1.5rem;
}

.footer-contact {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.footer-socials {
  display: flex;
  gap: 1rem;
}

.social-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.social-icon:hover {
  transform: scale(1.1);
}

.footer-links h4 {
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 1.5rem;
  font-family: var(--font-body);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--secondary);
  font-size: 0.875rem;
  transition:
    color 0.3s,
    text-decoration-color 0.3s;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary);
}

.footer-bottom {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(225, 190, 190, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--secondary);
}
