/**
 * Event Card Component — Única fuente de verdad para estilos
 * Usado por: includes/components/event-card.php  (PHP server-side)
 *            assets/js/event-card-renderer.js     (JS client-side)
 *
 * Todas las páginas que muestren tarjetas de eventos DEBEN cargar este CSS.
 * NO añadir estilos .location-card / .card-content-overlay en <style> inline.
 */

/* =========================================================
   1. TARJETA BASE
   ========================================================= */
.location-card {
  height: auto;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  padding: 0;
}

.location-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* =========================================================
   2. IMAGEN  — aspect-ratio 5/7 (proporción cartel DIN)
   ========================================================= */
.location-card .card-img-top {
  aspect-ratio: 5 / 7;
  width: 100%;
  object-fit: cover;
  border-radius: 0;          /* card overflow:hidden handles rounding */
  margin-bottom: 0;
  filter: contrast(1.05) brightness(1.02);
  transition: all 0.3s ease;
  display: block;
}

.location-card:hover .card-img-top {
  filter: contrast(1.1) brightness(1.05);
}

/* Placeholder cuando no hay imagen (div con card-img-top) */
.location-card .card-img-top.d-flex {
  aspect-ratio: 5 / 7;
  background: rgba(29, 64, 74, 0.7);
}

/* =========================================================
   3. OVERLAY DE CONTENIDO (gradient + texto)
   ========================================================= */
.card-content-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: linear-gradient(to top,
    rgba(0,0,0,0.98)  0%,
    rgba(0,0,0,0.95) 15%,
    rgba(0,0,0,0.90) 30%,
    rgba(0,0,0,0.80) 50%,
    rgba(0,0,0,0.65) 70%,
    rgba(0,0,0,0.40) 85%,
    rgba(0,0,0,0.10) 95%,
    rgba(0,0,0,0)   100%);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  color: white;
  max-height: 65%;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.3s ease, max-height 0.3s ease;
}

.location-card:hover .card-content-overlay {
  max-height: 80%;
  backdrop-filter: blur(3px);
}

/* =========================================================
   4. TÍTULO
   ========================================================= */
.location-card h5 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.9);
  letter-spacing: 0.3px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.location-card h5 a {
  color: white;
  text-decoration: none;
}

/* =========================================================
   5. TEXTOS (fecha, badge, distancia) DENTRO de overlay
   ========================================================= */
.location-card .text-muted {
  color: rgba(255, 255, 255, 0.85) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

.location-card .text-light {
  color: rgba(255, 255, 255, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  font-weight: 500;
}

.location-card .event-date,
.location-card .badge,
.location-card .distance-badge {
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.7);
  font-weight: 500;
}

.location-card .mb-3 {
  margin-bottom: 0.5rem !important;
}

/* =========================================================
   6. FECHA
   ========================================================= */
.location-card .event-date {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  white-space: nowrap;
}

/* =========================================================
   7. DISTANCE BADGE
   ========================================================= */
.location-card .distance-badge {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* =========================================================
   8. BADGES DE PRECIO / ASISTENTES
   ========================================================= */
.location-card .badge {
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.location-card .badge-success {
  background: rgba(82, 213, 19, 0.4);
  border: 1px solid rgba(82, 213, 19, 0.7);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.location-card .badge-info {
  background: rgba(59, 130, 246, 0.4);
  border: 1px solid rgba(59, 130, 246, 0.7);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.location-card .badge-secondary {
  background: rgba(170, 170, 170, 0.45);
  border: 1px solid rgba(170, 170, 170, 0.7);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* =========================================================
   9. PARTICIPANTES COMPACTOS
   ========================================================= */
.location-card .participants-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
}

.location-card .participants-compact .avatar-container {
  width: 26px;
  height: 26px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.location-card .participants-compact .gigger-avatar {
  border-radius: 50%;
  border: 2px solid var(--accent-blue, #3b82f6);
}

.location-card .participants-compact .venue-avatar {
  border-radius: 8px;
  border: 2px solid var(--gigtonic-green, #52d513);
}

.location-card .participants-compact .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.location-card .participant-name-inline {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.85);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
  text-decoration: none;
}

.location-card .participant-name-inline:hover {
  color: white;
  text-decoration: none;
}

.location-card .participants-overflow {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  margin-left: 2px;
}

/* =========================================================
   10. FOOTER (botones de acción)
   ========================================================= */
.event-card-footer {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 12px 12px;
}

/* =========================================================
   11. EVENTOS PASADOS
   ========================================================= */
.location-card.past-event {
  opacity: 0.6;
  filter: saturate(0.4);
  transition: opacity 0.3s, filter 0.3s, transform 0.3s, box-shadow 0.3s;
}

.location-card.past-event:hover {
  opacity: 0.85;
  filter: saturate(0.7);
}

/* =========================================================
   12. BADGE EXTRA (recomendación, etc.)
   ========================================================= */
.rec-reason-badge {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.85);
  background: rgba(82, 213, 19, 0.3);
  border: 1px solid rgba(82, 213, 19, 0.5);
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* =========================================================
   13. LIKE BUTTON OVERLAY
   ========================================================= */
.location-card .like-btn-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: none;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  color: white;
  font-size: 0.95rem;
  padding: 6px 10px;
  line-height: 1;
}

.location-card .like-btn-overlay:hover {
  background: rgba(0,0,0,0.65);
  transform: scale(1.08);
}

.location-card .like-btn-overlay.liked {
  color: #ff4757;
}

.location-card .like-btn-overlay .like-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  min-width: 8px;
  text-align: center;
}

/* =========================================================
   14. SEPARADOR DE EVENTOS PASADOS
   ========================================================= */
.past-separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 20px;
}

.past-separator .separator-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.past-separator .separator-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* =========================================================
   15. RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .location-card {
    max-width: none;
    margin-bottom: 15px;
  }

  .location-card .card-img-top,
  .location-card .card-img-top.d-flex {
    aspect-ratio: 5 / 7;
  }

  .card-content-overlay {
    padding: 10px;
    max-height: 60%;
  }
}

@media (max-width: 576px) {
  .location-card .card-img-top,
  .location-card .card-img-top.d-flex {
    aspect-ratio: 5 / 7;
  }

  .location-card h5 {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .card-content-overlay {
    padding: 8px 10px;
    max-height: 55%;
  }

  .location-card .event-date {
    font-size: 0.78rem;
  }

  .location-card .distance-badge {
    font-size: 0.75rem;
    padding: 1px 6px;
  }

  .location-card .badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.45rem;
  }

  .location-card .participant-name-inline {
    max-width: 60px;
    font-size: 0.7rem;
  }
}
