/* General Section Styling */
.agenda-section {
  background-color: #231f1f;
  color: #fff;
  /* Removed padding from here so the background can stretch */
  font-family: Arial, sans-serif;
  width: 100%;
  /* Ensure it spans full width */
}

/* NEW: Content Wrapper for Centering and Max Width */
.agenda-content-wrap {
  max-width: 1400px;
  /* Adjust this value (1200px to 1400px) based on your theme's content width */
  margin-left: auto;
  margin-right: auto;
  padding: 40px 20px;
  /* Apply padding here to space content from the edges */
}

.agenda-header {
  text-align: center;
  margin-bottom: 30px;
  /* Increased margin for spacing */
}

.agenda-title {
  font-size: 50px;
  font-weight: bold;
  margin: 0;
  color: #00aaff;
}

.agenda-subtitle {
  font-size: 14px;
  color: #aaa;
  margin: 5px 0 0;
}

/* Filters Styling */
.agenda-filters {
  display: flex;
  flex-wrap: wrap;
  gap: unset;
  margin-bottom: unset;
  align-items: center;
  justify-content: center;
}

.filter-label {
  font-size: 16px;
  color: #00aaff;
  font-weight: bold;
  margin-right: 15px;
  /* Adjusted margin */
  white-space: nowrap;
}

.filter-group {
  position: relative;
  display: inline-block;
}

.filter-dropdown {
  appearance: none;
  background: #231f1f;
  border: 1px solid #444;
  color: #fff;
  padding: 8px 30px 8px 10px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  width: 180px;
  /* Slightly wider dropdowns for better touch target */
  outline: none;
  transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2300aaff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.filter-dropdown:focus {
  border-color: #00aaff;
  /* Highlight on focus */
}

.filter-dropdown:disabled {
  color: #666;
  /* Dim the disabled placeholder */
}

.filter-dropdown option {
  background: #231f1f;
  color: #fff;
}

.filter-dropdown option:disabled {
  color: #666;
}

/* Events Container and Grid */
.events-container {
  margin-top: 20px;
}

/* Loading State Blur (Applied when filters are changed, replacing content) */
.events-container.events-loading {
  opacity: 0.4;
  /* Soft blur and dimming */
  filter: blur(1.5px);
  pointer-events: none;
  transition: opacity 0.3s, filter 0.3s;
  min-height: 250px;
  /* Prevent collapse during load */
  position: relative;
}

/* Loading Overlay for Reset */
.loading-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #00aaff;
  font-size: 18px;
  font-weight: bold;
  z-index: 10;
  background: #231f1f;
  /* Match background with transparency */
  height: 300px;
  width: 100%;
  text-align: center;
  grid-column: 1 / -1;
}

/* --- Infinite Scroll Blur Transition --- */

/* The wrapper applied by PHP to the content for new pages (page > 1) */
.new-events-page {
  /* Set final state and transition */
  filter: blur(0);
  opacity: 1;
  transition: filter 0.8s ease-out, opacity 0.8s ease-out;
}

/* The initial state when new posts are loaded via AJAX */
.events-container .is-blurred {
  filter: blur(8px);
  /* Start with a heavy blur */
  opacity: 0.2;
  /* Start mostly transparent */
}

/* -------------------------------------- */

.events-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* 5 columns on large screens */
  gap: 20px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .events-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .events-grid {
    grid-template-columns: repeat(3, 1fr);
    /* 3 columns on medium screens */
  }


}

@media (max-width: 768px) {
  .events-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns on tablet */
  }


  .agenda-filters {
    justify-content: center;
    /* Center filters on mobile */
  }

  .custom-agenda-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 820px;
  }

  .custom-dropdown-wrapper {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }

  .custom-filter-group .nice-select.open .list {
    border-radius: unset;
    background-color: #000 !important;
    min-width: 200px;
  }
}

@media (max-width: 480px) {
  .events-grid {
    grid-template-columns: 1fr;
    /* 1 column on small screens */
  }

  .filter-dropdown {
    width: 100%;
    /* Full width dropdowns on tiny screens */
  }

  .agenda-content-wrap {
    padding: 20px 15px;
  }


}

/* Event Card Styling */
.event-card {
  background-color: #231f1f;
  padding: 15px;
  text-align: center;
  border-radius: 8px;
  /* Slightly larger radius */
  height: 100%;
  /* Use auto height or flex grow */
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.event-card img {
  width: 100%;
  height: 100px;
  /* Reduced height for better fit */
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: 4px;
}

.event-card h3 {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 5px;
  color: #fff;
}

.event-card p {
  font-size: 13px;
  color: #aaa;
  margin: 0;
  line-height: 1.4;
}

.event-card .discount {
  color: #00aaff;
  font-weight: bold;
  margin-top: 10px;
  font-size: 14px;
}

/* --- Modal/Popup Styling --- */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  pointer-events: all;
  /* Higher z-index to cover everything */
}

.popup-overlay.is-visible {
  display: flex;
}

.popup-content {
  background: #2d2d2d;
  padding: 40px;
  border-radius: 8px;
  text-align: center;
  max-width: 450px;
  /* Ensures a rectangular shape */
  width: 90%;
  height: auto;
  position: relative;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.7);
}

.popup-content h2 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 15px;
}

.popup-content p {
  color: #fff;
  font-size: 16px;
}

.popup-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}

.popup-close-btn:hover {
  color: #fff;
}

/* --- Filter Mask Styling --- */
#filter-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  /* Semi-transparent black */
  z-index: 100;
  /* Must be below the popup (z-index: 99999) but above all content */
  display: none;
  transition: opacity 0.3s;
}

#filter-mask.is-visible {
  display: block;
}

.custom-agenda-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  /* Adjusted gap */
  margin-bottom: 40px;
  /* Adjusted margin */
  align-items: center;
}

.custom-filter-label {
  font-size: 12px;
  color: #00bff4;
  font-weight: bold;
  font-family: "Open Sans", sans-serif;
  margin-bottom: 7px;
  z-index: 200;
}

.custom-filter-dropdown {
  appearance: auto;
  background: #231f1f;
  border: unset;
  color: #fff;
  padding: 8px 30px 8px 10px;
  border-radius: unset;
  cursor: pointer;
  width: unset;
  outline: none;
  transition: unset;
  background-image: unset;
  background-position: unset;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  font-size: 12px;
}

.custom-filter-group .nice-select:after {
  height: 8px;
  width: 8px;
  top: 45%;
}

.custom-filter-group .nice-select.open .list {
  background-color: unset;
  box-shadow: unset;
  max-height: 300px;
  overflow-y: auto;
}

.custom-filter-group .nice-select .option {
  padding: 0 9px;
  line-height: 28px;
  min-height: 30px;
  text-transform: uppercase;
  font-size: 12px;
}

.custom-filter-group .nice-select .option li {
  line-height: 28px;
}

.custom-filter-group .nice-select .list {
  top: 75%;
  background-color: unset;
  box-shadow: unset;
  left: 10px;
}

.custom-filter-group .nice-select .option.focus,
.nice-select .option.selected.focus {
  background-color: unset !important;
}

.custom-filter-group .nice-select .option:hover,
.nice-select .option.focus,
.nice-select .option.selected.focus {
  background-color: unset;
  color: #00bff4;
}

.custom-filter-group .nice-select.open .list::-webkit-scrollbar {
  width: 5px;
}

.custom-filter-group .nice-select.open .list::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 5px;
  scrollbar-width: thin;
}

.custom-filter-group .nice-select {
  position: relative;
  background-color: unset;
  border: none;
  display: flex;
  font-size: 12px !important;
}

.custom-filter-group .nice-select .current{
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.new-event-card {
  display: inline;
}

.custom-event-card .discount {
  color: #00bff4;
  font-weight: 700;
  margin-top: unset;
  font-size: 14px;
}

.custom-event-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin-bottom: unset;
  border-radius: unset;
  opacity: 0.8;
}

.custom-event-card figure {
  height: 200px;
  margin-bottom: 18px !important;
}

.custom-event-card h3 {
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 18px;
  color: #fff;
  line-height: 20px;
}

.custom-event-card {
  background-color: unset;
  padding: 0 0 10px;
  text-align: center;
  border-radius: unset;
  height: 100%;
  width: 100%;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: unset;
  transition: transform 0.2s, box-shadow 0.2s;
}

.custom-filter-dropdown {
  appearance: auto;
  background: #231f1f;
  border: unset;
  color: #fff;
  padding: 8px 30px 8px 10px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  width: unset;
  outline: none;
  transition: border-color 0.2s;
  background-image: unset;
  background-repeat: unset;
  background-position: unset;
}

.custom-agenda-title {
  font-family: "Open Sans", sans-serif;
  font-size: 50px;
  font-weight: 800;
  margin: 0;
  color: #00bff4;
}

.custom-agenda-subtitle {
  font-size: 18px;
  font-weight: 400px;
  color: #fff;
  margin: 25px 0 0;
}

.custom-event-card p {
  font-size: 14px;
  color: #fff;
  line-height: 24px;
  font-weight: 400;
}

.custom-dropdown-wrapper {
  position: relative;
  z-index: 100;
}

.popup-active {
  overflow: hidden;
  position: absolute;
  width: 100%;
  pointer-events: none;
  touch-action: none;
}

.popup-active::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  display: block;
}

.nice-select .option.focus,
.nice-select .option.selected.focus,
.nice-select .option.disabled.option.focus {
  color: #00bff4;
}

.nice-select .option.disabled:hover {
  color: #999;
}
.nice-select.open .list,
.nice-select .list {
  transform: unset !important;
  transition: unset !important;
}

.custom-card-wrapper {
  background-color: #161616;
  padding: 10px;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  /* border: 4px solid #231f1f; */
}

.custom-card-figure {
  height: 170px;
  margin-bottom: 20px;
}

.custom-card-figure img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.3s ease-in-out;
}

.custom-card-figure:hover img {
  animation: zoomInOut 1s linear infinite;
}

/* Keyframes for animation */
@keyframes zoomInOut {
  25% {
    transform: scale(1.1);
  }

  75% {
    transform: scale(0.9);
  }
}

.custom-card-title {
  margin-top: 18px;
  text-align: center;
  font-family: "Open Sans", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: normal;
  line-height: 24px;
  color: #e0e0e0;
}

.custom-card-subtitle {
  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 30px;
  text-align: center;
  color: #e0e0e0;
  margin-bottom: 0;
}

.custom-card-discount {
  color: #00bff4;
  font-size: 16px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
  letter-spacing: normal;
  font-family: "Open Sans", sans-serif;
}

.custom-card-hide {
  display: none;
}

.custom-card-occured {
  color: #00bff4;
  font-size: 16px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
  letter-spacing: normal;
  margin-bottom: 0;
  font-family: "Open Sans", sans-serif;
}

.custom-card-ticket-btn {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 16px;
  color: #fff;
  padding: 20px 10px;
  background-color: #009cdd;
  text-align: center;
  display: block;
  width: fit-content;
  margin: 20px auto 0;
  font-family: "Open Sans", sans-serif;
  position: relative;
}

.custom-card-ticket-btn:hover {
  background-color: #6ec1e4;
}

.custom-card-badge {
  background-color: #dc3131;
  min-width: 30px;
  min-height: 30px;
  padding: 8px 2px;
  border-radius: 100px;
  position: absolute;
  color: #fff;
  font-family: "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: normal;
  right: -10px;
  bottom: 40px;
}

.custom-events-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  max-width: 1140px;
  width: 100%;
  column-gap: 8px;
  row-gap: 20px;
  background-color: #231f1f;
}

.custom-gray-image {
  filter: grayscale(100%);
}

.custom-card-performed {
  background-color: #292828;
}

.custom-card-mobile-button {
  display: none;
}

@media (max-width: 1024px) {
  .custom-card-ticket-btn {
    padding: 20px 30px;
  }

  .custom-card-mobile-button {
    display: block;
  }

  .custom-card-desktop-button {
    display: none;
  }
}

@media (max-width: 768px) {
  .custom-events-grid {
    grid-template-columns: repeat(1, 1fr);
  }

  .custom-card-figure {
    height: 350px;
  }

  .custom-card-wrapper {
    width: 100%;
  }

  .custom-events-grid {
    row-gap: 10px;
  }
}

@media (max-width: 576px) {
  .custom-card-figure {
    height: 250px;
  }
}