:root {
  --main-color: #acc8e5;
  --mainText-color: #112a46;
  --primary-color: #27b462;
  --secondary-color: #5dade2;
  --accent-color: rgb(255, 193, 7); 
  --fadeSecondaryColor: rgba(33, 150, 243, 0.8);
  --fadeAccent-color: rgba(255, 193, 7, 0.8);
  --text-color: #333;
  --light-text-color: #f4f4f4;
  --background-light: #f9f9f9;
  --background-dark: #2c3e50; 
  --card-background: rgb(255, 255, 255);
  --border-color: #ddd;
  --body-color: rgb(208, 229, 240);

  --font-family-primary: "poppins", sans-serif;
  --font-family-headings: "arial", serif;
}

/* events.css - Mobile First */

/* Hero Section */
.events-hero {
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("../assets/eventsHero.jpeg") no-repeat center center/cover;
  color: var(--light-text-color);
  padding: 60px 0;
  text-align: center;
  margin-bottom: 30px;
}

.events-hero h1 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 2.5em;
  font-weight: 700;
}

.events-hero .section-description {
  max-width: 600px;
  margin: 0 auto;
  font-size: 1em;
  line-height: 1.5;
  opacity: 0.9;
}

/* Events Section Controls (Filters & Search) */
.events-section {
  padding: 30px 0;
}

.events-controls {
  display: flex;
  flex-direction: column; /* Stack controls on mobile */
  gap: 15px; /* Spacing between controls */
  margin-bottom: 30px;
}

.events-controls input[type="text"],
.events-controls select {
  width: 100%; /* Full width on mobile */
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1em;
  -webkit-appearance: none; /* Remove default select styling for consistency */
  -moz-appearance: none;
  appearance: none;
  background-color: var(--card-background);
  color: var(--text-color);
}

.events-controls select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-24.9%200L146.2%20188.4%2030.5%2069.4a17.6%2017.6%200%200%200-24.9%2024.9l130.1%20129.9c6.8%206.8%2017.9%206.8%2024.7%200l130.1-129.9a17.6%2017.6%200%200%200%200-24.9z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px; /* Make space for the arrow */
}

.events-controls .btn {
  margin-top: 5px; /* Space from filters */
}

/* Event Grid */
.events-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 25px; /* Spacing between cards */
}

.no-events-message {
  text-align: center;
  color: var(--text-color);
  font-style: italic;
  padding: 20px;
  grid-column: 1 / -1; /* Span full width of the grid */
}

/* Event Card */
.event-card {
  background-color: var(--card-background);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.event-card-image {
  width: 100%;
  height: 180px; /* Fixed height for images on mobile */
  object-fit: cover;
}

.event-card-content {
  padding: 20px;
  flex-grow: 1; /* Allow content to take available space */
  display: flex;
  flex-direction: column;
}

.event-card-content h3 {
  font-size: 1.2em; /* Mobile card title */
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--primary-color); /* Use primary color for titles */
}

.event-card-meta {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 15px;
  line-height: 1.4;
}

.event-card-meta i {
  margin-right: 8px;
  color: var(--secondary-color);
}

.event-card-description {
  font-size: 0.95em;
  color: var(--text-color);
  margin-bottom: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-card-footer {
  margin-top: auto; /* Push to bottom of flex container */
  display: flex;
  flex-direction: column; /* Stack buttons on mobile */
  gap: 10px;
}

.event-card-footer .btn {
  width: 100%; /* Full width for card buttons */
  margin-bottom: 0; /* Remove global button margin */
}



/* Media Queries for `events.css` (Mobile-First) */

/* Small Tablets and Larger Phones (e.g., min-width 576px) */
@media (min-width: 576px) {
  .events-hero {
    padding: 80px 0;
  }

  .events-hero h1 {
    font-size: 3em;
  }

  .events-controls {
    flex-direction: row; /* Controls side-by-side */
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center;
    gap: 15px;
  }

  .events-controls input[type="text"],
  .events-controls select {
    width: calc(50% - 7.5px); /* Two columns */
  }

  .events-controls .btn {
    width: auto; /* Buttons adjust to content */
    margin-top: 0;
  }

  .events-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(280px, 1fr)
    ); /* 2 columns, flexible */
  }

  .event-card-image {
    height: 200px;
  }
}

/* Medium Devices / Tablets (e.g., min-width 768px) */
@media (min-width: 768px) {
  .events-hero {
    padding: 100px 0;
  }

  .events-hero h1 {
    font-size: 3.5em;
  }

  .events-section {
    padding: 50px 0;
  }

  .events-controls {
    justify-content: space-between; /* Spread controls */
    gap: 20px;
  }

  .events-controls input[type="text"] {
    flex-basis: 30%; /* Take up some space for search */
  }

  .events-controls .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    flex-basis: 55%; /* Filters take up majority */
    justify-content: flex-end;
  }

  .events-controls select {
    flex-basis: calc(33.33% - 10px); /* 3 filters per row */
    width: auto;
  }
  .events-controls .btn {
    flex-basis: content; /* Adjust button size */
  }

  .events-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(300px, 1fr)
    ); /* 3 columns, flexible */
  }

  .event-card-image {
    height: 220px;
  }

  .event-card-content h3 {
    font-size: 1.3em;
  }
}

/* Large Devices / Desktops (e.g., min-width 992px) */
@media (min-width: 992px) {
  .events-hero {
    padding: 120px 0;
  }

  .events-hero h1 {
    font-size: 4em;
  }

  .events-controls {
    flex-wrap: nowrap; /* Keep controls in one line */
    justify-content: space-between;
  }

  .events-controls input[type="text"] {
    flex-basis: 250px; /* Fixed width for search */
  }

  .events-controls .filters {
    flex-basis: auto; /* Adjust naturally */
    gap: 20px;
  }

  .events-controls select {
    width: auto; /* Auto width */
  }

  .events-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(320px, 1fr)
    ); /* Slightly larger cards */
  }

  .event-card-image {
    height: 240px;
  }

  .event-card-content h3 {
    font-size: 1.4em;
  }
}


/* Base styles for all devices (Mobile-First) */
.events-grid {
  display: flex; /* Use flexbox for a clean vertical stack on mobile */
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 1rem; /* Adjust padding for mobile screens */
}

.event-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.event-card .media-placeholder {
  width: 100%;
  background-color: #f2f2f2;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ccc;
  font-size: 4rem;
}

.event-card .media-placeholder video {
  width: 100%;
  height: auto;
  object-fit: contain; 
}

.event-card .eventFlyer {
  width: 100%;
  height: auto; /* Fixed height for images */
  object-fit: cover;
}

.event-card .card-content {
  padding: 1.5rem;
}

.event-card .event-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-top: 0;
}

.event-card .event-meta {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0;
  line-height: 1.4;
  font-weight: 600;
}

.event-card .event-meta i {
  color: var(--secondary-color);
  margin-right: 5px;
}

.event-card .event-preamble {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.register-btn {
  width: 100%;
  padding: 0.75rem;
  background-color:var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  text-transform: uppercase;
}

.register-btn:hover {
  background-color: var(--secondary-color);
}

/* Modal styles - these are already responsive by nature, but are included here for completeness */
.eventModal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
}

.eventModal-content {
  background-color: #fff;
  margin: auto;
  padding: 2rem;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  text-align: center;
}


.eventModal .close-btn {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
}

.eventModal .close-btn:hover,
.eventModal .close-btn:focus {
  color: #333;
  text-decoration: none;
  cursor: pointer;
}

.eventModal .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.eventModal .modal-actions .btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border-radius: 4px;
}

.eventModal .call-btn {
  background-color: #28a745;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
}

.eventModal .call-btn:hover {
  background-color: #218838;
}

.eventModal .support-btn {
  background-color: #6c757d;
  color: white;
  border: none;
}

.eventModal .support-btn:hover {
  background-color: #5a6268;
}

.eventModal .sponsor-btn {
  background-color: #17a2b8;
  color: white;
  border: none;
}

.eventModal .sponsor-btn:hover {
  background-color: #138496;
}

/* Media Query for larger screens */
@media (min-width: 768px) {
  .events-grid {
    display: grid; /* Switch to a grid layout on larger screens */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    padding: 2rem 0;
  }
}