/* ===== VARIABLES Y RESET ===== */
:root {
    /* Colores principales */
    --primary: #4a6fa5;
    --primary-dark: #3a5a8c;
    --secondary: #51cf66;
    --accent: #ff6b6b;
    --accent-dark: #e05555;
    
    /* Escala de grises */
    --gray-900: #212529;
    --gray-800: #343a40;
    --gray-700: #495057;
    --gray-600: #6c757d;
    --gray-500: #adb5bd;
    --gray-400: #ced4da;
    --gray-300: #dee2e6;
    --gray-200: #e9ecef;
    --gray-100: #f8f9fa;
    
    /* Colores especiales */
    --playfair: #6d6875;
    --nightingale: #e5989b;
    --minard: #b5838d;
    --tufte: #ffb4a2;
    --bertin: #a5a58d;
    --rosling: #83c5be;
    
    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 24px rgba(0,0,0,0.18);
    
    /* Bordes */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Espaciado */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 4rem;
}

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

html { 
    scroll-behavior: smooth; 
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    color: var(--gray-900);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: var(--space-sm); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover { color: var(--primary-dark); }

//* ===== HERO ===== */
.hero {
    height: 55vh;
    background:
        radial-gradient(circle at top left,
            rgba(255,255,255,0.85) 0%,
            rgba(240,244,255,0.85) 40%,
            rgba(234,237,243,0.85) 100%
        ),
        url('img/hero.webp');
    background-size: cover;
    background-position: center;
    background-blend-mode: lighten;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--gray-900);
}

.hero-content {
    background: rgba(255, 255, 255, 0.9);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 900px;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: 1px;
}

.hero-quote {
    font-style: italic;
    color: var(--gray-700);
    margin-bottom: var(--space-lg);
    font-size: 1.2rem;
}
}

/* ===== NAVEGACIÓN RÁPIDA ===== */
.quick-nav {
    background: white;
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-sm);
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm);
    background: var(--gray-100);
    border-radius: var(--radius-md);
    transition: 0.3s ease;
    text-align: center;
}
.nav-card:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.nav-card i {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

/* ===== SEPARADORES DE CITA ===== */
.quote-separator {
    background: var(--gray-200);
    padding: var(--space-xl) 0;
    margin: var(--space-xl) 0;
}

.quote-separator blockquote {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.5rem;
    font-style: italic;
    color: var(--gray-700);
}

.quote-separator cite {
    display: block;
    margin-top: var(--space-sm);
    color: var(--gray-600);
}

/* ===== SECCIONES GENERALES ===== */
.section { 
    padding: var(--space-xxl) 0; 
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-md);
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-lg);
    color: var(--gray-700);
}

/* ===== PIONEROS ===== */
.pioneers-section { 
    background: white; 
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: var(--space-xl) auto;
}

.timeline-line {
    position: absolute;
    left: 120px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    opacity: 0.3;
}

.pioneer-card {
    display: flex;
    margin-bottom: var(--space-xl);
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: 0.3s ease;
}
.pioneer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pioneer-image {
    width: 200px;
    flex-shrink: 0;
}

.image-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}
.playfair { background: var(--playfair); }
.nightingale { background: var(--nightingale); }
.minard { background: var(--minard); }
.tufte { background: var(--tufte); }
.bertin { background: var(--bertin); }
.rosling { background: var(--rosling); }

.pioneer-content {
    padding: var(--space-lg);
    flex: 1;
}

.pioneer-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
}

.era, .contribution {
    background: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.pioneer-quote {
    background: var(--gray-100);
    padding: var(--space-sm);
    border-left: 4px solid var(--primary);
    margin: var(--space-sm) 0;
    font-style: italic;
}

.pioneer-link {
    display: inline-block;
    margin-top: var(--space-sm);
    color: var(--primary);
    font-weight: 600;
}

/* ===== FUNDAMENTOS CONCEPTUALES ===== */
.fundamentals-section {
    background: var(--gray-100);
}

.fundamentals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.concept-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: 0.3s ease;
}
.concept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.concept-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.example-box, .insight-box, .principle-box {
    background: var(--gray-100);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-sm);
}

.variables-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.variable-type {
    background: var(--gray-100);
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

.chart-suggestion {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

.case-studies {
    display: grid;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.case-study {
    background: var(--gray-100);
    padding: var(--space-md);
    border-radius: var(--radius-md);
}

/* ===== PRINCIPIOS DE DISEÑO ===== */
.principles-section {
    background: white;
}

.principles-tabs {
    max-width: 900px;
    margin: var(--space-xl) auto;
}

.tab-buttons {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.tab-button {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gray-200);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
}
.tab-button:hover,
.tab-button.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.principle-card {
    background: var(--gray-100);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
}
.principle-card.highlight {
    background: var(--primary);
    color: white;
}

.process-steps {
    display: grid;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.step {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* ===== HERRAMIENTAS ===== */
.tools-section {
    background: var(--gray-100);
}

.tool-categories {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
}

.tool-category {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gray-200);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
}
.tool-category:hover,
.tool-category.active {
    background: var(--primary);
    color: white;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    display: none;
}
.tools-grid.active {
    display: grid;
}

.tool-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: 0.3s ease;
}
.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.tool-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

.tool-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: var(--space-xs);
}
.tool-tag.free { background: #d4edda; color: #155724; }
.tool-tag.opensource { background: #d1ecf1; color: #0c5460; }
.tool-tag.freemium { background: #fff3cd; color: #856404; }
.tool-tag.easy { background: #d1ecf1; color: #0c5460; }
.tool-tag.interactive { background: #f8d7da; color: #721c24; }
.tool-tag.professional { background: #cce5ff; color: #004085; }

.tool-link {
    display: inline-block;
    margin-top: var(--space-md);
    color: var(--primary);
    font-weight: 600;
}

/* ===== FUENTES DE DATOS ===== */
.data-sources-section {
    background: white;
}

.filters {
    display: flex;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gray-200);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
}
.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
}

.data-sources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

.data-source-card {
    background: var(--gray-100);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    transition: 0.3s ease;
}
.data-source-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-sm);
}

.rigor-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: bold;
}
.rigor-badge.high { background: #d4edda; color: #155724; }
.rigor-badge.medium { background: #fff3cd; color: #856404; }

.source-comment {
    background: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin: var(--space-sm) 0;
    font-style: italic;
}

.source-link {
    display: inline-block;
    margin-top: var(--space-sm);
    color: var(--primary);
    font-weight: 600;
}

.data-sources-info {
    text-align: center;
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

/* ===== INFÓGRAFOS ===== */
.infographers-section {
    background: var(--gray-100);
}

.infographers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.infographer-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: 0.3s ease;
}
.infographer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.infographer-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.cairo { background: linear-gradient(45deg, #667eea, #764ba2); }
.serra { background: linear-gradient(45deg, #f093fb, #f5576c); }
.lupi { background: linear-gradient(45deg, #4facfe, #00f2fe); }
.bremer { background: linear-gradient(45deg, #43e97b, #38f9d7); }
.stefaner { background: linear-gradient(45deg, #fa709a, #fee140); }
.pudding { background: linear-gradient(45deg, #30cfd0, #330867); }
.vc { background: linear-gradient(45deg, #a8edea, #fed6e3); }

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: var(--space-sm);
}

.infographer-content {
    padding: var(--space-lg);
}

.infographer-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
}

.country, .specialty {
    background: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.infographer-quote {
    background: var(--gray-100);
    padding: var(--space-sm);
    border-left: 4px solid var(--primary);
    margin: var(--space-sm) 0;
    font-style: italic;
}

.infographer-links {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.portfolio-link, .social-link {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: 0.3s ease;
}
.portfolio-link {
    background: var(--primary);
    color: white;
}
.social-link {
    background: var(--gray-200);
    color: var(--gray-800);
}
.portfolio-link:hover {
    background: var(--primary-dark);
}
.social-link:hover {
    background: var(--gray-300);
}

/* ===== CHECKLIST ===== */
.checklist-section {
    background: white;
}

.checklist-container {
    max-width: 800px;
    margin: var(--space-xl) auto;
}

.checklist-category {
    margin-bottom: var(--space-xl);
}

.checklist-items {
    display: grid;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.checklist-item {
    background: var(--gray-100);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}
.checklist-item:hover {
    background: var(--gray-200);
}
.checklist-item.checked {
    background: #d4edda;
}

.checklist-item input[type="checkbox"] {
    margin-top: 0.3rem;
}

.check-tip {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-top: var(--space-xs);
    font-style: italic;
}

.checklist-summary {
    max-width: 800px;
    margin: var(--space-xl) auto;
    text-align: center;
}

.progress-bar {
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--secondary);
    width: 0%;
    transition: width 0.5s ease;
}

.reset-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--gray-200);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s ease;
    margin-top: var(--space-md);
}
.reset-btn:hover {
    background: var(--accent);
    color: white;
}

/* ===== RECURSOS ===== */
.resources-section {
    background: var(--gray-100);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-xl);
}

.resource-card {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.resource-card ul {
    margin-left: var(--space-md);
    margin-top: var(--space-sm);
}

/* ===== FOOTER ===== */
.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--space-xxl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--space-md);
}

.footer-section ul {
    margin-left: var(--space-md);
}

.footer-section li {
    margin-bottom: var(--space-xs);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-700);
    color: var(--gray-400);
}

/* ===== BOTÓN VOLVER ARRIBA ===== */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    transition: 0.3s ease;
}
#back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .nav-grid { grid-template-columns: repeat(3, 1fr); }
    .pioneer-card { flex-direction: column; }
    .timeline-line { display: none; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.2rem; }
    .nav-grid { grid-template-columns: repeat(2, 1fr); }
    .pioneer-image { width: 100%; height: 150px; }
    .fundamentals-grid,
    .infographers-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.8rem; }
    .nav-grid { grid-template-columns: 1fr; }
    .tab-buttons,
    .tool-categories,
    .filters {
        flex-direction: column;
    }
    .step {
        flex-direction: column;
    }
}