/* ============================================
   Map Page - Specific Styles
   For index.html (cluster map with timeline)
   ============================================ */

body {
    overflow: hidden;
}

#map {
    width: 100vw;
    height: calc(100vh - 148px);
    margin-top: 60px;
}

.controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.button-group {
    display: flex;
    gap: 8px;
}

.control-button {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.control-button:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.control-button.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

.play-button {
    background: #3b82f6;
    padding: 12px 28px;
    font-size: 16px;
}

.play-button:hover {
    background: #2563eb;
}

/* Slider container with locked zone */
.slider-container {
    position: relative;
    flex: 1;
    min-width: 300px;
    display: flex;
    align-items: center;
}

.timeline-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    z-index: 2;
}

.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.timeline-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
    position: relative;
    z-index: 2;
}

.timeline-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Locked zone overlay (visual representation on slider) */
.slider-locked-overlay {
    position: absolute;
    left: 0;
    top: 0;
    height: 8px;
    background: repeating-linear-gradient(
        45deg,
        rgba(239, 68, 68, 0.15),
        rgba(239, 68, 68, 0.15) 10px,
        rgba(239, 68, 68, 0.25) 10px,
        rgba(239, 68, 68, 0.25) 20px
    );
    border-radius: 4px 0 0 4px;
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid rgba(239, 68, 68, 0.5);
}

.locked-pattern {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(239, 68, 68, 0.2) 0%,
        rgba(239, 68, 68, 0.1) 100%
    );
    border-radius: 4px 0 0 4px;
}

.locked-icon {
    position: relative;
    font-size: 14px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    z-index: 2;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.time-display {
    font-size: 18px;
    font-weight: 600;
    min-width: 180px;
    text-align: right;
    color: #3b82f6;
}

/* Period selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.period-button {
    min-width: 60px;
}

.period-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.period-button:disabled:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Speed control */
.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.stats {
    position: fixed;
    top: 80px;
    left: 50px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    min-width: 240px;
}

.stats h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 15px;
}

.stat-main {
    font-size: 36px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 10px;
}

.stat-categories {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: 13px;
}

.stat-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-category-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stat-category-value {
    font-weight: 600;
    color: #fff;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    text-align: center;
}

.loading-text {
    font-size: 24px;
    color: #3b82f6;
    margin-bottom: 20px;
}

.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.preload-indicator {
    position: fixed;
    bottom: 160px;
    right: 20px;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.preload-indicator.visible {
    opacity: 1;
}

/* Panneau de filtres */
.filter-panel {
    position: fixed;
    top: 80px;
    left: -320px;
    width: 300px;
    height: calc(100vh - 230px);
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 12px 12px 0;
    border-left: none;
    padding: 20px;
    z-index: 1500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.filter-panel.open {
    left: 0;
}

.filter-toggle {
    position: fixed;
    top: 200px;
    left: 0;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: none;
    padding: 12px 8px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    z-index: 1600;
    font-size: 18px;
    transition: all 0.2s;
    box-shadow: 2px 0 8px rgba(0,0,0,0.3);
}

.filter-toggle:hover {
    background: rgba(59, 130, 246, 1);
    padding-right: 12px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 12px;
    font-weight: 600;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.filter-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.filter-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.filter-count {
    margin-left: auto;
    font-size: 12px;
    color: #888;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 10px;
}

.filter-stats {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.filter-stats-number {
    font-size: 24px;
    font-weight: 700;
    color: #3b82f6;
}

.filter-reset {
    width: 100%;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 16px;
}

.filter-reset:hover {
    background: rgba(239, 68, 68, 0.3);
}

.legend {
    position: fixed;
    display: none;
    top: 80px;
    right: 20px;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.legend h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    font-size: 13px;
}

.legend-circle {
    border-radius: 50%;
    border: 2px solid;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-label {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.skip, .audio-toggle, .supercluster-toggle {
position: fixed; z-index: 30;
background: rgba(0,0,0,0.06); color: var(--fg);
border: 1px solid rgba(0,0,0,0.08); backdrop-filter: blur(6px);
padding: 8px 12px; font-size: 14px; border-radius: 999px;
cursor: pointer; transition: transform 150ms ease, opacity 200ms ease;
}
.skip { inset: 16px 16px auto auto; }
.audio-toggle { inset: auto 16px 16px auto; }
.supercluster-toggle { inset: auto 140px 16px auto; }
.skip:hover, .audio-toggle:hover, .supercluster-toggle:hover { transform: translateY(-1px); }
.supercluster-toggle[aria-pressed="true"] { background: rgba(251, 191, 36, 0.2); border-color: #f59e0b; color: #f59e0b; }

/* Animation pour clusters overlapping - utilise stroke pour SVG */
@keyframes pulse-glow {
    0%, 100% {
        stroke-width: 2;
        stroke-opacity: 0.8;
    }
    50% {
        stroke-width: 4;
        stroke-opacity: 1;
    }
}

.overlapping-cluster {
    cursor: pointer !important;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* Bouton toggle pour stats sur mobile */
.stats-toggle {
    display: none; /* Masqué par défaut sur desktop */
    position: fixed;
    bottom: 180px;
    left: 16px;
    z-index: 1001;
    background: rgba(59, 130, 246, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
}

.stats-toggle:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.05);
}

/* Responsive mobile */
@media (max-width: 768px) {
    .stats {
        display: none; /* Masqué par défaut sur mobile */
        top: 70px;
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        padding: 16px;
        min-width: auto;
    }

    .stats.visible {
        display: block !important; /* Affiché quand classe visible ajoutée */
    }

    .stats-toggle {
        display: flex !important; /* Visible sur mobile */
    }

    .filter-panel {
        width: 90% !important;
        max-width: 320px;
    }

    .filter-stats {
        font-size: 14px;
    }

    .filter-stats-number {
        font-size: 32px;
    }
}

/* Login Overlay (mode preview) */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.login-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.login-overlay-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: slideUp 0.4s ease;
}

.login-overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 8px;
}

.login-overlay-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.login-overlay-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.login-overlay-content h2 {
    color: white;
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 600;
}

.login-overlay-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.login-overlay-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.login-overlay-btn {
    flex: 1;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-overlay-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-overlay-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-overlay-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.login-overlay-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.login-overlay-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-overlay-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.login-overlay-feature-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .login-overlay-content {
        padding: 32px 24px;
    }

    .login-overlay-buttons {
        flex-direction: column;
    }

    .login-overlay-content h2 {
        font-size: 24px;
    }

    .login-overlay-icon {
        font-size: 48px;
    }
}

