@import 'fonts.css';
/* Marseille Tracker - Styles principaux et structure de base */

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

html {
    background: #0f172a;
    /* Bleu sombre pour éviter le fond gris/blanc au scroll élastique */
}

body {
    font-family: 'Aiglon', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: radial-gradient(ellipse at top, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.99) 70%, rgba(0, 0, 0, 1) 100%);
    color: #e2e8f0;
    overflow-x: hidden;
    overflow-y: auto;
}

.mobile-panel-heading {
    display: none;
}

.container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Panneau de carte */
.map-panel {
    width: 100%;
    height: 100vh;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 70%, rgba(0, 0, 0, 0.99) 100%);
}

/* Sur desktop, la carte ne prend que l'espace disponible (exclut le panneau) */
@media (min-width: 769px) {
    .map-panel {
        width: calc(100% - var(--info-panel-width));
        transition: width 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    body.summary-full .map-panel {
        width: 0 !important;
        opacity: 0.2;
        pointer-events: none;
    }
}

body.desktop-minimized {
    --info-panel-width: 0px !important;
}

/* Mentions légales */
.legal-notice {
    margin-top: 20px;
    padding: 10px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-align: center;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.3);
    border-radius: 0 0 12px 12px;
    margin-left: -15px;
    margin-right: -15px;
    margin-bottom: -15px;
}

.legal-notice a {
    color: #64748b;
    text-decoration: none;
    font-size: 11px;
    font-weight: 400;
    transition: color 0.2s ease;
    opacity: 0.7;
}

.legal-notice a:hover {
    color: #94a3b8;
    opacity: 1;
    text-decoration: underline;
}

.legal-source {
    color: #64748b;
    font-size: 11px;
    opacity: 0.7;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .legal-notice {
        display: none;
    }

    .legal-notice a {
        font-size: 10px;
    }
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 0;
    opacity: 1;
    background: #0f172a;
    /* Bleu sombre pour masquer le chargement des tuiles */
}

/* Contrôles MapLibre intégrés au thème */
.maplibregl-ctrl-top-left {
    margin: 14px;
}

.maplibregl-ctrl-top-right {
    margin: 14px;
}

.maplibregl-ctrl-group {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.maplibregl-ctrl button {
    color: #e2e8f0;
}

.maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
}

.maplibregl-ctrl button .maplibregl-ctrl-icon {
    filter: invert(1) brightness(2);
}

.maplibregl-ctrl-group button+button {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl.maplibregl-ctrl-attrib {
    background: rgba(15, 23, 42, 0.85) !important;
    color: #f8fafc !important;
    border-radius: 10px !important;
    padding: 6px 10px !important;
    margin: 12px 12px 0 0 !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.maplibregl-ctrl-attrib a {
    color: #f8fafc !important;
}

/* Supprimer l'attribution du bas : ne garder que celle en haut à droite */
.maplibregl-ctrl-bottom-right {
    display: none !important;
}

/* Panneau d'informations */
.info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--info-panel-width, 600px);
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 50%, rgba(30, 41, 59, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 769px) {
    body.summary-full .info-panel {
        --info-panel-width: 100vw;
        width: 100vw !important;
        left: 0;
        right: 0;
        border-left: none;
        box-shadow: none;
    }

    body.summary-full .info-panel-content {
        max-width: 700px;
        width: calc(100% - 220px);
        margin: 0 auto;
        padding-left: 32px;
        padding-right: 32px;
    }

    body.summary-full #projectCards {
        display: block !important;
        max-width: 700px;
        margin: 0 auto;
    }

    body.summary-full .summary-panel {
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Permettre l'overflow du panneau quand il y a une carte latest-project */
.info-panel.has-latest-project {
    overflow-y: auto;
    overflow-x: hidden;
}

.info-panel.medium {
    width: 600px;
}

/* .info-panel.wide {
    width: 800px;
} */
/* Les largeurs sont maintenant gérées dynamiquement par le redimensionnement libre */

/* Contenu du panneau */
.info-panel-content {
    flex: 0 0 auto;
    padding: 30px;
    padding-left: 40px;
    /* Espace pour la poignée de redimensionnement */
    overflow: visible;
    /* Le scroll est géré au niveau du panneau pour éviter les scrollbars imbriquées */
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.info-panel-header {
    margin-bottom: 30px;
    /* Plus d'espace puisqu'on a supprimé stats-container */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.info-panel-title {
    flex: 1;
}

.info-panel h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #f1f5f9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.title-text {
    flex: 1 1 auto;
}

.title-logos {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.marseillegrand-logo {
    height: 54px;
    width: auto;
    display: block;
    padding: 3px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 999px;
}

.elysee-logo {
    height: 42px;
    width: auto;
    fill: #f1f5f9;
    display: block;
}

.info-panel .subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 0;
}

.desktop-stats {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
}

.desktop-stat {
    text-align: center;
    background: radial-gradient(circle at top, rgba(51, 65, 85, 0.6) 0%, rgba(30, 41, 59, 0.8) 100%);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.desktop-stat .number {
    font-size: 24px;
    font-weight: 300;
    color: #93c5fd;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.desktop-stat .label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.drag-handle {
    display: none;
    /* Masqué sur desktop */
}

/* Header mobile - masqué sur desktop */
.mobile-header {
    display: none;
}

/* Variables CSS pour la largeur du panneau */
:root {
    --info-panel-width: 600px;
}

/* Page d'accueil / Welcome overlay */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-modal {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
}

.welcome-header {
    padding: 30px 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 41, 59, 0.1) 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.welcome-header h1 {
    font-size: 32px;
    font-weight: 300;
    margin-bottom: 10px;
    color: #f1f5f9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-header .subtitle {
    font-size: 16px;
    color: #94a3b8;
    line-height: 1.4;
}

.welcome-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.welcome-description {
    font-size: 16px;
    line-height: 1.6;
    color: #cbd5e1;
    text-align: center;
    margin-bottom: 30px;
}

.welcome-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    text-align: center;
    padding: 20px;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: transform 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}

.feature-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #f1f5f9;
}

.feature-description {
    font-size: 13px;
    line-height: 1.4;
    color: #94a3b8;
}

.welcome-cta {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.start-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.28);
    text-transform: none;
    letter-spacing: 0.5px;
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.start-button:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(59, 130, 246, 0.26);
}

.start-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}

.start-button:focus {
    outline: none;
    box-shadow: 0 5px 14px rgba(59, 130, 246, 0.26), 0 0 0 2px rgba(59, 130, 246, 0.25);
}

/* Mode guidé : interface épurée */
body.guided-mode .navigation-tabs,
body.guided-mode .timeline-container,
body.guided-mode .thematic-view,
body.guided-mode .desktop-stats,
body.guided-mode .stats-container,
body.guided-mode .mobile-stats {
    display: none !important;
}

.is-hidden {
    display: none !important;
}

body.guided-mode .info-panel-content {
    padding-top: 20px;
}

/* Mettre la carte en avant pendant la visite guidée */
body.guided-mode {
    --info-panel-width: 520px;
}

body.guided-mode .info-panel {
    width: var(--info-panel-width);
}

/* Overlay de transition entre thématiques */
.guided-theme-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 6000;
    background: transparent;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.guided-theme-overlay.is-visible {
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.guided-theme-name {
    font-size: clamp(46px, 10vw, 92px);
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--theme-overlay-color, #3b82f6);
    opacity: 0;
    transform: translateY(22px) scale(0.94);
}

.guided-theme-overlay.is-visible .guided-theme-name {
    animation: guidedThemeReveal 1.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes guidedThemeReveal {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(0.94);
    }
    35% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 1;
        transform: translateY(-4px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-14px) scale(1);
    }
}
