/* --- APPLE AESTHETIC DESIGN SYSTEM --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Apple Colors */
    --bg-page: #F5F5F7;      
    --bg-card: #FFFFFF;       
    --text-primary: #1D1D1F;  
    --text-secondary: #86868B;
    --accent: #007AFF;        
    --accent-hover: #0071E3;
    
    /* Chart Colors */
    --chart-1: #32ADE6;
    --chart-2: #007AFF;
    --chart-3: #5856D6;
    --chart-4: #AF52DE;

    /* Spacing & Radius */
    --radius-card: 24px;
    --radius-btn: 999px;
    --padding-card: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 40px;
}

/* --- NAVIGATION (Frosted Glass) --- */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(245, 245, 247, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 12px 0;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-btn);
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.8);
}

nav a.active {
    background: var(--text-primary);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* --- HEADER --- */
header {
    text-align: center;
    padding: 60px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-secondary);
}

/* --- LAYOUT GRID (Bento Box) --- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
}

/* --- CARDS --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: var(--padding-card);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255,255,255,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

/* Cell sizing for Bento Grid */
.col-span-2 { grid-column: span 2; }
.col-span-1 { grid-column: span 1; }
/* Mobile Adjustment */
@media (max-width: 900px) {
    .dashboard-grid { display: flex; flex-direction: column; }
    h1 { font-size: 36px; }
}

/* Card Headers */
.card h3 {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
}

/* --- CONTROLS & BUTTONS --- */
.controls {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #F5F5F7;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 2px;
}

button.btn-chart {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

button.btn-chart.active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* --- VISUALS --- */
.chart-container { position: relative; height: 300px; width: 100%; }
.chart-radar-container { height: 250px; display: flex; justify-content: center; }
.chart-pie-container { height: 200px; display: flex; justify-content: center; }

select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background-color: #F5F5F7;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 20px;
    outline: none;
    cursor: pointer;
}

.image-viewer {
    width: 100%;
    aspect-ratio: 16/9;
    background: #F5F5F7;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.image-viewer img { width: 100%; height: 100%; object-fit: cover; display: none; }
.no-image-text { color: var(--text-secondary); font-size: 13px; font-weight: 500; }

/* --- DYNAMIC DESCRIPTION --- */
#description-box {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #F5F5F7;
}
.desc-title { font-weight: 600; color: var(--text-primary); display: block; margin-bottom: 4px; }
.desc-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.btn-see-more {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.btn-see-more:hover { text-decoration: underline; }

/* --- TABLES --- */
.table-scroll-container { max-height: 250px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding-bottom: 10px;
    position: sticky;
    top: 0;
    background: white;
}
td {
    padding: 10px 0;
    border-bottom: 1px solid #F5F5F7;
    font-size: 13px;
    color: var(--text-primary);
}
.heatmap-cell {
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    padding: 4px;
}

/* --- FOOTER --- */
footer {
    text-align: center;
    margin-top: 60px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid #E5E5E5;
    padding-top: 30px;
}
footer a { color: var(--accent); text-decoration: none; }
#countdown { margin-top: 10px; font-variant-numeric: tabular-nums; }
#countdown span { color: var(--text-primary); font-weight: 600; }

/* --- PAGE SPECIFIC --- */
.page-container { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.hero-section { text-align: center; padding: 60px 0; }
.tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(0, 122, 255, 0.1);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 16px;
}
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
}
@media (max-width: 600px) { .project-grid { grid-template-columns: 1fr; } }

.project-card { border: none; box-shadow: none; padding: 0; background: transparent; }
.project-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    border: 1px solid rgba(0,0,0,0.05);
}
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.project-image:hover img { transform: scale(1.05); }


/* --- LIGHTBOX (Zoom Image) --- */

/* L'arrière-plan sombre flouté */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(10px);      
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000; 
    display: none; 
    justify-content: center;
    align-items: center;
    cursor: zoom-out; 
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#lightbox-overlay.active img {
    transform: scale(1);
}

.project-image img, 
.image-viewer img {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.project-image img:hover, 
.image-viewer img:hover {
    transform: scale(1.02); 
}

.kpi-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.kpi-card:hover { transform: translateY(-3px); }

.kpi-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.kpi-value {
    display: block;
    font-size: 36px; 
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-c1 .kpi-value { color: #32ADE6; }
.kpi-c2 .kpi-value { color: #007AFF; }
.kpi-c3 .kpi-value { color: #5856D6; }
.kpi-c4 .kpi-value { color: #AF52DE; }

@media (max-width: 800px) {
    .kpi-container { grid-template-columns: 1fr 1fr; }
}


.mb-large { margin-bottom: 30px; }


.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.btn-capsule {
    background: #f5f5f7;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-capsule:hover {
    background: #e5e5ea;
    color: var(--text-primary);
    transform: scale(1.02);
}

.project-selector {
    position: relative;
}

.dropdown-menu {
    display: none; 
    position: absolute;
    top: 110%;
    right: 0;
    width: 240px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.05);
    z-index: 100;
    overflow: hidden;
    animation: fadeInScale 0.2s ease;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    border-bottom: 1px solid #f5f5f7;
}

.dropdown-item:hover { background: #f5f5f7; color: #007AFF; }
.dropdown-item:last-child { border-bottom: none; }

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 30px;
}

.evidence-card {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.evidence-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.img-wrapper {
    width: 100%;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.img-wrapper img:hover { transform: scale(1.03); }

@media (max-width: 700px) {
    .evidence-grid { grid-template-columns: 1fr; }
    .card-header-row { flex-direction: column; gap: 10px; }
    .project-selector { width: 100%; }
    .btn-capsule { width: 100%; text-align: center; }
    .dropdown-menu { width: 100%; }
}

.highlight-card {
    overflow: visible !important;
}