:root {
  --primary: #4a6fa5;
  --secondary: #166088;
  --accent: #ffc107;
  --light: #f9fafb;
  --dark: #1e293b;
}

/* GENERAL PAGE STYLE */
body {
  background: var(--light);
  color: var(--dark);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* --- Modern Branded Header --- */
.site-header {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Brand / Logo section */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand img {
  height: 55px;
  width: auto;
  display: block;
}

.brand-text h1 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.brand-text span {
  display: block;
  font-size: 0.85rem;
  color: #ffffffcc;
  letter-spacing: 0.3px;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.main-nav a {
  color: #ffffffcc;
  font-weight: 600;
  text-decoration: none;
  transition:
    color 0.25s ease,
    transform 0.25s ease;
}

.main-nav a:hover {
  color: #fff;
  transform: translateY(-1px);
}

.calendar-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #2d5d9f;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.day-name {
  font-weight: bold;
  background: #e9f2ff;
  padding: 0.75rem;
  border-radius: 8px;
}

.day-cell {
  min-height: 120px;
  border-radius: 8px;
  background: #f8f9fa;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: background 0.2s;
}

.day-cell:hover {
  background: #eef6ff;
}

.day-number {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.event-label {
  font-size: 1rem;
  font-weight: 600;
  color: #166088;
}

.today {
  border: 3px solid #4fc3f7;
  background: #fff6e5;
}

.agenda {
  margin-top: 2rem;
}

.agenda-item {
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.agenda-date {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2d5d9f;
  min-width: 150px;
}

.agenda-details {
  font-size: 1.2rem;
  flex: 1;
  text-align: left;
}

.highlight {
  background: #fff3cd !important;
  border-left: 6px solid #ffc107;
}

/* ---------------------------------------------------
        MOBILE – ENTIRE CALENDAR UI IMPROVEMENT LAYER
        Does NOT affect Desktop (> 768px)
        --------------------------------------------------- */
@media (max-width: 768px) {
  body {
    font-size: 18px;
  }

  /* Calendar container full width on phone */
  .calendar-container {
    padding: 1rem !important;
    margin: 0;
    border-radius: 0 !important;
  }

  /* Title */
  .calendar-title {
    font-size: 1.8rem !important;
    text-align: center;
    width: 100%;
  }

  /* Prev / Today / Next buttons stacking neatly */
  .calendar-header {
    flex-direction: column !important;
    gap: 1rem;
    text-align: center;
  }

  .calendar-header button {
    width: 100% !important;
    font-size: 1.1rem;
    padding: 0.9rem 1rem;
  }

  /* Search bar full width */
  #searchBox {
    width: 100% !important;
  }

  /* 7-column grid becomes 2-column mobile-friendly */
  .calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-top: 1rem;
  }

  .day-name {
    display: none !important;
    /* hide weekday row on phones */
  }

  .day-cell {
    min-height: 120px;
    padding: 0.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

  .day-number {
    font-size: 1.6rem !important;
    font-weight: 700;
    margin-bottom: 0.4rem;
  }

  .event-label {
    font-size: 0.95rem !important;
    line-height: 1.2;
    background: #e9f5ff;
    padding: 3px 6px;
    border-radius: 5px;
    margin-top: 3px;
  }

  /* Event modal scaling */
  #eventModal .modal-dialog {
    margin: 0.5rem;
  }

  #mPosterImg {
    max-height: 200px !important;
  }

  /* Agenda list mobile optimisation */
  .agenda-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: left;
    gap: 0.3rem;
    padding: 1rem;
  }

  .agenda-date {
    font-size: 1.2rem;
    font-weight: bold;
  }

  .agenda-details {
    font-size: 1rem;
  }

  /* Next event banner becomes compact */
  #nextEventBanner {
    font-size: 1.2rem !important;
    padding: 1rem !important;
  }

  #nextEventBtn {
    margin-top: 0.8rem;
    width: 100%;
  }
}

/* -----------------------------------------------
    VERTICAL SCROLL CONTAINER (REPLACE horizontal slider)
    ------------------------------------------------ */
.agenda-slider-wrapper {
  height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Remove or comment out these horizontal slider styles: */
/*
.agenda-slider {
  display: inline-flex;
  gap: 1rem;
}
*/

/* Update agenda items to stack vertically */
.agenda-item {
  display: block !important; /* Changed from inline-block */
  width: 100% !important; /* Changed from 280px */
  min-height: 100px; /* Slightly smaller */
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
  margin-bottom: 10px; /* Add spacing between items */
}

.agenda-item:hover {
  transform: translateY(-3px);
}

/* Mobile look */
@media (max-width: 768px) {
  .agenda-item {
    width: 100% !important; /* Changed from 75% */
    margin-right: 0; /* Remove right margin */
    margin-bottom: 10px;
  }

  .lead {
    font-size: 1.2rem !important;
  }
}
