:root {
  --orange: #F58220;
  --orange-light: #FFB373;
  /* Slightly lighter orange for accents */
  --orange-glow: rgba(245, 130, 32, 0.4);
  --navy: #051A53;
  --navy-light: #0A2E8D;
  /* Lighter navy for gradients */
  --bg-color: #F0F4F8;
  /* Soft blueish white */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --text-dark: #0F172A;
  --text-gray: #64748B;
  --transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* --- Ambient Floating Blobs Background --- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  animation: float 25s infinite alternate ease-in-out;
}

.blob.orange {
  background: var(--orange);
  width: 600px;
  height: 600px;
  top: -200px;
  right: -150px;
}

.blob.navy {
  background: #4299E1;
  width: 500px;
  height: 500px;
  bottom: -100px;
  left: -200px;
  animation-delay: 5s;
}

.blob.orange-light {
  background: #FCD34D;
  width: 400px;
  height: 350px;
  top: 40%;
  left: 40%;
  animation-delay: 2s;
  opacity: 0.2;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(-150px, 80px) scale(1.15);
  }
}

/* --- Elegant Top Bar --- */
.app-header {
  background: white;
  padding: 1rem 5%;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 15px rgba(5, 26, 83, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.brand-titles h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.brand-titles p {
  font-size: 0.8rem;
  color: var(--text-gray);
  font-weight: 600;
  margin-top: 4px;
}

.brand-titles p strong {
  color: var(--navy);
}

.header-widgets {
  display: flex;
  align-items: center;
  gap: 20px;
}

.widget-time {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-color);
  padding: 8px 15px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.widget-time ion-icon {
  font-size: 1.5rem;
  color: var(--orange);
}

.time-text {
  display: flex;
  flex-direction: column;
}

.time-text span {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.time-text small {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-gray);
  text-transform: uppercase;
  margin-top: 2px;
}

.widget-count {
  background: var(--navy);
  color: white;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(5, 26, 83, 0.2);
}

.count-badge {
  background: var(--orange);
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
}

/* --- Advanced Layout Structure --- */
.creative-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 4rem;
  max-width: 1400px;
  margin: 2rem auto 6rem;
  padding: 0 5%;
}

/* Glass Card Global Styles */
.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

/* --- Control Dashboard (Sticky Sidebar) --- */
.control-panel {
  position: sticky;
  top: 30px;
}

.panel-card {
  padding: 2rem;
}

.panel-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.filter-group {
  margin-bottom: 2rem;
}

.group-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--navy);
  margin-bottom: 1rem;
  font-weight: 700;
}

.pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  background: white;
  color: var(--text-gray);
  border: 1px solid rgba(226, 232, 240, 0.8);
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.01);
}

.pill:hover {
  border-color: var(--navy-light);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pill.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
  box-shadow: 0 8px 20px rgba(11, 29, 58, 0.25);
  transform: translateY(-2px);
}

.reset-btn {
  width: 100%;
  padding: 14px;
  background: rgba(250, 140, 22, 0.1);
  border: 2px dashed var(--orange);
  color: #D97706;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
}

.reset-btn:hover {
  background: var(--orange);
  color: white;
  border-style: solid;
}

/* --- Stunning Timeline Feed --- */

.timeline-feed {
  position: relative;
  padding-left: 60px;
  padding-bottom: 2rem;
}

/* The glowing vertical line */
.timeline-feed::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--orange) 0%, var(--orange-light) 60%, rgba(245, 130, 32, 0) 100%);
  border-radius: 4px;
}

/* Timeline Cards */
.tl-item {
  position: relative;
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.8s forwards;
}

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

.tl-dot {
  position: absolute;
  left: -54px;
  top: 35px;
  width: 26px;
  height: 26px;
  background: var(--bg-color);
  border: 5px solid var(--orange);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(245, 130, 32, 0.1), 0 0 20px var(--orange-glow);
  z-index: 2;
  transition: var(--transition);
}

.tl-item:hover .tl-dot {
  background: var(--orange);
  transform: scale(1.3);
  box-shadow: 0 0 0 4px rgba(245, 130, 32, 0.2), 0 0 20px var(--orange-glow);
}

.tl-content {
  background: white;
  border-radius: 24px;
  padding: 2rem 2.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Color accent strip */
.tl-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--navy), var(--navy-light));
  transition: 0.3s;
}

.tl-content:hover {
  transform: translateX(12px) translateY(-5px);
  box-shadow: 0 25px 50px rgba(11, 29, 58, 0.1);
}

.tl-content:hover::before {
  width: 10px;
  background: linear-gradient(to bottom, var(--orange), #F59E0B);
}

/* Card Date Block */
.tl-date {
  text-align: center;
  min-width: 90px;
  flex-shrink: 0;
  border-right: 1px solid #E2E8F0;
  padding-right: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tl-date h3 {
  font-size: 3rem;
  color: var(--navy);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1px;
}

.tl-date span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.tl-date small {
  font-size: 0.75rem;
  color: var(--text-gray);
  margin-top: 4px;
  font-weight: 500;
}

/* Card Info */
.tl-info {
  flex: 1;
}

.tl-tag {
  display: inline-block;
  padding: 6px 14px;
  background: #EEF2F6;
  color: var(--navy);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.tl-info h4 {
  font-size: 1.6rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.3;
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.tl-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-gray);
  font-size: 0.9rem;
  font-weight: 500;
}

.tl-meta div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tl-meta ion-icon {
  color: var(--orange);
  font-size: 1.1rem;
}

.tl-arrow {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: #F8FAFC;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--navy);
  font-size: 1.3rem;
  transition: var(--transition);
  flex-shrink: 0;
  border: 1px solid #E2E8F0;
}

.tl-content:hover .tl-arrow {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
  transform: scale(1.1) translateX(8px);
}

/* Update info to accommodate district */
.district-highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px rgba(11, 29, 58, 0.2);
}

.district-highlight ion-icon {
  font-size: 1.1rem;
  color: var(--orange-light);
}

/* Past events */
.tl-item.past-event .tl-content {
  background: #F8FAFC;
  border-color: #E2E8F0;
  box-shadow: none;
  opacity: 0.6;
}

.tl-item.past-event .tl-content::before {
  background: #CBD5E1;
}

.tl-item.past-event .district-highlight {
  background: #94A3B8;
  box-shadow: none;
}

.tl-item.past-event .tl-date h3,
.tl-item.past-event .tl-date span {
  color: #94A3B8;
}

.tl-item.past-event .tl-dot {
  border-color: #CBD5E1;
  box-shadow: none;
}

.tl-item.past-event:hover .tl-dot {
  background: #94A3B8;
}

.tl-item.past-event .tl-tag {
  background: #E2E8F0;
  color: #64748B;
}

/* Today events */
.tl-item.today-event {
  z-index: 10;
}

.tl-item.today-event .tl-content {
  border: 2px solid var(--orange);
  box-shadow: 0 15px 40px var(--orange-glow);
  transform: scale(1.02);
}

.tl-item.today-event .tl-content::before {
  background: var(--orange);
  width: 8px;
}

.tl-item.today-event .tl-dot {
  border-color: var(--orange);
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(245, 130, 32, 0.3), 0 0 20px var(--orange-glow);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 130, 32, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(245, 130, 32, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(245, 130, 32, 0);
  }
}

.today-badge {
  position: absolute;
  top: -12px;
  right: 25px;
  background: var(--orange);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px var(--orange-glow);
}

/* --- Spectacular Event Modal --- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 29, 58, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: white;
  width: 92%;
  max-width: 550px;
  border-radius: 32px;
  overflow: hidden;
  transform: translateY(60px) scale(0.95);
  transition: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  position: relative;
}

.overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

/* Custom Close Btn */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  color: white;
  transition: var(--transition);
}

.close-btn:hover {
  background: white;
  color: #ef4444;
  transform: rotate(90deg) scale(1.1);
}

/* Modal Top Art Area */
.modal-art {
  height: 240px;
  background: linear-gradient(135deg, var(--navy), #1e3a8a);
  position: relative;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: white;
  overflow: hidden;
}

/* Abstract geometry in background */
.modal-art::after {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, var(--orange-glow) 0%, transparent 70%);
  border-radius: 50%;
}

.modal-date-badge {
  position: absolute;
  top: 25px;
  left: 25px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  padding: 12px 22px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.modal-date-badge #mDay {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.modal-date-badge #mMonth {
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 2px;
}

.modal-art h2 {
  font-size: 2.2rem;
  font-weight: 800;
  position: relative;
  z-index: 2;
  line-height: 1.2;
  font-family: 'Playfair Display', serif;
  letter-spacing: -1px;
}

.m-category {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--orange-light);
  letter-spacing: 1px;
}

.modal-details {
  padding: 2.5rem;
  display: grid;
  gap: 1.8rem;
  background: #fff;
}

.detail-tile {
  display: flex;
  align-items: center;
  gap: 18px;
}

.detail-tile ion-icon {
  font-size: 2.2rem;
  color: var(--orange);
  background: #FFF7ED;
  padding: 14px;
  border-radius: 18px;
}

.detail-tile small {
  font-size: 0.8rem;
  color: var(--text-gray);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.detail-tile p {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: 4px;
  line-height: 1.4;
}

/* Past Events Collapse Area */
.past-events-wrapper {
  margin-top: 2rem;
  padding-left: 60px;
}

.past-events-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 12px 24px;
  border-radius: 30px;
  border: 1px solid #E2E8F0;
  color: var(--text-gray);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  margin-bottom: 2rem;
  font-size: 0.95rem;
  user-select: none;
}

.past-events-toggle:hover {
  background: var(--bg-color);
  color: var(--navy);
  border-color: #CBD5E1;
}

.past-events-toggle .toggle-icon {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.past-events-wrapper.open .toggle-icon {
  transform: rotate(180deg);
}

.past-events-container {
  display: none;
  position: relative;
  /* Glowing line for past events */
}

.past-events-container::before {
  content: '';
  position: absolute;
  left: -42px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, #CBD5E1, rgba(203, 213, 225, 0));
  border-radius: 4px;
}

.past-events-wrapper.open .past-events-container {
  display: block;
  animation: fadeUp 0.5s ease;
}

/* Footer Styling */
.site-footer {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 0.9rem;
  color: var(--text-gray);
  line-height: 1.6;
}

.site-footer .developer-link {
  margin-top: 8px;
  font-weight: 500;
}

.site-footer a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: var(--orange);
}

/* --- Robust Responsiveness --- */
@media (max-width: 1024px) {
  .creative-layout {
    grid-template-columns: 260px 1fr;
    gap: 2rem;
  }
}

@media (max-width: 850px) {
  .creative-layout {
    display: flex;
    flex-direction: column-reverse;
    margin-top: 1.5rem;
    gap: 3rem;
  }

  .control-panel {
    position: static;
    margin-bottom: 2rem;
    width: 100%;
  }

  .app-header {
    flex-direction: column;
    gap: 15px;
    padding: 1.5rem 5%;
  }

  .header-brand {
    flex-direction: column;
    text-align: center;
  }

  .header-widgets {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .header-widgets {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .widget-time,
  .widget-count {
    width: 100%;
    justify-content: center;
  }

  .brand-logo {
    height: 45px;
  }

  .brand-titles h1 {
    font-size: 1.2rem;
  }

  .timeline-feed::before {
    left: 14px;
  }

  .tl-dot {
    left: -11px;
    width: 22px;
    height: 22px;
    border-width: 4px;
    top: 38px;
  }

  .timeline-feed {
    padding-left: 35px;
  }

  .past-events-wrapper {
    padding-left: 35px;
  }

  .past-events-container::before {
    left: -21px;
  }

  .tl-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.8rem;
    border-radius: 20px;
  }

  /* Make date block horizontal on mobile */
  .tl-date {
    border-right: none;
    border-bottom: 1px solid #E2E8F0;
    padding-right: 0;
    padding-bottom: 1rem;
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
  }

  .tl-date h3 {
    font-size: 2.2rem;
  }

  .tl-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tl-arrow {
    display: none;
  }

  .modal-art {
    height: auto;
    padding-top: 7rem;
  }

  .modal-date-badge {
    top: auto;
    bottom: 25px;
    right: 25px;
    left: auto;
  }

  .close-btn {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }
}