/* ✅ Grid */
.dlts-event-grid.mode-popup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 10px;
  direction: rtl;
  align-items: stretch;
}

/* ✅ Card – Base Styling */
.dlts-event-grid.mode-popup .dlts-event-card {
  background-color: var(--dlts-card-bg, #ffffff);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  text-align: center;
}

/* ✅ Hover effect */
.dlts-event-grid.mode-popup .dlts-event-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* ✅ Mobile adjustments */
@media (max-width: 600px) {
  .dlts-event-grid.mode-popup {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
  }

  .dlts-event-grid.mode-popup .dlts-event-card {
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  .dlts-event-grid.mode-popup .dlts-event-card:hover {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  }
}

/* ✅ Card Image */
.dlts-event-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  display: block;
}

/* ✅ Ensure the event card is a flex container with full height */
.dlts-event-grid.mode-popup .dlts-event-card {
  display: flex;
  flex-direction: column;
  justify-content: center; /* Vertically center content if possible */
  align-items: center;
  height: 100%;
}

/* ✅ When there is no image, stretch the content container and center the content */
.dlts-event-grid.mode-popup .dlts-event-card .dlts-card-content.no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Vertically center text inside card */
  flex: 1;
  width: 100%;
  height: 100%;
  text-align: center;
}

/* ✅ Remove any spacing that may push the title/date around */
.dlts-event-grid.mode-popup .dlts-card-content.no-image .dlts-card-title,
.dlts-event-grid.mode-popup .dlts-card-content.no-image .dlts-event-date {
  margin: 0 !important;
  padding: 0 !important;
}

/* ✅ Mobile adjustments for no-image cards to match grid layout */
@media (max-width: 600px) {
  .dlts-event-grid.mode-popup .dlts-event-card .dlts-card-content.no-image {
    padding: 8px;
    min-height: 220px; /* 🟢 Match minimum height of other cards */
    box-sizing: border-box;
  }

  .dlts-event-grid.mode-popup .dlts-event-card {
    min-height: 220px; /* 🟢 Ensure consistent height across cards */
  }
}




/* ✅ Card Title */
.dlts-card-title {
  font-size: var(--dlts-title-size, 16px);
  font-weight: bold;
  color: #1e272e;
  margin-bottom: 4px;
  margin-top: 4px;
  text-align: center;
}

/* ✅ Dynamic RTL/LTR Handling */
.dlts-card-title,
.dlts-event-date,
.dlts-card-excerpt,
.dlts-event-button {
  text-align: center;
  direction: inherit;
}

/* ✅ Event Date - pinned to bottom */
.dlts-event-date {
  font-size: 14px;
  color: #666;
  margin-top: auto;
  align-self: center;
  padding-top: 10px;
}

/* ✅ Hide Popup HTML container */
.dlts-popup-content {
  display: none;
}

/* ✅ Overlay */
.dlts-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeOverlay 0.25s ease-out;
}

/* ✅ Lightbox Container */
.dlts-lightbox {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  max-width: 540px;
  width: 92%;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.15);
  position: relative;
  text-align: center;
  animation: zoomIn 0.3s ease-out;
  direction: rtl;
  overflow: hidden;
}

/* ✅ Close Button (X) */
.dlts-popup-close {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 24px;
  font-weight: bold;
  color: #1e272e;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ✅ Popup Image Container */
.dlts-lightbox .dlts-popup-image {
  margin-bottom: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  max-height: 220px;
}

/* ✅ Popup Image */
.dlts-lightbox .dlts-popup-image img {
  height: auto;
  max-height: 220px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ✅ Title in Popup */
.dlts-popup-title {
  font-size: 24px;
  font-weight: 800;
  color: #1e272e;
  margin-bottom: 12px;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ✅ Body Text */
.dlts-popup-body {
  font-size: 16px;
  color: #444;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 18px;
}

.dlts-popup-body p {
  margin: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dlts-popup-body p i {
  color: #1fa7a0;
  font-size: 16px;
}

/* ✅ Button */
.dlts-lightbox .dlts-event-button {
  background: linear-gradient(135deg, #3dc1bc, #1fa7a0);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  padding: 12px 32px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 6px 16px rgba(61, 193, 188, 0.25);
  display: inline-block;
  margin-top: 20px;
  border: none;
}

.dlts-lightbox .dlts-event-button:hover {
  background: #1fa7a0;
  transform: scale(1.05);
}

/* 🎯 Wrapper clipped inside card */
.dlts-ticker-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.dlts-ticker-ribbon {
  position: absolute;
  top: -6px;
  left: -40px;
  width: 180px;
  transform: rotate(-45deg);
  background-color: #3dc1bc;
  color: white;
  font-weight: bold;
  font-size: 13px;
  padding: 6px 0;
  border-radius: 999px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  text-align: center;
  overflow: hidden;
}

.dlts-ticker-ribbon span {
  display: inline-block;
  white-space: nowrap;
  padding: 0 24px;
}

/* 🖱️ Tap Icon SVG */
.dlts-card-click-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 35px;
  height: 35px;
  transform: rotate(-20deg);
  opacity: 0.4;
  pointer-events: none;
  z-index: 5;
}

.dlts-card-click-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #444;
  stroke-width: 2px;
  opacity: 1;
}

/* 🎬 Ticker Animation Direction */
.dlts-ticker-ribbon[dir="rtl"] span {
  animation: tickerMoveRTL 6s linear infinite;
}
.dlts-ticker-ribbon[dir="ltr"] span {
  animation: tickerMoveLTR 6s linear infinite;
}

@keyframes tickerMoveRTL {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes tickerMoveLTR {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ✅ Animations */
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scrollLeft {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes scrollRight {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


/* ✅ Mobile Enhancements */
@media screen and (max-width: 767px) {
  .dlts-event-grid.mode-popup {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px;
  }

  .dlts-event-grid.mode-popup .dlts-event-card {
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
  }

  .dlts-event-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    display: block;
  }

  .dlts-card-title {
    font-size: 15px;
    margin: 6px 0 2px;
    line-height: 1.4;
  }

  .dlts-event-date {
    font-size: 13px;
    padding-top: 6px;
  }

  .dlts-card-click-icon {
    width: 26px;
    height: 26px;
    bottom: 4px;
    right: 4px;
    opacity: 0.6;
  }

  .dlts-ticker-ribbon {
    width: 160px;
    left: -30px;
    font-size: 12px;
    padding: 4px 0;
  }

  .dlts-ticker-ribbon span {
    padding: 0 20px;
  }

  .dlts-lightbox {
    padding: 20px 14px;
  }

  .dlts-popup-title {
    font-size: 20px;
  }

  .dlts-popup-body {
    font-size: 14px;
  }

  .dlts-lightbox .dlts-event-button {
    font-size: 15px;
    padding: 10px 24px;
  }
}
