/**
 * ESTILOS FRONTEND - SISTEMA DE RIFAS
 * Destino Premio
 */

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.rifa-numeros-container {
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 30px 0;
}

.rifa-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.rifa-header h3 {
    margin: 0 0 15px 0;
    color: #2271b1;
    font-size: 28px;
    font-weight: 700;
}

.rifa-precio {
    font-size: 20px;
    color: #555;
    margin: 10px 0;
}

.rifa-precio strong {
    color: #46b450;
    font-size: 24px;
}

/* ============================================
   LEYENDA
   ============================================ */
.rifa-leyenda {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.rifa-leyenda span {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rifa-leyenda .disponible {
    color: #46b450;
}

.rifa-leyenda .disponible::before {
    content: "✓";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #46b450;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
}

.rifa-leyenda .vendido {
    color: #dc3232;
}

.rifa-leyenda .vendido::before {
    content: "✗";
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #dc3232;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
}

/* ============================================
   GRID DE NÚMEROS
   ============================================ */
.rifa-numeros-grid {
    display: grid;
    gap: 12px;
    margin: 30px 0;
}

.numero-item {
    background: white;
    padding: 20px 10px;
    text-align: center;
    border-radius: 10px;
    border: 3px solid #ddd;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Números Disponibles */
.numero-item.disponible {
    border-color: #46b450;
    cursor: pointer;
    background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

.numero-item.disponible:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(70, 180, 80, 0.3);
    border-color: #2d7d3a;
}

.numero-item.disponible .numero {
    color: #46b450;
}

/* Números Vendidos */
.numero-item.vendido {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-color: #dc3232;
    opacity: 0.7;
    cursor: not-allowed;
}

.numero-item.vendido .numero {
    color: #dc3232;
    text-decoration: line-through;
    opacity: 0.6;
}

/* Número */
.numero-item .numero {
    font-size: 24px;
    font-weight: 900;
    display: block;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Botón Agregar al Carrito */
.numero-item .agregar-carrito {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #2271b1 0%, #1a5a8a 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.4);
    transition: all 0.3s;
    z-index: 10;
}

.numero-item.disponible:hover .numero {
    opacity: 0.2;
    transform: scale(0.9);
}

.numero-item.disponible:hover .agregar-carrito {
    display: block;
    animation: bounceIn 0.3s;
}

.numero-item .agregar-carrito:hover {
    background: linear-gradient(135deg, #1a5a8a 0%, #0f3d5c 100%);
    transform: translate(-50%, -50%) scale(1.1);
}

.numero-item .agregar-carrito:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* ============================================
   ESTADÍSTICAS WIDGET
   ============================================ */
.rifa-estadisticas-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    margin: 30px 0;
}

.rifa-estadisticas-widget h3 {
    margin: 0 0 30px 0;
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 25px 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.stat-item:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-5px);
}

.stat-numero {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Barra de Progreso */
.progreso-bar {
    background: rgba(255,255,255,0.2);
    height: 50px;
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    margin: 25px 0;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, #46b450, #00d084);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(70, 180, 80, 0.5);
}

.progreso-texto {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
    font-size: 18px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sorteo-info {
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.estado-rifa {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.estado-rifa.estado-activa {
    background: rgba(70, 180, 80, 0.4);
    box-shadow: 0 0 20px rgba(70, 180, 80, 0.3);
}

.estado-rifa.estado-cerrada {
    background: rgba(220, 50, 50, 0.4);
    box-shadow: 0 0 20px rgba(220, 50, 50, 0.3);
}

.estado-rifa.estado-finalizada {
    background: rgba(0, 160, 210, 0.4);
    box-shadow: 0 0 20px rgba(0, 160, 210, 0.3);
}

/* ============================================
   LISTADO DE RIFAS ACTIVAS
   ============================================ */
.rifas-activas-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.rifa-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rifa-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.rifa-imagen {
    height: 220px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
}

.rifa-imagen::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.rifa-contenido {
    padding: 25px;
}

.rifa-contenido h4 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #2271b1;
    font-weight: 700;
}

.rifa-detalles p {
    margin: 10px 0;
    font-size: 15px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rifa-progreso-mini {
    height: 10px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progreso-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #46b450, #00d084);
    transition: width 1s ease;
}

.btn-ver-rifa {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, #2271b1 0%, #1a5a8a 100%);
    color: white !important;
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(34, 113, 177, 0.3);
}

.btn-ver-rifa:hover {
    background: linear-gradient(135deg, #1a5a8a 0%, #0f3d5c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.4);
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .rifa-numeros-container {
        padding: 20px;
    }
    
    .rifa-header h3 {
        font-size: 22px;
    }
    
    .rifa-precio {
        font-size: 16px;
    }
    
    .rifa-precio strong {
        font-size: 20px;
    }
    
    .rifa-leyenda {
        flex-direction: column;
        gap: 15px;
    }
    
    .rifa-numeros-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px;
    }
    
    .numero-item {
        padding: 15px 5px;
        min-height: 60px;
    }
    
    .numero-item .numero {
        font-size: 18px;
    }
    
    .numero-item .agregar-carrito {
        padding: 8px 15px;
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .rifas-activas-lista {
        grid-template-columns: 1fr;
    }
    
    .rifa-estadisticas-widget {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .rifa-numeros-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .numero-item .numero {
        font-size: 16px;
    }
}

/* ============================================
   MENSAJES Y ALERTAS
   ============================================ */
.rifa-cerrada {
    background: #dc3232;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0;
}

.rifa-loading {
    text-align: center;
    padding: 40px;
}

.rifa-loading::after {
    content: '⏳';
    font-size: 40px;
    animation: pulse 1s infinite;
}

