:root {
    --color-tema: #4A4A4A; 
    --fondo-body: var(--fondo-body);
    --texto-negro: var(--texto-negro);
    --color-texto-gris: var(--texto-gris);
    --gris-fondo-btn: var(--gris-fondo-boton);
    --gris-borde-h1: #e0e0e0; 
    
    /* Variables Locales */
    --fondo-modulo: #ffffff;
    --borde-modulo: #e0e0e0;
    --header-tabla: #E5E4E2;
    --texto-tabla-header: #4A4A4A;
}

html,body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--fondo-body);
    color: var(--texto-negro);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

/* Header */
.details-header {
    padding: 60px 20px;
    text-align: center;
    border-bottom: 2px solid var(--gris-borde-h1);
    margin-bottom: 40px;
}

.details-header h1 {
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--color-tema);
    text-transform: uppercase;
    letter-spacing: -1px;
    margin: 0 auto;
    padding-bottom: 10px;
    max-width: 90%;
}

.details-header p {
    color: var(--color-texto-gris);
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 10px;
    font-size: 1rem;
}

/* Contenido Principal */
.details-wrapper {
    max-width: 900px; 
    margin: 0 auto 60px auto;
    padding: 0 20px;
    text-align: left;
}

.intro-text {
    margin-bottom: 40px;
    font-size: 1.1rem;
    color: var(--texto-negro);
}

/* Módulos Desplegables */
details.tech-module {
    background: var(--fondo-modulo);
    border: 1px solid var(--borde-modulo);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    overflow: hidden;
}

details.tech-module:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-color: var(--color-tema);
}

summary.module-header {
    padding: 20px 25px;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid #ccc;
    background: var(--gris-fondo-btn);
    color: var(--texto-negro);
    transition: background 0.2s;
}

summary.module-header:hover {
    background: #f0f0f0;
}

details.tech-module[open] summary.module-header {
    border-left: 5px solid var(--color-tema);
    border-bottom: 1px solid var(--borde-modulo);
    background: var(--fondo-modulo);
}

summary.module-header::after {
    content: '▼';
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s;
}

details.tech-module[open] summary.module-header::after {
    transform: rotate(180deg);
}

.module-content {
    padding: 30px;
    background: var(--fondo-modulo);
    color: var(--texto-negro);
    overflow-x: auto;
}

/* Tablas de Datos */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.95rem;
    min-width: 500px;
}

.data-table th {
    background: var(--header-tabla);
    color: var(--texto-tabla-header);
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--borde-modulo);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.85rem;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--borde-modulo);
    color: var(--texto-negro);
}

.row-highlight { 
    font-weight: 700; 
    background: rgba(128, 128, 128, 0.05); 
}

/* Veredicto */
.verdict-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 50px;
}

.v-card {
    padding: 30px;
    border: 1px solid var(--borde-modulo);
    border-radius: 12px;
    background: var(--fondo-modulo);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.v-card h4 {
    text-transform: uppercase;
    margin: 0 0 20px 0;
    border-bottom: 2px solid var(--borde-modulo);
    padding-bottom: 15px;
    font-size: 1rem;
    color: var(--color-tema);
}

/* Bordes de color semántico */
.v-positive {
    border-top: 6px solid #4CAF50;
}

.v-negative {
    border-top: 6px solid #F44336;
}

.v-card ul {
    padding-left: 20px;
    margin: 0;
}

.v-card li {
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Navegación y Botones */
.nav-container {
    margin-top: 60px;
    text-align: center;
}

.boton-nav-small {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 30px;
    min-width: 180px;
    background-color: #ffffff;
    color: #333;
    border: 2px solid #333;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin: 5px;
}

.boton-nav-small:hover {
    background-color: var(--color-tema);
    color: #ffffff;
    border-color: #000;
    transform: translateY(-3px);
    box-shadow: 0 5px 0px rgba(0,0,0,1);
}

/* Footer */
.details-footer {
    background-color: #fcfcfc;
    border-top: 2px solid var(--gris-borde-h1);
    padding: 40px 20px;
    text-align: center;
    margin-top: auto;
}

/* Anuncios */
.ad-wrapper {
    width: 100%;
    margin: 40px auto;
    text-align: center;
    background-color: transparent;
    overflow: hidden;
    max-width: 1000px;
}

.ad-slot-fluid {
    display: block;
    min-height: 150px;
}

.adsbygoogle .google-auto-placed {
    display: none !important;
}

/* Modo oscuro */
body.dark-mode {
    --color-tema: #e0e0e0;
    
    /* Variables Locales Dark */
    --fondo-modulo: #27272a;
    --borde-modulo: #444;
    --header-tabla: #18181b;
    --texto-tabla-header: #e0e0e0;
}

/* Header */
body.dark-mode .details-header {
    border-bottom-color: #444;
}

body.dark-mode h1 {
    color: #fff;
}

body.dark-mode p {
    color: #aaa;
}

/* Módulos */
body.dark-mode details.tech-module {
    background: var(--fondo-modulo);
    border-color: var(--borde-modulo);
}

body.dark-mode summary.module-header {
    background: #18181b;
    color: #e0e0e0;
    border-left-color: #555;
}

body.dark-mode summary.module-header:hover {
    background: #222;
}

body.dark-mode details.tech-module[open] summary.module-header {
    background: #222;
    border-left-color: var(--color-tema);
    border-bottom-color: #444;
}

/* Tablas */
body.dark-mode .data-table th {
    background: var(--header-tabla);
    color: var(--texto-tabla-header);
    border-bottom-color: #444;
}

body.dark-mode .data-table td {
    border-bottom-color: #333;
    color: #ddd;
}

body.dark-mode .row-highlight {
    background: rgba(255, 255, 255, 0.05);
}

/* Veredicto */
body.dark-mode .v-card {
    background: var(--fondo-modulo);
    border-color: var(--borde-modulo);
}

body.dark-mode .v-card h4 {
    color: #fff;
    border-bottom-color: #444;
}

body.dark-mode .v-positive {
    border-top-color: #66bb6a;
}

body.dark-mode .v-negative {
    border-top-color: #ef5350;
}

/* Botones */
body.dark-mode .boton-nav-small {
    background: #27272a;
    color: #fff;
    border-color: #555;
}

body.dark-mode .boton-nav-small:hover {
    background: var(--color-tema);
    color: #000;
    border-color: var(--color-tema);
    box-shadow: 0 0 15px rgba(224, 224, 224, 0.4);
}

/* Footer Dark */
body.dark-mode .details-footer {
    background-color: var(--fondo-body) !important;
    border-top-color: #444 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .details-header {
        padding: 40px 20px;
    }

    .details-header h1 {
        font-size: 2rem;
    }
    
    .verdict-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .module-content {
        padding: 20px;
    }
    
    .boton-nav-small {
        width: 100%;
        max-width: 300px;
    }
}