/*
 * ESTILOS UNIFICADOS PARA TODAS LAS TABLAS
 * 
 * Todas las tablas ahora tienen:
 * - Misma fuente: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
 * - Mismo tamaño: 16px
 * - Mismos scrollbars: altura 12px, color #666666 (gris oscuro), fondo #f0f0f0
 * - Mismo line-height: 1.4
 * - Mismos bordes: 1px solid #000000 (negro) para todas las celdas
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Fallback para Font Awesome - evitar advertencias */
.fas, .fa {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', 'Font Awesome 4.7.0', 'FontAwesome', sans-serif;
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.loading {
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 1.2rem;
}

.spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.error {
    background: #ff6b6b;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

/* Solo la tabla principal de datos tiene fondo blanco */
#data-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Contenedor de la tabla con scroll */
.table-wrapper {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow-x: auto;
    overflow-y: auto;
    margin: 0 auto 20px auto;
    min-width: 100%;
    max-width: 100%;
    max-height: 70vh;
}

/* Scrollbars del contenedor */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
    width: 8px;
    background: #f0f0f0;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
    min-height: 20px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

/* Firefox scrollbar */
.table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
}

/* Media query para baja resolución - contenedor adaptativo */
@media (max-width: 1200px) {
    .table-wrapper {
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 20px auto;
        overflow-x: auto;
    }
    
    /* Tablas de análisis con scroll horizontal y centradas */
    #analysis-container .table-container {
        min-width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    #analysis-container table {
        min-width: 200px;
        width: 100%;
    }
    
    /* Asegurar anchos mínimos para columnas críticas en baja resolución */
    #data-container .data-table th:first-child,
    #data-container .data-table td:first-child {
        min-width: 80px !important;
        width: 80px !important;
    }
    
    #data-container .data-table th:nth-child(3),
    #data-container .data-table td:nth-child(3) {
        min-width: 70px !important;
        width: 70px !important;
    }
    
    /* Anchos para columnas de procesador, gráfica y torre en baja resolución */
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        min-width: 350px !important;
        width: 350px !important;
    }
    
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        min-width: 350px !important;
        width: 350px !important;
    }
    
    #data-container .data-table th:nth-child(6),
    #data-container .data-table td:nth-child(6) {
        min-width: 350px !important;
        width: 350px !important;
    }
}

@media (max-width: 768px) {
    .table-wrapper {
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto 20px auto;
        overflow-x: auto;
    }
    
    /* Tablas de análisis con scroll horizontal y centradas */
    #analysis-container .table-container {
        min-width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    #analysis-container table {
        min-width: 200px;
        width: 100%;
    }
    
    /* Forzar anchos mínimos en móvil para columnas críticas */
    #data-container .data-table th:first-child,
    #data-container .data-table td:first-child {
        min-width: 80px !important;
        width: 80px !important;
        max-width: 80px !important;
    }
    
    #data-container .data-table th:nth-child(3),
    #data-container .data-table td:nth-child(3) {
        min-width: 70px !important;
        width: 70px !important;
        max-width: 70px !important;
    }
    
    /* Anchos para columnas de procesador, gráfica y torre en móvil */
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        min-width: 350px !important;
        width: 350px !important;
        max-width: 350px !important;
    }
    
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        min-width: 350px !important;
        width: 350px !important;
        max-width: 350px !important;
    }
    
    #data-container .data-table th:nth-child(6),
    #data-container .data-table td:nth-child(6) {
        min-width: 350px !important;
        width: 350px !important;
        max-width: 350px !important;
    }
    
    /* Reducir padding en móvil para ahorrar espacio */
    #data-container .data-table th,
    #data-container .data-table td {
        padding: 6px 4px !important;
    }
}

#data-container .data-table {
    background: white;
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 auto 20px auto;
    min-width: 100%;
    max-width: 100%;
}

/* Solo la tabla principal tiene scroll y sticky header */
#data-container .data-table {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: scroll;
}

/* Sticky header para la tabla principal */
#data-container .data-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #667eea;
    color: white;
    font-weight: 600;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    height: auto;
    min-height: 44px;
}

/* Los estilos de scrollbar están unificados arriba para todas las tablas */

/* Scroll horizontal inteligente para la tabla principal */
#data-container .data-table {
    overflow-x: auto;
    overflow-y: visible;
}

/* Ocultar scrollbar horizontal por defecto */
#data-container .data-table::-webkit-scrollbar:horizontal {
    height: 0;
    background: transparent;
}

/* En Firefox, scrollbar fino por defecto */
#data-container .data-table {
    scrollbar-width: thin;
}

/* Asegurar que la tabla tenga ancho mínimo para forzar scroll */
#data-container table {
    min-width: 400px; /* Reducido para permitir anchos personalizados */
}

/* FORZAR ANCHOS DE COLUMNAS EN MÓVIL - REGLAS CON MÁXIMA PRIORIDAD */
@media (max-width: 768px) {
    #data-container .data-table {
        min-width: 800px !important; /* Forzar ancho mínimo para que las columnas se respeten */
    }
    
    /* Forzar anchos específicos para cada columna */
    #data-container .data-table th:nth-child(1),
    #data-container .data-table td:nth-child(1) {
        min-width: 80px !important;
        width: 80px !important;
        max-width: 80px !important;
    }
    
    #data-container .data-table th:nth-child(2),
    #data-container .data-table td:nth-child(2) {
        min-width: 200px !important;
        width: 200px !important;
        max-width: 200px !important;
    }
    
    #data-container .data-table th:nth-child(3),
    #data-container .data-table td:nth-child(3) {
        min-width: 70px !important;
        width: 70px !important;
        max-width: 70px !important;
    }
    
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        min-width: 250px !important;
        width: 250px !important;
        max-width: 250px !important;
    }
    
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        min-width: 250px !important;
        width: 250px !important;
        max-width: 250px !important;
    }
    
    #data-container .data-table th:nth-child(6),
    #data-container .data-table td:nth-child(6) {
        min-width: 250px !important;
        width: 250px !important;
        max-width: 250px !important;
    }
}

/* Estilos responsivos para la tabla principal */
#data-container .data-table {
    table-layout: fixed;
}

/* Asegurar anchos mínimos para columnas críticas en todas las resoluciones */
#data-container .data-table th:first-child,
#data-container .data-table td:first-child {
    min-width: 80px !important;
}

#data-container .data-table th:nth-child(3),
#data-container .data-table td:nth-child(3) {
    min-width: 70px !important;
}

/* Anchos para columnas de procesador, gráfica y torre - FORZADOS */
#data-container .data-table th:nth-child(4),
#data-container .data-table td:nth-child(4) {
    min-width: 350px !important;
    width: 350px !important;
    max-width: 350px !important;
}

#data-container .data-table th:nth-child(5),
#data-container .data-table td:nth-child(5) {
    min-width: 350px !important;
    width: 350px !important;
    max-width: 350px !important;
}

#data-container .data-table th:nth-child(6),
#data-container .data-table td:nth-child(6) {
    min-width: 350px !important;
    width: 350px !important;
    max-width: 350px !important;
}

/* Scroll horizontal inteligente - solo aparece cuando es necesario */

/* Estilos específicos para las tablas del análisis */
#analysis-container table {
    width: 100%;
    min-width: 450px;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    color: black;
    table-layout: fixed;
    margin: 0 !important;
    padding: 0 !important;
}

/* Reset básico para las tablas de análisis */
#analysis-container th, #analysis-container td {
    padding: 8px !important;
    text-align: center !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Forzar centrado de los títulos de las secciones */
#analysis-container .section-title {
    text-align: center !important;
}

/* Forzar centrado de TODOS los títulos de secciones - más específico */
.processor-section .section-title,
.graphics-section .section-title,
.tower-section .section-title {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}

#analysis-container th {
    background-color: transparent !important;
    color: black !important;
    font-weight: 600;
    text-align: center !important;
}

/* Estilos específicos para las columnas de las tablas de análisis - FORZADOS */
/* Primera columna más estrecha para tablas más compactas */
#analysis-container table th:first-child,
#analysis-container table td:first-child {
    width: 100px !important;
    max-width: 100px !important;
    min-width: 100px !important;
    text-align: left !important;
}

/* Forzar centrado de TODOS los headers de las tablas de análisis */
#analysis-container table th {
    text-align: center !important;
}

/* Forzar centrado de manera más agresiva - sobrescribir TODO */
#analysis-container table th,
#analysis-container .analysis-header,
#analysis-container .analysis-header-name,
#analysis-container .analysis-header-count,
#analysis-container .analysis-header-percent {
    text-align: center !important;
}

#analysis-container table th:nth-child(2),
#analysis-container table td:nth-child(2) {
    width: 30px !important;
    max-width: 30px !important;
    min-width: 30px !important;
    text-align: center !important;
}

#analysis-container table th:nth-child(3),
#analysis-container table td:nth-child(3) {
    width: 30px !important;
    max-width: 30px !important;
    min-width: 30px !important;
    text-align: center !important;
}

/* Los estilos están unificados arriba */

#analysis-container table th {
    background-color: #667eea !important;
    color: white !important;
    font-weight: bold !important;
    padding: 8px !important;
    text-align: center !important;
}

#analysis-container table td {
    padding: 8px !important;
}

/* Los estilos de scrollbar están unificados arriba para todas las tablas */

/* Scroll horizontal para las tablas de análisis */
#analysis-container .table-container {
    overflow-x: auto !important;
    overflow-y: visible !important;
    /* Los estilos de scrollbar están unificados arriba para todas las tablas */
}

/* Eliminar regla Firefox específica - box-shadow funciona en todos los navegadores */

/* Sin filas alternadas - enfoque minimalista */

/* Estilos duplicados eliminados */

/* Título de la tabla principal */
#data-container .data-table h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

/* Estilos SOLO para la tabla principal de datos - CENTRADA Y CON SCROLL */
#data-container .data-table {
    width: 100%;
    min-width: 400px; /* Reducido para permitir anchos personalizados */
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed; /* Cambiado a fixed para respetar anchos personalizados */
}

#data-container .data-table td {
    padding: 8px 8px;
    text-align: left;
    word-wrap: break-word;
    white-space: normal; /* Cambiado de nowrap a normal para permitir envolver texto */
}

/* Centrar todos los títulos de la tabla principal */
#data-container .data-table th {
    text-align: center !important;
    border-bottom: none !important;
}

/* Hacer que las columnas se adapten al contenido - SOLO para la tabla principal de datos */
/* Comentado para usar estilos inline */
/* #data-container .data-table th:nth-child(1), #data-container .data-table td:nth-child(1) { width: 203px !important; min-width: 203px !important; text-align: center; } /* Fecha - se adapta al contenido */
/* #data-container .data-table th:nth-child(2), #data-container .data-table td:nth-child(2) { width: 200px !important; min-width: 200px !important; } /* Título del directo - se expande */
/* #data-container .data-table th:nth-child(3), #data-container .data-table td:nth-child(3) { width: 200px !important; min-width: 200px !important; text-align: center; } /* Precio - se adapta al contenido */
/* Comentado para usar estilos inline */
/* #data-container .data-table th:nth-child(4), #data-container .data-table td:nth-child(4) { width: 200px !important; min-width: 200px !important; } /* Procesador - se adapta al contenido */
/* #data-container .data-table th:nth-child(5), #data-container .data-table td:nth-child(5) { width: 200px !important; min-width: 200px !important; } /* Tarjeta gráfica - se adapta al contenido */
/* #data-container .data-table th:nth-child(6), #data-container .data-table td:nth-child(6) { width: 200px !important; min-width: 200px !important; } /* Torre - se adapta al contenido */

#data-container .data-table th:last-child, #data-container .data-table td:last-child {
    /* border-right: none; */ /* Comentado para usar estilos inline */
}

#data-container .data-table tbody tr {
    background: white !important;
}

#data-container .data-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1) !important;
}



/* Clases para elementos específicos */
.hidden {
    display: none;
}

.stats-button-container {
    margin-top: 20px;
    text-align: center;
}

.go-to-analysis-btn {
    background: #27ae60 !important;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 auto 30px auto;
    display: block;
    transition: background 0.3s ease;
}

.go-to-analysis-btn:hover {
    background: #229954 !important;
}

.back-button-container {
    text-align: center;
    margin-bottom: 20px;
}

.back-to-data-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 15px auto;
    display: block;
    transition: background 0.3s ease;
}

.back-to-data-btn:hover {
    background: #218838;
}

.analysis-title {
    color: #e1ff02;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 50px;
}



.stats-info {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.stats-info h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 150px) !important;
    gap: 20px !important;
    margin-top: 20px !important;
    justify-content: center !important;
}

.stat-card {
    background: #e9ecef;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    max-width: 150px !important;
    width: 150px !important;
}

/* A baja resolución, hacer las tarjetas más estrechas */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 120px) !important;
        justify-content: center !important;
    }
    .stat-card {
        width: 120px !important;
        max-width: 120px !important;
    }
}

/* Fondo más oscuro solo para "Montajes" */
.stat-card:first-child {
    background: #d1d3d4;
}

.stat-card .number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card .label {
    color: #666;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Header de fecha con navegación */
.date-header-with-nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 203px;
    width: 100%;
    box-sizing: border-box;
    padding-right: 10px;
}

.nav-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-text {
    flex: 1;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn-first {
    color: #27ae60;
}

.nav-btn-first:hover {
    background: rgba(39, 174, 96, 0.8);
    color: white;
    transform: scale(1.1);
    border-color: #27ae60;
}

.nav-btn-last {
    color: #e74c3c;
}

.nav-btn-last:hover {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    transform: scale(1.1);
    border-color: #e74c3c;
}

/* Toda la fila del header debe ser sticky */
.data-table thead tr {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #667eea !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table thead th {
    background: #667eea !important;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    white-space: nowrap;
    position: relative;
    box-sizing: border-box;
}

/* Estilos para la tabla principal - ELIMINADA REGLA DUPLICADA */
/* .data-table {
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
} */

/* Columna Fecha (primera columna) */
/* NOTA: Esta regla está duplicada con las reglas ultra específicas más abajo */
/* Se elimina para evitar conflictos */

/* Columna Título (segunda columna) */
.data-table th:nth-child(2) {
    min-width: 600px !important;
    width: 600px !important;
    max-width: 600px !important;
}

/* Columna Precio (tercera columna) */
.data-table th:nth-child(3) {
    min-width: 90px !important;
    width: 90px !important;
    max-width: 90px !important;
}

/* Columna Procesador (cuarta columna) */
.data-table th:nth-child(4) {
    min-width: 100px !important;
    width: 100px !important;
    max-width: 100px !important;
}

/* Columna Tarjeta gráfica (quinta columna) */
.data-table th:nth-child(5) {
    min-width: 100px !important;
    width: 100px !important;
    max-width: 100px !important;
}

/* Columna Torre (última columna) */
.data-table th:nth-child(6) {
    min-width: 100px !important;
    width: 100px !important;
    max-width: 100px !important;
}

/* Los bordes están unificados arriba para todas las tablas */



/* Asegurar que todos los headers tengan anchos equilibrados (sin bordes) */
/* Comentado para eliminar todas las líneas verticales */





/* Estilos para las tablas de análisis */
.analysis-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
}

.analysis-section h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 20px;
}

.analysis-section h3 {
    color: white;
    text-align: center;
    margin-bottom: 15px;
}

/* Contenedor de tabla con scroll horizontal solo cuando sea necesario */
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
}

/* Los estilos de scrollbar están unificados arriba para todas las tablas */

/* Media queries para móvil */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        min-width: 120px;
    }

    #data-container .data-table {
        overflow-x: scroll;
    }

    table {
        min-width: 230px;
    }

    /* Forzar scroll horizontal en las tablas de análisis en móvil */
    .table-container {
        overflow-x: scroll !important;
        -ms-overflow-style: auto !important;
    }
    
    /* Los estilos de scrollbar están unificados arriba para todas las tablas */
}

/* Media query para pantallas muy pequeñas */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Asegurar que las columnas críticas mantengan su ancho mínimo */
    #data-container .data-table th:first-child,
    #data-container .data-table td:first-child {
        min-width: 80px !important;
        width: 80px !important;
        max-width: 80px !important;
    }
    
    #data-container .data-table th:nth-child(3),
    #data-container .data-table td:nth-child(3) {
        min-width: 70px !important;
        width: 70px !important;
        max-width: 70px !important;
    }
    
    /* Anchos para columnas de procesador, gráfica y torre en pantallas muy pequeñas */
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(5) {
        min-width: 350px !important;
        width: 350px !important;
        max-width: 350px !important;
    }
    
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        min-width: 350px !important;
        width: 350px !important;
        max-width: 350px !important;
    }
    
    #data-container .data-table th:nth-child(6),
    #data-container .data-table td:nth-child(6) {
        min-width: 350px !important;
        width: 350px !important;
        max-width: 350px !important;
    }
    
    /* Reducir aún más el padding en pantallas muy pequeñas */
    #data-container .data-table th,
    #data-container .data-table td {
        padding: 4px 2px !important;
        font-size: 0.85rem !important;
    }
    
    /* Ajustar el contenedor de la tabla para pantallas muy pequeñas */
    .table-wrapper {
        min-width: calc(99vw - 10px);
        max-width: calc(99vw - 10px);
    }
}

/* Los estilos de scrollbar están unificados arriba para todas las tablas */

/* Clases para reemplazar estilos inline del HTML */
.stats-title {
    color: #e1ff02;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.processor-section {
    background: #00CED1;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 206, 209, 0.3);
}

.graphics-section {
    background: #FFD700;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.tower-section {
    background: #FF8C00;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.3);
}

.section-title {
    color: black;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-shadow: 0 2px 4px rgba(255,255,255,0.3);
}

.prices-section {
    margin-top: 25px;
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border: 2px solid #667eea;
}

.prices-title {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.prices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.price-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.price-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.price-label {
    color: #666;
    font-size: 1rem;
    font-weight: 500;
}

.price-avg { color: #667eea; }
.price-min { color: #27ae60; }
.price-max { color: #e74c3c; }

.analysis-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border: none;
    border-radius: 0;
    padding: 0;
    background-color: transparent;
    text-align: center;
}

/* Los estilos de scrollbar están unificados arriba para todas las tablas */

.analysis-table {
    width: 200px;
    min-width: 200px;
    border-collapse: collapse;
    color: black;
    font-size: 16px !important;
    white-space: nowrap;
    table-layout: fixed;
}

.analysis-header-name,
.analysis-cell-name {
    width: 150px;
    min-width: 150px;
    text-align: left;
    padding: 8px 12px;
}

.analysis-header-count,
.analysis-cell-count {
    width: 40px;
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
}

.analysis-header-percent,
.analysis-cell-percent {
    width: 40px;
    min-width: 40px;
    text-align: center;
    padding: 8px 12px;
}

/* Estilos específicos para Firefox - usar pseudo-elementos */
@-moz-document url-prefix() {
    .data-table thead th {
        position: relative;
    }
    

}

/* Eliminar estilos conflictivos */

.analysis-header-row {
    background: transparent;
    height: fit-content;
}

.analysis-header {
    padding: 8px 8px;
    text-align: center !important;
    font-weight: 600;
    font-size: 16px !important;
    color: black;
}

.analysis-header:last-child {
    border-right: none;
}

/* Eliminar clases conflictivas */

.analysis-tbody {
    height: fit-content;
    min-height: fit-content;
    background: transparent !important;
}

.analysis-row {
    height: fit-content;
    min-height: fit-content;
    background: transparent !important;
    transition: background-color 0.2s ease;
}

.analysis-row:hover {
    background-color: #f0f8ff !important;
}

.analysis-cell {
    padding: 6px 8px;
    font-weight: bold;
    font-size: 16px !important;
    color: black;
    background: transparent !important;
}

.analysis-cell:last-child {
    border-right: none;
}

/* Eliminar clases conflictivas */

.analysis-summary {
    margin-top: 15px;
    padding: 10px;
    background: transparent;
    border: 0.1px solid black;
    border-radius: 8px;
    text-align: center;
}

.analysis-summary-text {
    font-weight: 600;
    font-size: 16px !important;
    color: black;
}

.analysis-row-even {
    background: transparent;
}

.analysis-row-odd {
    background: transparent;
}

.bottom-button-container {
    margin-top: 25px;
    text-align: center;
}

/* Clases para las celdas de datos de la tabla principal */
.data-cell {
    padding: 8px 8px;
    white-space: normal; /* Cambiado de nowrap a normal para permitir envolver texto */
}

.data-cell-center {
    text-align: center;
}



/* REGLAS ULTRA ESPECÍFICAS para anchos adaptativos - ELIMINADAS */
/* Se reemplazaron con reglas simples y directas arriba */

/* Tabla principal de datos */
.data-table,
#data-container .data-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    font-size: 16px !important;
}

/* Encabezados de la tabla principal */
.data-table th,
#data-container .data-table th {
    background: #667eea !important;
    color: white !important;
    outline: none !important;
    box-sizing: border-box;
    padding: 12px 8px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    height: auto;
    min-height: 44px;
    font-size: 16px !important;
}

/* Celdas de datos */
.data-table td,
#data-container .data-table td {
    font-size: 16px !important;
}

/* REGLAS ADICIONALES para centrado vertical de fechas y precios */
.data-table tbody tr td:nth-child(1),
.data-table tbody tr td:nth-child(3) {
    vertical-align: middle !important;
    text-align: center !important;
}

/* Forzar centrado vertical en todas las resoluciones */
@media (max-width: 1200px) {
    #data-container .data-table tbody tr td:nth-child(1),
    #data-container .data-table tbody tr td:nth-child(3) {
        vertical-align: middle !important;
        text-align: center !important;
    }
}

@media (max-width: 1000px) {
    #data-container .data-table tbody tr td:nth-child(1),
    #data-container .data-table tbody tr td:nth-child(3) {
        vertical-align: middle !important;
        text-align: center !important;
    }
}

@media (max-width: 768px) {
    #data-container .data-table tbody tr td:nth-child(1),
    #data-container .data-table tbody tr td:nth-child(3) {
        vertical-align: middle !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    #data-container .data-table tbody tr td:nth-child(1),
    #data-container .data-table tbody tr td:nth-child(3) {
        vertical-align: middle !important;
        text-align: center !important;
    }
}

@media (max-width: 375px) {
    #data-container .data-table tbody tr td:nth-child(1),
    #data-container .data-table tbody tr td:nth-child(3) {
        vertical-align: middle !important;
        text-align: center !important;
    }
}

/* REGLAS SIMPLIFICADAS para la tabla principal */
.data-table {
    table-layout: fixed !important;
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 16px !important;
}

/* Anchos fijos para todas las columnas - REGLAS ULTRA ESPECÍFICAS */
.data-table th:nth-child(4),
.data-table td:nth-child(4),
#data-container .data-table th:nth-child(4),
#data-container .data-table td:nth-child(4) {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

.data-table th:nth-child(5),
.data-table td:nth-child(5),
#data-container .data-table th:nth-child(5),
#data-container .data-table td:nth-child(5) {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

/* Forzar anchos en todas las resoluciones */
@media (max-width: 1200px) {
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
    
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
}

@media (max-width: 1000px) {
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
    
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
}

@media (max-width: 768px) {
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
    
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
}

@media (max-width: 480px) {
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
    
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
}

@media (max-width: 375px) {
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    #data-container .data-table th:nth-child(4),
    #data-container .data-table td:nth-child(4) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
    
    .data-table th:nth-child(5),
    .data-table td:nth-child(5),
    #data-container .data-table th:nth-child(5),
    #data-container .data-table td:nth-child(5) {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }
}

/* Anchos fijos para todas las columnas */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 600px !important;
    min-width: 600px !important;
    max-width: 600px !important;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}

/* REGLAS ESPECÍFICAS para la columna de fecha - 110px SIEMPRE */
@media (max-width: 1200px) {
    .data-table th:nth-child(1),
    .data-table td:nth-child(1),
    #data-container .data-table th:nth-child(1),
    #data-container .data-table td:nth-child(1) {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
}

@media (max-width: 1000px) {
    .data-table th:nth-child(1),
    .data-table td:nth-child(1),
    #data-container .data-table th:nth-child(1),
    #data-container .data-table td:nth-child(1) {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
}

@media (max-width: 768px) {
    .data-table th:nth-child(1),
    .data-table td:nth-child(1),
    #data-container .data-table th:nth-child(1),
    #data-container .data-table td:nth-child(1) {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
}

@media (max-width: 480px) {
    .data-table th:nth-child(1),
    .data-table td:nth-child(1),
    #data-container .data-table th:nth-child(1),
    #data-container .data-table td:nth-child(1) {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
}

@media (max-width: 375px) {
    .data-table th:nth-child(1),
    .data-table td:nth-child(1),
    #data-container .data-table th:nth-child(1),
    #data-container .data-table td:nth-child(1) {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
        text-align: center !important;
        vertical-align: middle !important;
    }
}

/* Botones de navegación en la columna fecha - DEBAJO del texto */
.date-nav-buttons {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
    pointer-events: none;
}

.date-nav-button {
    background: rgba(255,255,255,0.8);
    border: none;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    padding: 0;
    color: #667eea;
    transition: all 0.2s ease;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: auto;
}

.date-nav-button:hover {
    background-color: #FFD700 !important;
    color: white !important;
    transform: scale(1.1);
}

/* Asegurar que los botones funcionen en todas las resoluciones */
@media (max-width: 768px) {
    .date-nav-button {
        width: 14px;
        height: 14px;
        font-size: 9px;
    }
}

@media (max-width: 480px) {
    .date-nav-button {
        width: 12px;
        height: 12px;
        font-size: 8px;
    }
}

@media (max-width: 375px) {
    .date-nav-button {
        width: 12px;
        height: 12px;
        font-size: 8px;
    }
}

/* Estilos para la tabla de combinaciones más populares */
.combinations-section {
    margin-top: 30px;
    text-align: center;
}

.combinations-title {
    color: #e1ff02;
    margin-bottom: 25px;
    font-size: 1.4rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.combinations-table-wrapper {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow-x: auto;
    margin: 0 auto;
    max-width: 780px;
    width: 780px;
    text-align: center;
    /* Los estilos de scrollbar están unificados arriba para todas las tablas */
}



/* Los estilos de scrollbar están unificados arriba para todas las tablas */



.combinations-table {
    width: 780px !important;
    min-width: 780px !important;
    max-width: 780px !important;
    border-collapse: collapse;
    color: black;
    font-size: 16px !important;
    table-layout: fixed !important;
    flex-shrink: 0;
    display: inline-block;
}

.combinations-table th {
    background-color: #667eea;
    color: white;
    font-weight: bold;
    padding: 12px 8px;
    text-align: center;
}

.combinations-table td {
    padding: 10px 8px;
    text-align: center !important;
    vertical-align: middle !important;
}

/* CENTRAR TODO DE TODAS LAS MANERAS POSIBLES */
.combinations-table td,
.combinations-table th {
    text-align: center !important;
    vertical-align: middle !important;
}

.combinations-table td *,
.combinations-table th * {
    text-align: center !important;
}

/* MARTILLO NUCLEAR DEFINITIVO - CENTRAR TODO */
.combinations-table td,
.combinations-table th,
.combinations-table td *,
.combinations-table th * {
    text-align: center !important;
}

/* CENTRAR CADA COLUMNA ESPECÍFICAMENTE */
.combinations-table td:nth-child(1),
.combinations-table th:nth-child(1) {
    text-align: center !important;
}

.combinations-table td:nth-child(2),
.combinations-table th:nth-child(2) {
    text-align: center !important;
}

.combinations-table td:nth-child(3),
.combinations-table th:nth-child(3) {
    text-align: center !important;
}

.combinations-table td:nth-child(4),
.combinations-table th:nth-child(4) {
    text-align: center !important;
}

/* FORZAR CENTRADO EN COLUMNAS 1 Y 4 CON MÁXIMA PRIORIDAD */
.combinations-table td:first-child,
.combinations-table th:first-child {
    text-align: center !important;
}

.combinations-table td:last-child,
.combinations-table th:last-child {
    text-align: center !important;
}

/* FORZAR CENTRADO EN FILAS DE DATOS - COLUMNAS 1 Y 4 */
.combinations-table tbody td:first-child {
    text-align: center !important;
}

.combinations-table tbody td:last-child {
    text-align: center !important;
}

/* FORZAR CENTRADO EN TODAS LAS FILAS DE DATOS */
.combinations-table tbody tr td {
    text-align: center !important;
}

.combinations-table tbody tr {
    background: white;
}

.combinations-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.combinations-row-even {
    background: #f8f9fa;
}

.combinations-row-odd {
    background: white;
}

/* Anchos fijos para cada columna - FORZADOS */
.combinations-table th:nth-child(1),
.combinations-table td:nth-child(1) {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    text-align: center !important;
}

.combinations-table th:nth-child(2),
.combinations-table td:nth-child(2) {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    text-align: center !important;
}

.combinations-table th:nth-child(3),
.combinations-table td:nth-child(3) {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    text-align: center !important;
}

.combinations-table th:nth-child(4),
.combinations-table td:nth-child(4) {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
    text-align: center !important;
}

.combinations-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.combinations-summary-text {
    font-weight: 600;
    font-size: 16px !important;
    color: #333;
    margin: 0 10px;
}

.no-combinations {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Responsive simplificado para la tabla de combinaciones */
@media (max-width: 800px) {
    .combinations-table-wrapper {
        overflow-x: auto;
        padding: 0;
        text-align: left;
        max-width: 100%;
        width: 100%;
    }
    
    .combinations-table {
        font-size: 0.9rem;
        margin: 0;
        min-width: 780px;
    }
}

/* Estilos unificados para TODAS las tablas */
table, .data-table, .analysis-table, .combinations-table {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    border-collapse: collapse !important;
}

/* Bordes unificados para TODAS las tablas - mismo grosor */
table, .data-table, .analysis-table, .combinations-table,
table th, .data-table th, .analysis-table th, .combinations-table th,
table td, .data-table td, .analysis-table td, .combinations-table td {
    border: 1px solid #000000 !important;
    border-width: 1px !important;
}

/* FORZAR bordes en las tablas de análisis específicamente */
#analysis-container table,
#analysis-container table th,
#analysis-container table td,
.analysis-table,
.analysis-table th,
.analysis-table td,
.analysis-header,
.analysis-cell {
    border: 1px solid #000000 !important;
    border-width: 1px !important;
}

/* Asegurar que las tablas de análisis tengan bordes visibles */
.analysis-table-container table,
.analysis-table-container table th,
.analysis-table-container table td {
    border: 1px solid #000000 !important;
    border-width: 1px !important;
}

/* Forzar bordes en todas las celdas de análisis */
.processor-section table,
.graphics-section table,
.tower-section table,
.processor-section table th,
.processor-section table td,
.graphics-section table th,
.graphics-section table td,
.tower-section table th,
.tower-section table td {
    border: 1px solid #000000 !important;
    border-width: 1px !important;
}

/* REGLA FINAL CON MÁXIMA PRIORIDAD - forzar bordes en análisis */
#analysis-container * table,
#analysis-container * table *,
#analysis-container table,
#analysis-container table * {
    border: 1px solid #000000 !important;
    border-width: 1px !important;
    border-style: solid !important;
}

/* Estilos unificados para todas las celdas de tabla */
th, td, .data-table th, .data-table td, .analysis-table th, .analysis-table td, .combinations-table th, .combinations-table td {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
}

/* TODOS los headers de TODAS las tablas centrados */
th, .data-table th, .analysis-table th, .combinations-table th {
    text-align: center !important;
}

/* FORZAR centrado de headers de primeras columnas específicamente */
.data-table th:first-child,
.analysis-table th:first-child,
.combinations-table th:first-child,
#data-container .data-table th:first-child,
#analysis-container table th:first-child {
    text-align: center !important;
}

/* Scrollbars unificados para TODAS las tablas y contenedores */
.table-wrapper::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.analysis-table-container::-webkit-scrollbar,
.combinations-table-wrapper::-webkit-scrollbar,
#data-container .data-table::-webkit-scrollbar {
    height: 12px !important;
    width: 12px !important;
    background: #f0f0f0 !important;
}

.table-wrapper::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.analysis-table-container::-webkit-scrollbar-thumb,
.combinations-table-wrapper::-webkit-scrollbar-thumb,
#data-container .data-table::-webkit-scrollbar-thumb {
    background: #666666 !important;
    border-radius: 6px !important;
    min-height: 20px !important;
    border: 1px solid #f0f0f0 !important;
}

.table-wrapper::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.analysis-table-container::-webkit-scrollbar-track,
.combinations-table-wrapper::-webkit-scrollbar-track,
#data-container .data-table::-webkit-scrollbar-track {
    background: #f0f0f0 !important;
    border-radius: 4px !important;
}

/* Firefox scrollbar unificado para todas las tablas */
.table-wrapper,
.table-container,
.analysis-table-container,
.combinations-table-wrapper,
#data-container .data-table {
    scrollbar-width: thin !important;
    scrollbar-color: #666666 #f0f0f0 !important;
}
