/* 
 * estadisticas.css — Dedicated styles for the Centralized Statistics Dashboard
 * Fully isolated to prevent styling conflicts on other pages
 */
/* ── Container and Categories Tabs ──────────────────────────────── */
.stats-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.stats-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}
.stats-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.stats-tab-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 1.25rem;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}
.stats-tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.stats-tab-btn:hover:not(.active) {
    color: var(--text-dark);
}
/* ── Statistics Grid & Cards ────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 5rem;
}
.stats-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-floating);
    border-color: rgba(16, 185, 129, 0.25);
}
/* Category Specific Border Glows on Hover */
.stats-card[data-cat="animalitos"]:hover { border-color: rgba(16, 185, 129, 0.35); }
.stats-card[data-cat="loterias"]:hover { border-color: rgba(59, 130, 246, 0.35); }
.stats-card[data-cat="terminales"]:hover { border-color: rgba(139, 92, 246, 0.35); }
.stats-card[data-cat="lotos"]:hover { border-color: rgba(245, 158, 11, 0.35); }
/* Card Header */
.stats-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1.25rem;
}
.stats-card-logo {
    height: 52px;
    width: 52px;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    padding: 0.25rem;
}
.stats-card-title-group {
    flex-grow: 1;
    min-width: 0;
}
.stats-card-title {
    font-size: 1.15rem;
    font-weight: 850;
    color: var(--text-dark);
    margin: 0 0 0.2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stats-card-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stats-card-badge.cat-animalitos { background: #ecfdf5; color: #10b981; border: 1px solid #d1fae5; }
.stats-card-badge.cat-loterias { background: #eff6ff; color: #3b82f6; border: 1px solid #dbeafe; }
.stats-card-badge.cat-terminales { background: #f5f3ff; color: #8b5cf6; border: 1px solid #ede9fe; }
.stats-card-badge.cat-lotos { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
/* Metrics Panels */
.stats-metrics-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-metric-box {
    background: #f8fafc;
    border-radius: 14px;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid #f1f5f9;
}
.stats-metric-box.hot {
    background: #fffbeb;
    border-color: #fef3c7;
}
.stats-metric-box.cold {
    background: #f0fdfa;
    border-color: #ccfbf1;
}
.stats-metric-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}
.stats-metric-box.hot .stats-metric-label { color: #b45309; }
.stats-metric-box.cold .stats-metric-label { color: #0f766e; }
.stats-pills-row {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.stats-pill {
    font-size: 0.85rem;
    font-weight: 900;
    padding: 0.25rem 0.55rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.stats-metric-box.hot .stats-pill {
    border-color: #fde047;
    color: #92400e;
}
.stats-metric-box.cold .stats-pill {
    border-color: #99f6e4;
    color: #115e59;
}
/* Insight Box */
.stats-insight-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--primary);
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.5;
    flex-grow: 1;
}
.stats-card[data-cat="loterias"] .stats-insight-box { border-left-color: #3b82f6; }
.stats-card[data-cat="terminales"] .stats-insight-box { border-left-color: #8b5cf6; }
.stats-card[data-cat="lotos"] .stats-insight-box { border-left-color: #f59e0b; }
/* Action Button */
.stats-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.stats-card:hover .stats-card-btn {
    background: var(--primary);
    color: #ffffff;
}
.stats-card[data-cat="loterias"]:hover .stats-card-btn { background: #3b82f6; }
.stats-card[data-cat="terminales"]:hover .stats-card-btn { background: #8b5cf6; }
.stats-card[data-cat="lotos"]:hover .stats-card-btn { background: #f59e0b; }
.stats-card-btn svg {
    transition: transform 0.2s ease;
}
.stats-card-btn:hover svg {
    transform: translateX(3px);
}
/* Empty State */
.stats-empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: #ffffff;
    border-radius: 20px;
    border: 2px dashed #e2e8f0;
    grid-column: 1 / -1;
}
/* ── Responsive breakpoints ─────────────────────────────────────── */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}
@media (max-width: 768px) {
    .stats-header-row {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .stats-title {
        justify-content: center;
        font-size: 1.5rem;
    }
    
    .stats-tabs {
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        margin-bottom: 3.5rem;
    }
    
    .stats-card {
        padding: 1.5rem;
    }
}
