/* Events Grid Container */
.events-grid-container {
  width: 100%;
  margin: 20px 0;
}

#events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  padding: 20px 0;
  transition: opacity 0.3s ease-in-out;
}

/* Event Card Link */
.event-card-link {
  text-decoration: none;
  color: inherit;
}

/* Event Card */
.event-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.event-card:hover img {
  transform: scale(1.08);
}

/* Event Card Image */
.event-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease-in-out;
}

/* Event Card Content */
.event-card h2 {
  text-align: center;
  margin: 20px 15px 15px 15px;
  font-size: 1.25em;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Learn More Link */
.learn-more-link {
  display: inline-block;
  background: linear-gradient(135deg, #05d4e7, #0099cc);
  color: white;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.learn-more-link:hover {
  background: linear-gradient(135deg, #0099cc, #0077aa);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(5, 212, 231, 0.3);
}

/* No Events Message */
#events-grid > p {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 1.1em;
}

/* Popup */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  width: 90%;
  max-width: 500px;
  background: white;
  padding: 30px;
  border-radius: 15px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#close-popup {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
  background: none;
  border: none;
  padding: 0;
}

#close-popup:hover {
  color: #333;
}

.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  #events-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 15px 0;
  }
  
  .event-card h2 {
    font-size: 1.1em;
    margin: 15px 12px 12px 12px;
  }
  
  .event-card img {
    height: 160px;
  }
}

@media (max-width: 480px) {
  #events-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .popup-content {
    width: 95%;
    padding: 20px;
  }
}
