/* ============================================================
   Cine y Mujeres — Dark Cinematic Theme
   ============================================================ */

/* === Reset y Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Palette */
    --color-bg: #0a0a0f;
    --color-surface: #141420;
    --color-surface-2: #1e1e2e;
    --color-surface-3: #2a2a3e;
    --color-accent: #FF8F00;
    --color-accent-blue: #3949AB;
    --color-accent-green: #7986CB;
    --color-text: #e0e0e0;
    --color-text-secondary: #a0a0b0;
    --color-text-muted: #6c6c80;
    --color-heading: #ffffff;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-light: rgba(255, 255, 255, 0.12);

    /* Glassmorphism */
    --glass-bg: rgba(20, 20, 32, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 12px;

    /* Shadows */
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 4px 20px rgba(255, 143, 0, 0.15);
    --shadow-blue: 0 4px 20px rgba(57, 73, 171, 0.15);

    /* Navbar */
    --navbar-bg: rgba(10, 10, 15, 0.85);
    --navbar-mobile-bg: rgba(10, 10, 15, 0.95);

    /* Misc */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Light Theme === */
[data-theme="light"] {
    --color-bg: #f5f5f8;
    --color-surface: #ffffff;
    --color-surface-2: #f0f0f4;
    --color-surface-3: #e8e8ee;
    --color-accent: #FF8F00;
    --color-accent-blue: #3949AB;
    --color-accent-green: #7986CB;
    --color-text: #3a3a4a;
    --color-text-secondary: #5a5a6e;
    --color-text-muted: #8a8a9e;
    --color-heading: #1a1a2e;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-light: rgba(0, 0, 0, 0.12);

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);

    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-accent: 0 4px 20px rgba(255, 143, 0, 0.12);
    --shadow-blue: 0 4px 20px rgba(57, 73, 171, 0.12);

    --navbar-bg: rgba(255, 255, 255, 0.9);
    --navbar-mobile-bg: rgba(255, 255, 255, 0.97);
}

[data-theme="light"] .hero::before {
    background: radial-gradient(circle, rgba(255, 143, 0, 0.05) 0%, rgba(57, 73, 171, 0.03) 40%, transparent 70%);
}

[data-theme="light"] .modal-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .heatmap-table td {
    color: #fff;
}

[data-theme="light"] .bar-fill::after {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .pagination .page-num.active {
    color: #fff;
}

[data-theme="light"] .btn-primary {
    color: #fff;
}

[data-theme="light"] .nav-links a:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-links a.active {
    background: rgba(255, 143, 0, 0.08);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-blue);
}

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* === Navbar === */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    color: var(--color-heading);
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-brand:hover {
    opacity: 0.85;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-links a:hover {
    color: var(--color-heading);
    background: rgba(255, 255, 255, 0.06);
}

.nav-links a.active {
    color: var(--color-heading);
    background: rgba(255, 143, 0, 0.12);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* === Main === */
main {
    flex: 1;
}

/* === Hero Section === */
.hero {
    text-align: center;
    padding: 5rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 143, 0, 0.08) 0%, rgba(57, 73, 171, 0.04) 40%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.25rem;
    color: var(--color-heading);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero h1 .accent {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0 auto 3rem;
    line-height: 1.7;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2.5rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.5rem;
    display: block;
}

/* === Glass Card === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* === Findings / Highlight Cards === */
.findings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.finding-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.finding-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-blue));
}

.finding-card:hover {
    border-color: rgba(255, 143, 0, 0.2);
    box-shadow: var(--shadow-accent);
    transform: translateY(-3px);
}

.finding-card .finding-number {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-accent);
    display: block;
    margin-bottom: 0.5rem;
}

.finding-card .finding-label {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* === Gauge Section === */
.gauge-section {
    margin: 3rem 0;
    padding: 3rem 0;
}

.gauge-section h2 {
    text-align: center;
    color: var(--color-heading);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.section-desc {
    text-align: center;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Year Slider/Controls */
.gauge-controls {
    text-align: center;
    margin-bottom: 1.5rem;
}

.gauge-controls label {
    font-weight: 600;
    margin-right: 0.75rem;
    color: var(--color-text-secondary);
}

.gauge-controls select,
.chart-controls select {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 2.5rem;
}

.gauge-controls select:hover,
.chart-controls select:hover {
    border-color: var(--color-accent);
}

.gauge-controls select:focus,
.chart-controls select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 143, 0, 0.15);
}

/* Chart Container */
.chart-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    min-height: 350px;
}

.chart-small {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gauge-info {
    text-align: center;
    margin: 1.5rem 0;
}

.gauge-value {
    font-size: 1.5rem;
    color: var(--color-heading);
}

.gauge-value strong {
    color: var(--color-accent);
    font-size: 1.75rem;
}

.gauge-interp {
    color: var(--color-text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
}

/* === Roles Breakdown === */
.roles-breakdown {
    margin: 3rem 0;
}

.roles-breakdown h3 {
    text-align: center;
    color: var(--color-heading);
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.roles-grid {
    max-width: 700px;
    margin: 0 auto;
}

.role-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.4rem 0;
    transition: all var(--transition);
}

.role-bar:hover {
    transform: translateX(4px);
}

.role-name {
    width: 180px;
    font-size: 0.85rem;
    text-align: right;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    font-weight: 500;
}

.bar-container {
    flex: 1;
    height: 22px;
    background: var(--color-surface-3);
    border-radius: 11px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent-blue), var(--color-accent));
    border-radius: 11px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 2px;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 11px 11px 0 0;
}

.role-pct {
    width: 55px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: right;
    font-family: 'Inter', sans-serif;
}

/* === Diverging Bar (Summary) === */
.diverging-summary {
    margin: 3rem 0;
    padding: 3rem 0;
}

.diverging-bar-item {
    display: grid;
    grid-template-columns: 140px 1fr 30px 1fr 140px;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
}

.diverging-label-left {
    text-align: right;
    color: var(--color-accent-blue);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.diverging-label-right {
    text-align: left;
    color: var(--color-accent);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

.diverging-bar-left {
    display: flex;
    justify-content: flex-end;
}

.diverging-bar-right {
    display: flex;
    justify-content: flex-start;
}

.diverging-fill {
    height: 18px;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.diverging-fill.male {
    background: var(--color-accent-blue);
}

.diverging-fill.female {
    background: var(--color-accent);
}

.diverging-role-name {
    text-align: center;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Page Header === */
.page-header {
    padding: 3rem 0 1.5rem;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--color-heading);
    margin-bottom: 0.75rem;
}

.page-header .section-desc {
    text-align: left;
    margin: 0;
    max-width: none;
}

/* === Content Sections === */
.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    font-size: 1.75rem;
    color: var(--color-heading);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--color-accent), var(--color-accent-blue)) 1;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

/* === Method Cards === */
.method-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition);
}

.method-card:hover {
    border-color: rgba(255, 143, 0, 0.2);
    box-shadow: var(--shadow-accent);
}

.method-card h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.method-card p {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.method-card ol,
.method-card ul {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
}

.method-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.method-card strong {
    color: var(--color-text);
}

/* === Cards Grid (3 columns) === */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* === Lists === */
.roles-list {
    columns: 2;
    padding-left: 1.5rem;
    color: var(--color-text-secondary);
}

.roles-list li {
    margin-bottom: 0.5rem;
    break-inside: avoid;
}

/* === Chart Controls === */
.chart-controls {
    margin-bottom: 1.25rem;
}

.chart-controls label {
    font-weight: 600;
    margin-right: 0.75rem;
    color: var(--color-text-secondary);
}

.no-data {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 3rem;
}

/* === CTA Section === */
.cta-section {
    text-align: center;
    padding: 4rem 0;
    margin: 2rem 0;
    position: relative;
}

.cta-section h2 {
    color: var(--color-heading);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.cta-section p {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), #E65100);
    color: #fff; /* always white on accent bg */
    box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 143, 0, 0.3);
    color: #fff;
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent-blue);
    border: 1px solid var(--color-accent-blue);
}

.btn-secondary:hover {
    background: rgba(57, 73, 171, 0.1);
    color: var(--color-accent-blue);
    transform: translateY(-2px);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Películas Page === */
.peliculas-header {
    padding: 3rem 0 2rem;
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 143, 0, 0.15);
}

.search-bar input::placeholder {
    color: var(--color-text-muted);
}

.search-bar button {
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #fff; /* always white on accent bg */
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.search-bar button:hover {
    background: #E65100;
    transform: translateY(-1px);
}

.filters-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select,
.filter-group input[type="number"] {
    padding: 0.5rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 2rem;
}

.filter-group input[type="number"] {
    width: 80px;
    -moz-appearance: textfield;
}

.filter-group input[type="number"]::-webkit-inner-spin-button,
.filter-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(255, 143, 0, 0.15);
}

/* Movie Grid */
.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.movie-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.movie-card:hover {
    border-color: rgba(255, 143, 0, 0.3);
    box-shadow: var(--shadow-accent);
    transform: translateY(-3px);
}

.movie-card .movie-year {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
}

.movie-card .movie-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--color-heading);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.movie-card .movie-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.movie-card .movie-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.movie-card .rating-badge {
    background: rgba(57, 73, 171, 0.15);
    color: var(--color-accent-blue);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}

.movie-card .director-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.gender-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.gender-dot.male { background: var(--color-accent-blue); }
.gender-dot.female { background: var(--color-accent); }
.gender-dot.unknown { background: var(--color-text-muted); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.pagination button,
.pagination .page-num {
    padding: 0.5rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', sans-serif;
}

.pagination button:hover,
.pagination .page-num:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.pagination .page-num.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin: 0 0.5rem;
}

/* Movie Detail Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
    margin-top: 2rem;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--color-accent);
}

.modal-content h2 {
    font-size: 1.75rem;
    color: var(--color-heading);
    margin-bottom: 0.25rem;
    border: none;
    padding: 0;
}

.modal-content .movie-detail-year {
    color: var(--color-accent);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.modal-content .detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
}

.detail-meta-item {
    text-align: center;
}

.detail-meta-item .meta-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-heading);
    display: block;
}

.detail-meta-item .meta-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.crew-section h3 {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.crew-list {
    display: grid;
    gap: 0.5rem;
}

.crew-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.crew-item .crew-role {
    color: var(--color-text-muted);
    font-weight: 500;
    min-width: 160px;
}

.crew-item .crew-name {
    color: var(--color-text);
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* === Heatmap & Advanced Charts === */
.heatmap-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.heatmap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
    font-size: 0.8rem;
}

.heatmap-table th {
    padding: 0.5rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-align: center;
}

.heatmap-table td {
    padding: 0.6rem 0.5rem;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    transition: all var(--transition);
    color: #fff;
    min-width: 60px;
}

.heatmap-table td:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.heatmap-table .row-header {
    text-align: right;
    color: var(--color-text-secondary);
    font-weight: 500;
    min-width: 150px;
    background: none !important;
}

/* === Treemap container === */
.treemap-container {
    min-height: 500px;
}

/* === Top Movies Table === */
.top-movies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.top-movies-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--color-border);
}

.top-movies-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.top-movies-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: var(--color-text);
}

.top-movies-table .movie-title-cell {
    color: var(--color-heading);
    font-weight: 500;
}

/* === Timeline (Historia) === */
.timeline {
    position: relative;
    padding: 2rem 0;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--color-accent), var(--color-accent-blue));
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
    padding-right: calc(50% + 2rem);
    text-align: right;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: calc(50% + 2rem);
    text-align: left;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    border-radius: 50%;
    border: 3px solid var(--color-bg);
    z-index: 1;
}

.timeline-content {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.timeline-year {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.timeline-text {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* === Pipeline Diagram (Metodología) === */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}

.pipeline-step {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
    min-width: 140px;
    transition: all var(--transition);
}

.pipeline-step:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}

.pipeline-step .step-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.pipeline-step .step-name {
    font-weight: 600;
    color: var(--color-heading);
    font-size: 0.9rem;
    display: block;
}

.pipeline-step .step-desc {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    display: block;
}

.pipeline-arrow {
    color: var(--color-accent);
    font-size: 1.5rem;
    padding: 0 0.5rem;
}

/* === Roles Table (Metodología) === */
.roles-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.roles-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.roles-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.roles-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.roles-table .role-category {
    color: var(--color-accent);
    font-weight: 500;
}

/* === Footer === */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0 2rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    color: var(--color-heading);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.footer-col p,
.footer-col a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.8;
}

.footer-col a {
    color: var(--color-text-secondary);
    display: block;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* === Scroll Animations === */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* === Counter Animation === */
.counter-animate {
    display: inline-block;
}

/* === Loading Spinner === */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

.loading-spinner::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Section Divider === */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
    margin: 3rem 0;
}

/* === Theme Toggle Button === */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    font-size: 1.1rem;
    line-height: 1;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Dark theme (default): show sun icon to switch to light */
.theme-toggle .icon-sun { display: inline; }
.theme-toggle .icon-moon { display: none; }

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline; }

/* === Pull Quote (Investigacion) === */
.pull-quote {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.7;
    max-width: 700px;
    margin: 2.5rem auto;
    padding: 2rem 2rem 2rem 2.5rem;
    border-left: 4px solid;
    border-image: linear-gradient(180deg, var(--color-accent), var(--color-accent-blue)) 1;
    color: var(--color-text);
    position: relative;
}

.pull-quote .attribution {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-style: normal;
    color: var(--color-text-muted);
    margin-top: 1rem;
    font-weight: 600;
}

/* === Narrative Section (Investigacion) === */
.narrative-section {
    max-width: 750px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.narrative-section h2 {
    font-size: 2rem;
    color: var(--color-heading);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--color-accent), var(--color-accent-blue)) 1;
}

.narrative-section p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--color-text-secondary);
    margin-bottom: 1.25rem;
}

.narrative-section strong {
    color: var(--color-text);
}

/* === Comparison Grid (Investigacion) === */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-width: 700px;
    margin: 2rem auto;
}

.comparison-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    transition: all var(--transition);
}

.comparison-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.comparison-card.women {
    border-top: 3px solid var(--color-accent);
}

.comparison-card.men {
    border-top: 3px solid var(--color-accent-blue);
}

.comparison-card .comp-number {
    font-family: 'Inter', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    display: block;
    margin-bottom: 0.25rem;
}

.comparison-card.women .comp-number {
    color: var(--color-accent);
}

.comparison-card.men .comp-number {
    color: var(--color-accent-blue);
}

.comparison-card .comp-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* === Stat Highlight (Investigacion) === */
.stat-highlight {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.15em;
    color: var(--color-accent);
}

.stat-highlight.blue {
    color: var(--color-accent-blue);
}

/* === Investigacion Hero === */
.investigacion-hero {
    text-align: center;
    padding: 5rem 1.5rem 3rem;
    position: relative;
}

.investigacion-hero h1 {
    font-size: 3rem;
    color: var(--color-heading);
    margin-bottom: 1rem;
}

.investigacion-hero .hero-sub {
    max-width: 650px;
}

/* === Section Number Badge === */
.section-badge {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-bottom: 0.75rem;
}

/* === Stat Cards Row (Investigacion) === */
.stat-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 750px;
    margin: 2rem auto;
}

.stat-card-sm {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition);
}

.stat-card-sm:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card-sm .sc-number {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-accent);
    display: block;
}

.stat-card-sm .sc-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* === Plotly Dark Theme Override === */
.js-plotly-plot .plotly .bg {
    fill: transparent !important;
}

/* === Responsive === */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--navbar-mobile-bg);
        backdrop-filter: blur(20px);
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links.open {
        display: flex;
    }

    .hero {
        padding: 3rem 0 2rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .stats-bar {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .stat-number {
        font-size: 2rem;
    }

    .role-name {
        width: 110px;
        font-size: 0.75rem;
    }

    .roles-list {
        columns: 1;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pipeline {
        flex-direction: column;
        gap: 0;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
        padding: 0.25rem 0;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        flex-direction: row;
        padding-left: 50px;
        padding-right: 0;
        text-align: left;
    }

    .timeline-dot {
        left: 20px;
    }

    .search-bar {
        flex-direction: column;
        max-width: none;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .movies-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.5rem;
        margin-top: 1rem;
    }

    .diverging-bar-item {
        grid-template-columns: 60px 1fr 20px 1fr 60px;
        font-size: 0.7rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
    }

    .findings-grid {
        grid-template-columns: 1fr;
    }

    .pull-quote {
        font-size: 1.1rem;
        padding: 1.5rem 1.5rem 1.5rem 1.75rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .investigacion-hero h1 {
        font-size: 2rem;
    }

    .narrative-section h2 {
        font-size: 1.5rem;
    }

    .stat-cards-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .diverging-bar-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        text-align: center;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background: var(--color-surface);
        border-radius: var(--radius-sm);
    }
}
