/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size for scalability */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc; /* Softer, modern background */
  color: #1e293b; /* Darker text for contrast */
  line-height: 1.6;
}

/* Container */
.container {
  display: flex;
  max-width: 1280px; /* Slightly wider for modern screens */
  margin: 2rem auto;
  gap: 2rem;
  padding: 0 1rem; /* Prevent edge-to-edge content */
}

/* Filter Panel */
.filter-panel {
  width: 280px; /* Slightly wider for better spacing */
  background: linear-gradient(145deg, #ffffff, #f1f5f9); /* Subtle gradient for elegance */
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); /* Softer, modern shadow */
  position: sticky;
  top: 2rem; /* Sticky for better UX */
}

.filter-panel h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1.5rem;
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.75rem;
}

.filter-section label {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
}

.filter-section label:hover {
  color: #3b82f6; /* Vibrant blue for hover */
  transform: translateX(4px); /* Subtle slide effect */
}

.filter-section input[type="checkbox"] {
  margin-right: 0.5rem;
  accent-color: #3b82f6; /* Custom checkbox color */
}

/* Event List */
.event-list {
  position: relative; /* For spinner positioning */
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Slightly larger cards */
  gap: 1.5rem;
}
.event-list.loading::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid #3b82f6;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.event-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden; /* Prevent content overflow */
}

.event-card:hover {
  transform: translateY(-8px); /* More pronounced lift */
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.event-image {
  width: 21.5vw; /* 30% of viewport width as base */
  height: 200px; /* Fixed height for consistency */
  border-radius: 8px; /* Rounded corners */
  margin-bottom: 1rem; /* Spacing below the image */
  transition: transform 0.4s ease; /* Smooth transition for hover effect */
  display: block; /* Ensures proper alignment */
}

/* Hover effect for the parent event-card */
.event-card:hover .event-image {
  transform: scale(1.05); /* Subtle zoom on hover */
}

.event-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.event-card .date {
  color: #10b981; /* Vibrant emerald for date */
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.event-card p {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.event-card .type {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.event-card .cta {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(90deg, #3b82f6, #2563eb); /* Gradient button */
  color: #ffffff;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.2s ease;
}

.event-card .cta:hover {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  transform: translateY(-2px); /* Subtle lift */
}

/* Footer */
.footer {
  background: #0f172a; /* Dark, elegant footer */
  color: #e2e8f0;
  padding: 2rem 1rem;
  margin-top: 3rem;
  text-align: center;
}

.footer-content p {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.footer-content a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 500;
}

.footer-content a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* Exit Intent Popup */
.exit-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.popup-content {
  background: #ffffff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  animation: slideUp 0.4s ease forwards;
}

.popup-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 1rem;
}

.popup-content p {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.popup-content .cta {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.popup-content .cta:hover {
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
}

.popup-content .close-popup {
  background: #e2e8f0;
  color: #1e293b;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  margin-left: 0.5rem;
}

.popup-content .close-popup:hover {
  background: #cbd5e1;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    gap: 1.5rem;
  }

  .filter-panel {
    width: 100%;
    position: static; /* Disable sticky on smaller screens */
  }

  .event-image {
    width: 40vw; /* Increase width on medium screens */
    height: 180px; /* Slightly reduce height for balance */
  }

  .event-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px; /* Slightly smaller base font */
  }

  .event-list {
    grid-template-columns: 1fr;
  }

  .event-image {
    width: 50vw; /* Wider on tablets */
    height: 160px; /* Further adjust height */
  }

  .event-card {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .container {
    margin: 1rem;
  }

  .filter-panel {
    padding: 1rem;
  }

  .event-image {
    width: 80vw; /* Full width on mobile */
    height: 140px; /* Adjusted height for mobile */
    margin: 0 auto 1rem; /* Center the image with margin */
  }

  .event-card .cta {
    text-align: center;
  }

  .popup-content {
    padding: 1.5rem;
    max-width: 90%;
  }
}