/* --- VARIABLES GLOBALES DE COLOR Y DISEÑO --- */
:root {
    --primary-red: #D32F2F; 
    --primary-black: #1A1A1A; 
    --primary-white: #FFFFFF;
    --secondary-black: #2C2C2C; 
    --tertiary-black: #3D3D3D; 
    
    --text-white: #F5F5F5; 
    --text-grey: #BDBDBD; 
    --text-dark: #212121;

    --accent-red-light: #FF5252;

    /* Colores para gráficos (TONOS DE GRIS) */
    --graph-bar-color-1: #616161; /* Gris oscuro */
    --graph-bar-color-2: #757575; /* Gris medio */
    --graph-bar-color-3: #9E9E9E; /* Gris claro */

    --shadow-color: rgba(0, 0, 0, 0.25);
    --card-border-radius: 12px;
}

/* --- ESTILOS GENERALES Y SCROLLBAR --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--secondary-black); border-radius: 10px; }
::-webkit-scrollbar-thumb { background-color: var(--primary-red); border-radius: 10px; border: 2px solid var(--secondary-black); }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent-red-light); }
html { scrollbar-color: var(--primary-red) var(--secondary-black); scrollbar-width: thin; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--primary-black);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 2rem;
    padding-bottom: 4rem;
    line-height: 1.65; 
}




 .contador-visitas {
            /*background-color: #333;*/
            color: #fff;
            padding: 15px 30px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            text-align: center;
        }

        .contador-visitas .etiqueta {
            font-size: 1.2em;
            display: block;
            margin-bottom: 5px;
            color: #ddd; /* Un color más suave para la etiqueta */
        }

        .contador-visitas .numero {
            font-size: 1.2em;
            font-weight: bold;
            color: #DD0000; /* Color verde para el número */
            line-height: 1;
        }

        .contador-visitas .numero.loading {
            font-size: 1.5em; /* Más pequeño mientras carga */
            color: #ffc107; /* Color ámbar mientras carga */
        }
        
        
        



/* --- CONTENEDOR PRINCIPAL DE LA APLICACIÓN --- */
#app {
    background-color: var(--primary-black); 
    width: 95%;
    max-width: 1200px; 
    padding: 2rem 2.5rem;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
}

/* --- CABECERA --- */
header {
    text-align: center;
    margin-bottom: 3rem; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-container {
    width: 100%;
    max-width: 180px; 
    height: 60px; 
    margin-bottom: 1.25rem; 
}
.logo-container a {
    display: block;
    width: 100%;
    height: 100%;
}
.logo-svg { 
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

header h1 {
    font-size: 2.4rem; 
    font-weight: 700;
    color: var(--primary-white);
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.05rem; 
    color: var(--text-grey);
    max-width: 650px; 
}

/* --- TÍTULOS DE SECCIÓN --- */
section h2 {
    font-size: 1.8rem; 
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 2rem; 
    padding-bottom: 0.5rem; 
    border-bottom: 2px solid var(--tertiary-black);
    display: inline-block; 
}

#graficos > h2, #recomendaciones > h2 {
    display: block; 
    text-align: center;
}

/* --- SECCIÓN DE GRÁFICOS --- */
#graficos {
    margin-bottom: 2.5rem; 
}

#graficos-container {
    display: grid;
    grid-template-columns: 1fr; /* Por defecto una columna para móviles */
    gap: 1.8rem; 
    width: 100%;
}

.grafico-container {
    background-color: var(--secondary-black);
    border-radius: var(--card-border-radius);
    padding: 1.6rem 1.4rem; 
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 5px 10px var(--shadow-color); 
    border: 1px solid var(--tertiary-black);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.grafico-container:hover {
    transform: translateY(-5px); 
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border-color: var(--primary-red);
}

.grafico-titulo {
    font-size: 1.2rem; 
    font-weight: 600; 
    color: var(--text-white);
    margin-bottom: 0.4rem;
    text-align: center;
}

.grafico-definicion {
    font-size: 0.85rem; 
    font-weight: 400;
    color: var(--text-grey);
    text-align: center;
    margin-bottom: 1.2rem; 
    line-height: 1.6; 
    max-width: 95%;
}

.grafico-canvas-wrapper {
    width: 100%;
    height: 240px; /* Altura reducida para cards más compactas */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.grafico-canvas {
    max-width: 100%;
    max-height: 100%;
}

/* --- SECCIÓN DE RECOMENDACIONES (SLIDER) --- */
#recomendaciones {
    margin-bottom: 2.5rem;
    width: 100%;
    overflow: hidden; 
}

.recomendaciones-slider {
    overflow-x: auto;
    padding: 0.5rem 0.2rem 1.5rem 0.2rem; 
    position: relative;
    cursor: grab;
    user-select: none;
    -ms-overflow-style: none; 
    scrollbar-width: none; 
}
.recomendaciones-slider.active-drag { cursor: grabbing; scroll-behavior: auto; }
.recomendaciones-slider::-webkit-scrollbar { display: none; }

.recomendaciones-track {
    display: flex;
    gap: 1.5rem; 
    width: max-content; 
    padding-bottom: 10px; 
}

.recomendacion-card {
    flex: 0 0 auto; 
    width: 310px; 
    background-color: var(--secondary-black);
    border-radius: var(--card-border-radius);
    padding: 1.5rem; 
    border: 1px solid var(--tertiary-black);
    box-shadow: 0 5px 10px var(--shadow-color);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    border-left: 4px solid var(--primary-red); 
}

.recomendacion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    border-color: var(--primary-red); 
}

.recomendacion-card h3 {
    font-size: 1.2rem; 
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.8rem; 
    color: var(--primary-red); 
}

.recomendacion-card p {
    font-size: 0.9rem; 
    font-weight: 400;
    color: var(--text-grey);
    line-height: 1.65;
    margin-bottom: 0;
}
.recomendacion-card strong {
    color: var(--text-white);
    font-weight: 500; 
}

/* --- PIE DE PÁGINA --- */
footer {
    text-align: center;
    margin-top: 1.5rem; 
    padding-top: 1.25rem; 
    border-top: 1px solid var(--tertiary-black);
    font-size: 0.8rem; 
    color: var(--text-grey);
    line-height: 1.6;
}
footer .nota-footer {
    display: block;
    margin-top: 0.4rem;
    font-style: italic;
}

/* --- MEDIA QUERIES PARA RESPONSIVIDAD --- */

/* Layout de dos columnas para gráficos en tablets y escritorios */
@media (min-width: 768px) {
    #graficos-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Ajustes generales para tablets y móviles más pequeños */
@media (max-width: 767px) {
    #app {
        padding: 1.5rem 1rem;
        width: 100%;
        border-radius: 0; /* Full width en móviles */
    }
    header h1 { font-size: 2rem; }
    header p { font-size: 1rem; }
    section h2 { font-size: 1.6rem; }
    
    /* #graficos-container ya es 1fr por defecto, no se necesita cambio aquí */

    .grafico-container, .recomendacion-card {
        width: auto; /* Ocupan el espacio disponible en el grid/flex */
        min-width: 0; /* Reset min-width */
    }
    .recomendacion-card {
        width: 280px; /* Ancho fijo para slider en móvil */
        padding: 1.4rem;
    }
    .grafico-titulo { font-size: 1.1rem; }
    .grafico-definicion { font-size: 0.8rem; }
}

/* Ajustes para móviles muy pequeños */
@media (max-width: 480px) {
    header h1 { font-size: 1.7rem; }
    section h2 { font-size: 1.3rem; }
    .grafico-canvas-wrapper { height: 220px; } 
    .recomendacion-card {
        width: calc(100vw - 3rem); /* Ocupa casi todo el ancho menos paddings */
        max-width: none; /* Permitir que se expanda más si es necesario */
    }
    .recomendacion-card h3 { font-size: 1.1rem; }
    .recomendacion-card p { font-size: 0.85rem; }
}