/* =========================================
   SECCIÓN DE EVENTOS - QUILOMBERA
   Diseño cinemático Dark Mode con mapa interactivo
   ========================================= */

/* --- CONTENEDOR PRINCIPAL --- */
.events-main-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

/* Desktop: Mapa a la derecha, lista a la izquierda */
@media (min-width: 1024px) {
  .events-main-container {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- TABS DE NAVEGACIÓN --- */
.events-tabs-container {
  transition: all 0.3s ease;
}

.events-tab {
  display: flex;
  align-items: center;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  color: #9ca3af;
  background: rgba(31, 41, 55, 0.8);
  border: 2px solid rgba(230, 179, 37, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.events-tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(230, 179, 37, 0.1), transparent);
  transition: left 0.5s ease;
}

.events-tab:hover::before {
  left: 100%;
}

.events-tab:hover {
  border-color: #E6B325;
  color: #E6B325;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(230, 179, 37, 0.3);
}

.events-tab.active {
  background: linear-gradient(135deg, #E6B325 0%, #d4a120 100%);
  border-color: #E6B325;
  color: #000;
  box-shadow: 0 0 20px rgba(230, 179, 37, 0.5);
}

.events-tab i {
  font-size: 1.25rem;
}

/* --- MAPA INTERACTIVO --- */
.events-map-wrapper {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 1024px) {
  .events-map-wrapper {
    height: 600px;
    position: sticky;
    top: 120px;
  }
}

.events-map {
  width: 100%;
  height: 100%;
  background: #1a1a2e;
}

/* --- LISTA DE EVENTOS --- */
.events-list-wrapper {
  width: 100%;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: none;
  overflow-y: visible;
}

@media (min-width: 1024px) {
  .events-list {
    padding-right: 1rem;
  }

  /* Scrollbar personalizado */
  .events-list::-webkit-scrollbar {
    width: 8px;
  }

  .events-list::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 10px;
  }

  .events-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #E6B325, #d4a120);
    border-radius: 10px;
  }

  .events-list::-webkit-scrollbar-thumb:hover {
    background: #E6B325;
  }
}

/* --- TARJETAS DE EVENTOS --- */
.event-card {
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
  border-radius: 16px;

  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

}

.event-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(230, 179, 37, 0.25);
  
}



.event-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.6s ease;
  border-radius: 15px;
}

.event-card:hover .event-card-image {
  transform: scale(1.1);
}

.event-card-content {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* margin-bottom: 1rem; */
  flex-flow: column;
}

.event-card-date {
  background: linear-gradient(135deg, #E6B325 0%, #d4a120 100%);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(230, 179, 37, 0.3);
  
}

.event-card-date.archive {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: #fff;
}

.event-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.event-card-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9ca3af;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.event-card-location i {
  color: #E6B325;
  font-size: 1.1rem;
}

.event-card-city {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #d1d5db;
  font-size: 0.9rem;
}

.event-card-city i {
  color: #FF2D95;
}

/* --- BOTÓN DE TICKETS/INFORMACIÓN --- */
.event-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-card-actions.has-ticket {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}



.event-card-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* Botón de Ver en el Mapa */
.event-card-map-button {
  background: linear-gradient(135deg, #FF2D95 0%, #e02585 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 45, 149, 0.3);
}

.event-card-map-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 45, 149, 0.5);
  background: linear-gradient(135deg, #ff3da5 0%, #FF2D95 100%);
}

/* Botón de Tickets */
.event-card-ticket-button {
  background: linear-gradient(135deg, #E6B325 0%, #d4a120 100%);
  color: #000;
  box-shadow: 0 4px 12px rgba(230, 179, 37, 0.3);
}

.event-card-ticket-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 179, 37, 0.5);
  background: linear-gradient(135deg, #f0c235 0%, #E6B325 100%);
}

.event-card-button i {
  font-size: 1.1rem;
}

.event-card-button i:last-child {
  margin-left: auto;
}

/* Estilos para eventos archivados */
.archive .event-card-map-button {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  box-shadow: 0 4px 12px rgba(156, 163, 175, 0.3);
}

.archive .event-card-map-button:hover {
  background: linear-gradient(135deg, #b0b7bf 0%, #7c8491 100%);
  box-shadow: 0 6px 20px rgba(156, 163, 175, 0.5);
}

.archive .event-card-ticket-button {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.archive .event-card-ticket-button:hover {
  background: linear-gradient(135deg, #7c8491 0%, #5d6671 100%);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.5);
}

/* --- ESTADOS DE CARGA Y VACÍO --- */
.events-loading,
.events-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(230, 179, 37, 0.2);
  border-top-color: #E6B325;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* --- PERSONALIZACIÓN DEL POPUP DE LEAFLET --- */
.leaflet-popup-content-wrapper {
  background: rgba(17, 24, 39, 0.98) !important;
  color: #fff !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(230, 179, 37, 0.3) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 1rem !important;
  min-width: 250px !important;
}

.leaflet-popup-tip {
  background: rgba(17, 24, 39, 0.98) !important;
  border: 1px solid rgba(230, 179, 37, 0.3) !important;
}

.popup-city-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.popup-directions-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, #FF2D95 0%, #e02585 100%);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(255, 45, 149, 0.4);
}

.popup-directions-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 45, 149, 0.6);
  background: linear-gradient(135deg, #ff3da5 0%, #FF2D95 100%);
}

.popup-directions-button i {
  font-size: 1rem;
}

.popup-directions-button i:last-child {
  margin-left: auto;
}

.popup-event-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.popup-event-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popup-event-item:hover {
  background: rgba(230, 179, 37, 0.1);
  padding-left: 0.5rem;
  border-radius: 4px;
}

.popup-event-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.popup-event-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
}

/* --- ANIMACIONES --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.event-card {
  animation: fadeInUp 0.5s ease-out;
}

/* --- MARCADORES DEL MAPA PERSONALIZADOS --- */
.custom-marker {
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
  transition: filter 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}

.custom-marker:hover {
  filter: drop-shadow(0 8px 20px rgba(230, 179, 37, 0.8)) brightness(1.15);
  transform: scale(1.1);
}

.upcoming-marker {
  filter: drop-shadow(0 4px 12px rgba(230, 179, 37, 0.7));
}

.upcoming-marker:hover {
  filter: drop-shadow(0 10px 25px rgba(230, 179, 37, 1)) brightness(1.2);
  transform: scale(1.15);
}

.archive-marker {
  filter: drop-shadow(0 4px 12px rgba(156, 163, 175, 0.5)) grayscale(0.5);
  opacity: 0.8;
}

.archive-marker:hover {
  filter: drop-shadow(0 8px 16px rgba(156, 163, 175, 0.7)) grayscale(0.3);
  opacity: 1;
  transform: scale(1.1);
}

/* Estilos responsive adicionales */
@media (max-width: 640px) {
   .event-card-date{
    width: 100%;
    max-width: 150px;
  }
  .events-tab {
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
  }

  .event-card-title {
    font-size: 1.25rem;
  }

  .event-card-content {
    padding: 1rem;
    flex-flow: column;
    margin-bottom: 1rem;
  }
  .event-card-header{
    flex-flow: row;
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    flex-flow: row;
    gap: 7px;
    width: 100%;
  }
}
