/* ====================
   Event Card Component
   ==================== */

/* MOBILE SWIPEABLE SLIDER (Mantenido) */
.swipe-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 0.5rem 1rem 1.5rem;
    margin: 0 -1rem;
    scrollbar-width: none;
}

.swipe-slider::-webkit-scrollbar { display: none; }

.swipe-slider .slide-item {
    scroll-snap-align: center;
    flex: 0 0 85%;
    max-width: 320px;
}

/* ====================
   Event Card Redesign (Pixel Perfect + UX Polish)
   ==================== */
.evento-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 411px;
    margin: 0 auto;
    padding: 0 !important;
    border: none !important; /* Aseguramos que no haya bordes */
}

/* Efecto Hover Nano Banana (Resplandor Rosa) */
.evento-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(206, 70, 108, 0.5), 
                0 0 0 2px rgba(235, 122, 154, 0.3); /* Sombra rosa Devir + borde luminoso */
}

/* Asegurar que el hover tenga prioridad sobre otros estilos */
.eventos-grid .evento-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 40px rgba(206, 70, 108, 0.5), 
                0 0 0 2px rgba(235, 122, 154, 0.3) !important;
}

/* 1. Header Image */
.card-image-header {
    height: 160px;
    background-color: #1F2548;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
}

.card-image-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 25px;
    background-color: #16224a;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 60' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 V60 H1200 V0 C1150,15 1100,5 1050,10 C1000,15 950,5 900,10 C850,15 800,5 750,10 C700,15 650,5 600,10 C550,15 500,5 450,10 C400,15 350,5 300,10 C250,15 200,5 150,10 C100,15 50,5 0,0' fill='black'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 60' preserveAspectRatio='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,0 V60 H1200 V0 C1150,15 1100,5 1050,10 C1000,15 950,5 900,10 C850,15 800,5 750,10 C700,15 650,5 600,10 C550,15 500,5 450,10 C400,15 350,5 300,10 C250,15 200,5 150,10 C100,15 50,5 0,0' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    z-index: 1;
}

/* 2. Title Bar (Controlado - Una línea con ellipsis) */
.card-title-bar {
    background-color: #16224a;
    color: white;
    text-align: center;
    padding: 0.8rem 1.2rem; /* Más padding horizontal para mejor espaciado */
    font-weight: 700;
    font-size: 1.15rem;
    font-family: 'Graphik', sans-serif;
    min-height: 3.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    cursor: help; /* Indicar que hay tooltip */
    position: relative;
}

/* El texto dentro del title bar debe tener ellipsis */
.card-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: inline-block;
    width: 100%;
}

/* 3. Country Bar */
.card-country-bar {
    background-color: #d1d5db;
    color: #16224a;
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* 4. Body Info */
.card-body {
    padding: 1.2rem;
    background: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.3;
}

.card-info-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.card-info-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* Truncar dirección si es muy larga */
}

/* Barra de Progreso Rosa (UX de Nano) */
.card-slots-wrapper {
    margin-top: 0.8rem;
}

.slots-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: #666;
    font-weight: 600;
}

.slots-progress-container {
    background-color: #f0f0f0;
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.slots-progress-bar {
    background: linear-gradient(90deg, #eb7a9a 0%, #ce466c 100%);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Countdown Elaborado (Inspirado en CodePen, adaptado a Devir) */
.card-countdown-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.8rem 0; /* Espacio simétrico arriba y abajo */
    padding: 0.8rem 0; /* Padding simétrico */
    border-top: 1px dashed #eee;
    border-bottom: 1px dashed #eee;
    min-height: 60px;
}

.js-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #16224a;
    font-weight: 600;
    opacity: 1; /* Siempre visible */
}

/* Contenedor de unidades de tiempo */
.countdown-container {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eb7a9a 0%, #ce466c 100%);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    width: 55px; /* Ancho fijo para todas las unidades */
    box-shadow: 0 2px 8px rgba(206, 70, 108, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.evento-card:hover .countdown-unit {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(206, 70, 108, 0.4);
}

.countdown-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.countdown-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
    text-align: center;
}

.countdown-separator {
    color: #ce466c;
    font-weight: 700;
    font-size: 1rem;
    opacity: 0.6;
}

/* Texto simple para eventos ya empezados */
.js-countdown-simple {
    font-size: 0.8rem;
    color: #ce466c;
    font-weight: 700;
    text-align: center;
}

/* 5. Tags Strip */
.card-tags-strip {
    background-color: #f5f5f5;
    padding: 0.6rem;
    display: flex;
    justify-content: center;
}

.tag-pill {
    background-color: #ffffff;
    color: #ce466c;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 10px; /* Un pelín más pequeño para compensar las mayúsculas */
    font-weight: 700;
    margin: 0 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 6. Footer (Buttons) */
.card-footer {
    background-color: #16224a;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.btn-card {
    position: relative;
    text-align: center;
    padding: 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px; /* Ajustado para mayúsculas */
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    color: #ffffff;
    overflow: hidden; /* Necesario para el efecto de borde */
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Efecto de borde animado (Neon Border Run) */
.btn-card span {
    position: absolute;
    display: block;
    z-index: 0;
}

/* El texto de los botones debe estar sobre los spans */
.btn-card {
    z-index: 1;
}

/* Superior */
.btn-card span:nth-child(1) {
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
}

.btn-card:hover span:nth-child(1) {
    left: 100%;
    transition: 0.7s;
}

/* Derecho */
.btn-card span:nth-child(2) {
    top: -100%;
    right: 0;
    width: 2px;
    height: 100%;
}

.btn-card:hover span:nth-child(2) {
    top: 100%;
    transition: 0.7s;
    transition-delay: 0.15s;
}

/* Inferior */
.btn-card span:nth-child(3) {
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
}

.btn-card:hover span:nth-child(3) {
    right: 100%;
    transition: 0.7s;
    transition-delay: 0.3s;
}

/* Izquierdo */
.btn-card span:nth-child(4) {
    bottom: -100%;
    left: 0;
    width: 2px;
    height: 100%;
}

.btn-card:hover span:nth-child(4) {
    bottom: 100%;
    transition: 0.7s;
    transition-delay: 0.45s;
}

/* Colores específicos para los bordes */
.btn-view-more span {
    background: linear-gradient(90deg, transparent, #2196f3);
}
.btn-view-more:hover span {
    background: #2196f3;
    box-shadow: 0 0 5px #2196f3, 0 0 15px #2196f3;
}

.btn-register span {
    background: linear-gradient(90deg, transparent, #ffffff); /* Usamos blanco para el recorrido inicial para que resalte más */
}
.btn-register:hover span {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 20px #eb7a9a; /* Brillo blanco central con halo rosa intenso */
}

.btn-view-more {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-register {
    background: linear-gradient(180deg, #eb7a9a 0%, #ce466c 100%);
}

.btn-card:hover {
    filter: brightness(1.2);
    transform: scale(1.05); /* Un poco más de zoom para que se note el efecto */
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .evento-card { max-width: 320px; }
    .card-title-bar { font-size: 1rem; }
}
