/* Events Page Wrapper */
.events-page-wrapper {
  padding-top: 100px;
  min-height: 80vh;
  background: var(--bg-white);
  position: relative;
}

/* Page Header */
.events-page-header {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(to bottom, #f4f0e8, var(--bg-white));
}

.events-page-header .section-desc {
  max-width: 600px;
  margin: 15px auto 0;
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Events Grid Section */
.events-grid-section {
  padding: 40px 0 100px;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* Event Card */
.event-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0,0,0,0.03);
}

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

.event-card-img-wrap {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}

.event-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.event-card-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.event-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: 500;
}

.event-card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.event-card-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 15px;
  flex-grow: 1;
}

.event-card-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.event-card-footer span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.event-card-footer i {
  color: var(--primary-color);
}

/* Pagination */
.events-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 50px;
}

.page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--text-dark);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-btn:hover {
  background: #f4f0e8;
  border-color: #d4ccb8;
}

.page-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f9f9f9;
}

/* Modal Overlay */
.event-details-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 20px;
}

.event-details-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Modal Card */
.event-details-card {
  background: var(--bg-white);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.event-details-overlay.active .event-details-card {
  transform: translateY(0);
  opacity: 1;
}

.close-event-details {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease;
}

.close-event-details:hover {
  background: var(--primary-color);
}

/* Modal Header */
.event-modal-header {
  position: relative;
  width: 100%;
  height: 250px;
}

#eventModalCover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-modal-header-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
}

#eventModalTitle {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin-bottom: 10px;
  color: #fff;
}

.event-meta {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.event-meta span i {
  margin-right: 6px;
  color: var(--accent-color);
}

/* Tabs */
.event-modal-tabs {
  display: flex;
  background: #f4f0e8;
  border-bottom: 1px solid #e0dbce;
}

.tab-btn {
  flex: 1;
  padding: 15px 0;
  background: none;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary-color);
}

/* Modal Body / Tab Content */
.event-modal-body {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(90vh - 250px - 53px); /* 90vh total - 250 header - 53 tabs */
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

#eventModalDescText {
  color: var(--text-dark);
  line-height: 1.8;
  white-space: pre-line;
}

/* Gallery Tab */
.event-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.event-gallery-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.event-gallery-grid img:hover {
  transform: scale(1.05);
}

/* Videos Tab */
.event-video-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  .events-page-wrapper {
    padding-top: 80px;
  }
  .events-grid {
    grid-template-columns: 1fr;
  }
  .event-modal-header {
    height: 200px;
  }
  #eventModalTitle {
    font-size: 1.5rem;
  }
}

/* Event Status Badges */
.event-status-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  backdrop-filter: blur(4px);
}
.event-status-badge.upcoming { 
  background: rgba(47, 133, 90, 0.9); 
  border: 1px solid rgba(47, 133, 90, 1); 
}
.event-status-badge.past { 
  background: rgba(113, 128, 150, 0.9); 
  border: 1px solid rgba(113, 128, 150, 1); 
}
.event-status-badge.today { 
  background: rgba(214, 158, 46, 0.9); 
  border: 1px solid rgba(214, 158, 46, 1); 
}
