/* =================================
   UN DÍA COMO HOY - CSS INTEGRADO CON TEMA EXISTENTE
   ================================= */

/* Variables CSS para consistencia con el tema principal */
:root {
    --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 30%, #6366f1 70%, #8b5cf6 100%);
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --card-shadow: 0 10px 25px rgba(0, 0, 0, 0.15), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
}


/* =================================
   MEJORAS PARA PANEL DE CONFIGURACIÓN
   ================================= */

/* Contenedor principal de configuración */
.analysis-config {
    max-width: 1200px; /* Mismo ancho que numbers-grid */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* Mismo padding que numbers-grid */
}

.config-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e5e7eb;
    width: 100%; /* Ocupar todo el ancho disponible */
}

/* Hacer que el contenido ocupe todo el ancho */
.config-content {
    width: 100%;
}

.config-content .max-w-4xl {
    max-width: 100% !important; /* Remover limitación de ancho */
}

/* Mejorar la sección de información azul */
.bg-blue-50 {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.bg-blue-50 .text-blue-800 {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Mejorar la sección verde de configuración */
.bg-green-50 {
    padding: 24px;
    border-radius: 12px;
    width: 100%;
}

.bg-green-50 .text-green-800 {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Hacer que la configuración use un grid más organizado */
.bg-green-50 .space-y-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.bg-green-50 .space-y-2 p {
    margin: 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}





/* =================================
   LAYOUT PRINCIPAL
   ================================= */

/* Panel de configuración */
.analysis-config {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e5e7eb;
}

/* 🆕 FORZAR COLOR NEGRO PARA TÍTULOS EN CONFIG CARD */
.config-card h2 {
    color: #1f2937 !important;
    text-shadow: none !important;
}

.config-toggle {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.config-toggle:hover {
    background: #e5e7eb;
    color: #374151;
    transform: scale(1.1);
}

.config-content {
    transition: all 0.3s ease;
}

.config-item {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.config-item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
}

.config-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    display: block;
    margin-bottom: 8px;
}

.config-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.config-description {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* =================================
   ESTADÍSTICAS GENERALES
   ================================= */

.stats-overview {
    padding: 32px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    width: 80%;
    margin: 0;
    display: flex;
    justify-content: center;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

/* =================================
   ANÁLISIS POR DÍAS
   ================================= */

.day-analysis {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.day-analysis .day-header,
.day-analysis .bg-amber-50,
.day-analysis .numbers-grid {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.day-header {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.day-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.prediction-header::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.results-header::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.day-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937 !important; /* 🆕 NEGRO FORZADO para contraste */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    text-shadow: none !important; /* 🆕 ELIMINAR sombra que pueda interferir */
}

.day-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

.day-stats {
    display: flex;
    gap: 24px;
    align-items: center;
}

.day-stat {
    text-align: center;
    padding: 12px 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.day-stat.success {
    background: #ecfdf5;
    border-color: #10b981;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.day-stat.success .stat-number {
    color: #059669;
}

.stat-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =================================
   CARDS DE NÚMEROS
   ================================= */

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Reducido de 350px a 280px */
    gap: 16px; /* Reducido de 20px a 16px */
    margin-bottom: 32px;
    max-width: 1200px; /* 🆕 NUEVO: Limitar ancho máximo */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* 🆕 NUEVO: Margen lateral */
}

/* Para tablets */
@media (max-width: 1024px) {
    .numbers-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablets */
    }
}

/* Para móviles */
@media (max-width: 768px) {
    .numbers-grid {
        grid-template-columns: 1fr; /* 1 columna en móvil */
    }
}

.number-card {
    background: white;
    border-radius: 12px;
    padding: 16px; /* Reducido de 20px a 16px */
    box-shadow: var(--card-shadow);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    max-width: 320px; /* 🆕 NUEVO: Ancho máximo por card */
}

.number-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

/* Estados de las cards */
.prediction-card {
    border-left: 4px solid #f59e0b;
}

.result-card.winner {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.result-card.loser {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.number-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.number-ball {
    width: 50px; /* Reducido de 60px a 50px */
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* Reducido de 1.5rem */
    font-weight: 700;
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.number-ball.winner {
    background: var(--success-gradient);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.number-ball.loser {
    background: var(--danger-gradient);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.number-ball.small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
}

.number-ball::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(255, 255, 255, 0.1) 45deg, transparent 90deg);
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Frequency badges */
.frequency-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.high-frequency {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.medium-frequency {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.low-frequency {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Detalles del número */
.number-details {
    flex: 1;
}

.number-title {
    font-size: 1.1rem; /* Reducido de 1.25rem */
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px; /* Reducido de 12px */
}

.historical-info {
    margin-bottom: 16px;
}

.historical-count {
    font-size: 0.8rem; /* Reducido de 0.875rem */
    color: #6b7280;
    margin-bottom: 10px; /* Reducido de 12px */
    font-weight: 500;
}

.lotteries-list {
    /* ✅ CSS VÁLIDO para espaciado entre elementos */
}

.lotteries-list .lottery-item:not(:last-child) {
    margin-bottom: 8px;
}

.lottery-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0; /* Reducido de 8px a 6px */
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.8rem;
}

.lottery-item:last-child {
    border-bottom: none;
}

.lottery-name {
    font-weight: 700; /* 🆕 CAMBIO: de 600 a 700 (más negrita) */
    color: #1f2937; /* 🆕 CAMBIO: color más oscuro */
    flex: 1;
}

.position-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.position-1 {
    background: #fef3c7;
    color: #d97706;
}

.position-2 {
    background: #e0e7ff;
    color: #4338ca;
}

.position-3 {
    background: #ecfdf5;
    color: #059669;
}

.date {
    font-size: 0.7rem;
    color: #374151; /* 🆕 CAMBIO: de #9ca3af a #374151 (más oscuro) */
    font-family: 'Courier New', monospace;
    font-weight: 600; /* 🆕 NUEVO: negrita para fechas */
}

/* Estados de resultado */
.result-status {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.result-status.success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.result-status.multi-winner {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 2px solid #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.result-status.failed {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.result-status.pending {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* =================================
   INDICADOR DE MÁS NÚMEROS
   ================================= */

.more-numbers-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.more-numbers-indicator:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    transform: scale(1.02);
}

.more-numbers-content {
    text-align: center;
}

.more-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 8px;
}

.more-text {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 16px;
}

.show-all-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.show-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* =================================
   RESUMEN Y TOP NÚMEROS
   ================================= */

.summary-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid #e5e7eb;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid #e5e7eb;
    height: fit-content;
}

.summary-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f3f4f6;
}

.summary-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937 !important; /* 🆕 NEGRO FORZADO para contraste */
    display: flex;
    align-items: center;
    text-shadow: none !important; /* 🆕 ELIMINAR sombra que pueda interferir */
}

/* Top números */
.top-numbers-list {
    space-y: 12px;
}

.top-number-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.top-number-item:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.rank {
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.number-info {
    flex: 1;
}

.number-name {
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
}

.success-count {
    font-size: 0.75rem;
    color: #6b7280;
}

.success-rate {
    font-weight: 700;
    color: #059669;
    font-size: 1.25rem;
}

/* Estadísticas detalladas */
.detailed-stats {
    space-y: 16px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.stat-label {
    color: #6b7280;
    font-weight: 500;
}

.stat-value-large {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-value-large.success {
    color: #059669;
}

.stat-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

@media (max-width: 768px) {
    .numbers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .day-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .day-stats {
        flex-direction: row;
        justify-content: center;
    }
    
    .config-content {
        display: block !important;
    }
    
    .lottery-item {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .number-ball {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .day-title h2 {
        font-size: 1.25rem;
    }
    
    .number-card {
        padding: 16px;
    }
    
    .more-count {
        font-size: 2rem;
    }
    
    .config-card {
        padding: 16px;
    }
}

/* =================================
   ANIMACIONES Y EFECTOS ESPECIALES
   ================================= */

/* Animación de entrada */
.number-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.number-card:nth-child(1) { animation-delay: 0.1s; }
.number-card:nth-child(2) { animation-delay: 0.2s; }
.number-card:nth-child(3) { animation-delay: 0.3s; }
.number-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Efecto de pulso para números ganadores */
.result-card.winner .number-ball {
    animation: pulse-winner 2s infinite;
}

@keyframes pulse-winner {
    0% {
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
        transform: scale(1);
    }
}

/* Efectos de glassmorphism */
.analysis-config::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Estados especiales para predicciones */
.prediction-card .number-ball {
    position: relative;
    overflow: hidden;
}

.prediction-card .number-ball::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}