/*
  CSS Versie: 17.2 - Finale Correctie Implementatie
  Changelog:
  - Hoogte van infopaneel gefixeerd en layout van Key Insights aangepast om binnen de ruimte te passen.
  - Deelknop hernoemd naar 'action-button' om adblocker-conflicten te vermijden.
  - Mobiele overlay wordt nu correct getoond via media query.
*/

:root {
    --accent-color: #9933cc;
    --background-color: #f8f9fa;
    --canvas-background: #ffffff;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.07);
    --block-background: #f8f9fa;
    --arrow-up: #22c55e;
    --arrow-down: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

main {
    width: 100%;
    max-width: 1600px;
    padding: 2rem;
    box-sizing: border-box;
}

/* --- Header & Logo Styling --- */
.site-header {
    width: 100%;
    background-color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
    position: sticky;
    top: 0;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 70px;
    box-sizing: border-box;
    transition: height 0.2s ease-in-out;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-text {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.4rem;
    letter-spacing: -1.5px;
    line-height: 1.1;
    color: #ffffff;
    transition: font-size 0.2s ease-in-out;
}

.arrow-up { color: var(--arrow-up); display: inline-block; margin-right: 0.04em; }
.arrow-down { color: var(--arrow-down); display: inline-block; transform: scaleY(-1); margin-right: 0.04em; }
.arrow-down-shifted { transform: scaleY(-1) translateY(-0.1em); }

.site-header-home .site-nav { height: 80px; }
.site-header-home .logo-text { font-size: 1.6rem; }

.site-nav .nav-links { display: flex; gap: 1rem; align-items: center; }
.site-nav .nav-links a { text-decoration: none; color: rgba(255, 255, 255, 0.7); font-weight: 500; padding: 0.5rem 1rem; border-radius: 6px; transition: all 0.2s ease-in-out; position: relative; border-bottom: 2px solid transparent; }
.site-nav .nav-links a:hover { color: #ffffff; background-color: rgba(255, 255, 255, 0.1); }
.site-nav .nav-links a.active { color: #ffffff; font-weight: 700; }
.site-nav .nav-links a.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background-color: #ffffff; }

/* --- Credo Block Styling --- */
.credo-block {
    width: 100%;
    padding: 2rem;
    background-color: #f1f3f5;
    border-bottom: 1px solid var(--border-color);
    box-sizing: border-box;
}

.credo-block p {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.7;
}

.visualization-canvas {
    background-color: var(--canvas-background);
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-block {
    background-color: var(--block-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#output-block { gap: 1rem; }

#info-pane-container {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    margin-left: 20px;
    margin-right: 20px;
    border: none;
    min-height: 110px; /* Zorgt voor consistente hoogte */
    display: flex;
    align-items: center;
}

#info-pane {
    width: 100%;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.info-pane-default-text { color: #888; font-style: italic; width: 100%; text-align: center; font-size: 0.9rem; }
.info-pane-details { display: grid; grid-template-columns: 80px 1fr; gap: 20px; align-items: center; width: 100%; }

.info-pane-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; background-color: #e9ecef; flex-shrink: 0; }
.info-pane-img.unavailable-icon { display: flex; align-items: center; justify-content: center; background-color: #fffbe6; border: 1px solid #ffe58f; color: #d48806; }
.info-pane-img.unavailable-icon svg { width: 50px; height: 50px; }

.info-pane-content { display: grid; grid-template-columns: auto 1fr auto; align-items: center; width: 100%; gap: 2rem; }
.info-pane-content.unavailable { display: block; grid-template-columns: none; text-align: left; }
.info-pane-content.unavailable h3 { margin-top: 0; margin-bottom: 0.5rem; }
.info-pane-content.unavailable p { margin: 0.25rem 0; font-size: 0.9rem; color: var(--text-secondary); }
.info-pane-content.unavailable a { color: var(--accent-color); font-weight: 500; }

.info-pane-details .name { font-weight: 700; font-size: 1.4rem; margin: 0; color: var(--text-primary); }
.info-pane-details .nationality { display: flex; align-items: center; font-size: 0.9rem; margin-top: 4px; color: var(--text-secondary); }
.info-pane-flag { width: 20px; margin-right: 8px; border-radius: 2px; box-shadow: 0 0 3px rgba(0,0,0,0.2); }

.info-pane-extra { text-align: right; }
.info-pane-extra p { margin: 0; line-height: 1.5; }
.info-pane-extra .club { font-weight: 600; font-size: 1.1rem; color: var(--text-primary); }
.info-pane-extra .tenure { font-size: 0.9rem; color: var(--text-secondary); }

.info-pane-trophies { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 2rem; }
.trophy-item { display: flex; flex-direction: row; align-items: center; gap: 0.75rem; }
.trophy-icon { width: 20px; height: 20px; flex-shrink: 0; }
.trophy-count { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }

/* --- Key Insights Styling --- */
.stat-grid-wrapper { width: 100%; }
.stat-grid-wrapper h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; width: 100%; }
.stat-card { display: flex; align-items: center; gap: 1rem; }
.stat-icon { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background-color: #e9ecef; color: #495057; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-label { font-size: 0.8rem; color: #6c757d; line-height: 1.3; margin-bottom: 0.1rem; }
.stat-value { font-weight: 700; font-size: 1rem; color: #212529; line-height: 1.2; }
.stat-sub-value { font-size: 0.85rem; color: #495057; }
.trophy-cluster { position: relative; width: 28px; height: 28px; }
.trophy-cluster svg { position: absolute; width: 16px; height: 16px; }

/* --- Controls Styling --- */
#filter-controls-container.hidden, #advanced-nav-container.hidden, #career-mode-controls.hidden { display: none; }
#advanced-nav-container { display: flex; justify-content: center; background-color: #e9ecef; border-radius: 8px; padding: 5px; margin-top: -0.5rem; }
.advanced-nav-btn { flex-grow: 1; text-align: center; padding: 0.6rem 1rem; color: var(--text-secondary); text-decoration: none; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 600; transition: all 0.25s ease-in-out; background: none; cursor: pointer; }
.advanced-nav-btn:hover { background-color: #dce1e6; color: var(--text-primary); }
.advanced-nav-btn.active { background-color: var(--canvas-background); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

#career-mode-controls { padding-top: 1rem; }

#filter-share-container { display: flex; gap: 1rem; align-items: center; }
#filter-toggle-btn { flex-grow: 1; display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-weight: 500; color: var(--text-secondary); cursor: pointer; text-align: left; transition: all 0.2s ease-in-out; }
.filter-toggle-content { display: flex; align-items: center; gap: 8px; }
#filter-toggle-btn:hover { border-color: #aab; color: var(--text-primary); }
#filter-toggle-btn.open { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(10, 58, 107, 0.1); }
.filter-arrow { border: solid var(--text-secondary); border-width: 0 2px 2px 0; display: inline-block; padding: 3px; transform: rotate(45deg); transition: transform 0.3s ease; }
#filter-toggle-btn.open .filter-arrow { transform: rotate(-135deg); }

#filter-panel { padding-top: 1.5rem; border-top: 1px solid var(--border-color); display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; }
.filter-group label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.25rem; }
.filter-group input, .filter-group select { background-color: #fff; border: 1px solid #dfe4ea; padding: 0.75rem; font-size: 1rem; border-radius: 6px; transition: border-color 0.2s, box-shadow 0.2s; }
.filter-group input:focus, .filter-group select:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(10, 58, 107, 0.15); }
#filter-reset-btn { padding: 0.75rem 1.5rem; border: 1px solid var(--border-color); border-radius: 6px; background-color: var(--canvas-background); cursor: pointer; font-size: 1rem; }

#country-nav-container { display: flex; background-color: #e9ecef; border-radius: 8px; padding: 5px; flex-wrap: wrap; transition: opacity 0.3s; }
.nav-link { flex-grow: 1; text-align: center; padding: 0.6rem 1rem; color: var(--text-secondary); text-decoration: none; border: none; border-radius: 6px; font-size: 0.9rem; font-weight: 600; transition: all 0.25s ease-in-out; }
.nav-link:hover { background-color: #dce1e6; color: var(--text-primary); }
.nav-link.active { background-color: var(--accent-color); color: white; box-shadow: 0 2px 8px rgba(10, 58, 107, 0.4); }
.nav-link-special { background-color: #e9ecef; border: 1px dashed var(--border-color); color: var(--text-secondary); }
.nav-link-special.active { background-color: var(--accent-color); color: white; border-color: var(--accent-color); }

#heatmap-container { overflow-x: auto; width: 100%; min-height: 50px;}

#compare-controls-container { display: flex; justify-content: center; gap: 1rem; }
.compare-btn { background: none; border: 1px solid var(--border-color); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-weight: 500; }
.compare-btn:hover { background-color: #f1f3f5; }

#legend-container { padding-top: 1rem; display: flex; justify-content: center; gap: 2rem; border: none; background-color: transparent; }
.legend-section { display: flex; flex-wrap: nowrap; gap: 1rem; align-items: center; }
.legend-section:first-child { padding-right: 2rem; border-right: 1px solid var(--border-color); }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 12px; color: #333; }
.legend-swatch { width: 20px; height: 20px; border-radius: 3px; flex-shrink: 0; }

/* --- D3 Visualisatie Styling --- */
.axis path, .axis line { fill: none; stroke: var(--border-color); shape-rendering: crispEdges; }
.axis .domain, .axis .tick line { stroke: none; }
.axis text { font-size: 13px; fill: var(--text-secondary); cursor: default; transition: fill 0.2s, font-weight 0.2s; }
.axis .tick text.axis-tick-active { fill: var(--text-primary); font-weight: 700; }
.y-axis .club-label { position: relative; }
.y-axis .club-label text { font-size: 14px; font-weight: 500; fill: var(--text-primary); }
.y-axis .club-label rect { fill: #fff; }
.bar { stroke: none; transition: opacity 0.2s ease-in-out, filter 0.2s ease-in-out; cursor: pointer; }
.bar-unavailable { fill: #ced4da; }
.is-dimmed { opacity: 0.15; }
.is-highlighted { filter: saturate(150%) brightness(105%); }
.is-inactive { pointer-events: none; }
.coach-divider { stroke: var(--canvas-background); stroke-width: 2px; pointer-events: none; }
.season-divider { stroke: #e9ecef; stroke-width: 1px; shape-rendering: crispEdges; pointer-events: none; }
.prize-group { pointer-events: none; }
.event-catcher { fill: none; pointer-events: all; }

.y-axis .add-club-placeholder rect { fill: #f8f9fa; stroke: #e0e0e0; stroke-width: 2px; stroke-dasharray: 4 4; cursor: pointer; transition: background-color 0.2s; }
.y-axis .add-club-placeholder:hover rect { background-color: #f1f3f5; }
.y-axis .add-club-placeholder text { fill: var(--text-secondary); font-weight: 500; }
.y-axis .club-label .remove-club-btn { cursor: pointer; opacity: 0; transition: opacity 0.2s; }
.y-axis .club-label:hover .remove-club-btn { opacity: 1; }
.y-axis .club-label .remove-club-btn-bg { fill: #fff; stroke: var(--border-color); }
.y-axis .club-label:hover .remove-club-btn-bg { fill: #e9ecef; }
.y-axis .club-label .remove-club-btn-cross { stroke: var(--text-secondary); stroke-width: 2px; stroke-linecap: round; }

/* --- Share Button --- */
.action-button { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; background-color: #fff; border: 1px solid var(--border-color); border-radius: 8px; font-weight: 600; color: var(--accent-color); cursor: pointer; transition: all 0.2s ease-in-out; white-space: nowrap; }
.action-button:hover { background-color: #f3e8f9; border-color: var(--accent-color); }
.action-button.clicked { background-color: #22c55e; border-color: #22c55e; color: white; }
.action-button svg { width: 16px; height: 16px; }

/* --- Modal Styling --- */
#club-modal { position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; }
#club-modal:not(.modal-hidden) { display: flex; }
.modal-content { background-color: #fefefe; padding: 2rem; border: none; width: 90%; max-width: 600px; border-radius: 12px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.modal-close-btn { color: #aaa; position: absolute; top: 1rem; right: 1.5rem; font-size: 28px; font-weight: bold; cursor: pointer; line-height: 1; }
#club-search-input-modal { width: 100%; box-sizing: border-box; padding: 0.75rem; font-size: 1rem; border: 1px solid var(--border-color); border-radius: 6px; margin-bottom: 1rem; }
#club-list-container { max-height: 40vh; overflow-y: auto; }
.club-list-country-group { margin-bottom: 1.5rem; }
.club-list-country-group h3 { margin: 0 0 0.75rem 0; font-size: 1rem; font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.club-list-item { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; border-radius: 6px; cursor: pointer; transition: background-color 0.2s; }
.club-list-item:hover { background-color: #f1f3f5; }
.club-list-item img { width: 24px; height: 24px; }
.club-list-item span { font-weight: 500; }

.hidden { display: none !important; }

.page-footer { width: 100%; text-align: center; padding: 2rem 0; margin-top: auto; font-size: 0.9rem; color: #888; }
.page-footer a { color: var(--accent-color); text-decoration: none; font-weight: 500; }
.page-footer a:hover { text-decoration: underline; }

/* --- Article & About Styling --- */
.article-body h3 { font-family: 'Oswald', sans-serif; font-size: 2rem; margin-top: 3rem; margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); }
.article-body p { line-height: 1.8; margin-bottom: 1.5rem; font-size: 1.125rem; }
.article-body a { color: var(--accent-color); text-decoration: underline; }
.teasers-section { width: 100%; max-width: 1600px; padding: 2rem; box-sizing: border-box; margin: 0 auto; }
.teasers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.teaser-card { position: relative; display: block; height: 220px; border-radius: 12px; overflow: hidden; text-decoration: none; color: white; box-shadow: 0 4px 12px var(--shadow-color); transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; }
.teaser-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.teaser-card:hover .teaser-image { transform: scale(1.05); }
.teaser-image { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; transition: transform 0.4s ease; }
.teaser-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 1rem 1.25rem; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%); }
.teaser-content h3 { font-family: 'Inter', sans-serif; font-size: 1.25rem; font-weight: 700; margin: 0; text-shadow: 1px 1px 4px rgba(0,0,0,0.7); }
.more-articles-link { display: block; text-align: center; margin-top: 1.5rem; font-weight: 500; color: var(--text-secondary); text-decoration: none; }
.more-articles-link:hover { color: var(--accent-color); text-decoration: underline; }
.about-container { max-width: 800px; margin: 0 auto; padding: 2rem; background-color: #fff; border-radius: 8px; box-shadow: 0 4px 12px var(--shadow-color); }
.about-container h3 { font-family: 'Oswald', sans-serif; font-size: 1.75rem; margin-top: 2rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border-color); }
.about-container h4 { font-size: 1.25rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.about-container p, .about-container ul { font-size: 1rem; line-height: 1.7; color: var(--text-secondary); }
.about-container ul { list-style-position: inside; padding-left: 0; }
.about-container li { margin-bottom: 0.5rem; }
.about-divider { margin: 3rem 0; border-color: var(--border-color); }

/* --- Mobiele Overlay --- */
.mobile-overlay-hidden {
    display: none;
}
@media (max-width: 768px) {
    #mobile-overlay:not(.mobile-overlay-hidden) {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        background-color: rgba(248, 249, 250, 0.95);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 1rem;
    }
    .overlay-content {
        position: relative;
        background-color: rgba(255, 255, 255, 0.98);
        padding: 1.5rem;
        border-radius: 12px;
        box-shadow: 0 4px 12px var(--shadow-color);
        width: 100%;
        max-width: 350px;
    }
    .overlay-close-btn {
        position: absolute;
        top: 8px;
        right: 12px;
        font-size: 1.5rem;
        color: #adb5bd;
        cursor: pointer;
        line-height: 1;
    }
    .overlay-close-btn:hover { color: var(--text-secondary); }
    .overlay-icon { color: var(--accent-color); width: 48px; height: 48px; margin: 0 auto 1rem auto; }
    .overlay-title { font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
    .overlay-text { font-size: 0.9rem; color: var(--text-secondary); margin-top: 0.5rem; }
}
