/* ===== Variables CSS ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --bg-card: #12121a;
    --bg-hover: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #8a8a9a;
    --text-muted: #5a5a6a;
    --accent-blue: #00b4ff;
    --accent-purple: #7b61ff;
    --accent-green: #00ff88;
    --accent-orange: #ff9500;
    --accent-red: #ff3b5c;
    --border-color: #2a2a3a;
    --glow-blue: 0 0 20px rgba(0, 180, 255, 0.3);
    --glow-green: 0 0 20px rgba(0, 255, 136, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 320px;
    height: 100vh;
    background: var(--bg-darker);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-darker));
}

.sidebar-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-item:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--glow-blue);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sections */
.timeline-section,
.filters-section,
.legend-section,
.info-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.timeline-section h3,
.filters-section h3,
.legend-section h3,
.info-section h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Timeline */
.timeline-container {
    margin-bottom: 15px;
}

#time-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: var(--bg-card);
    border-radius: 4px;
    outline: none;
    margin-bottom: 10px;
}

#time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--glow-blue);
    transition: var(--transition);
}

#time-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.time-display {
    text-align: center;
    margin-bottom: 8px;
}

#current-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-blue);
    font-variant-numeric: tabular-nums;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.play-button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-blue);
}

.play-button.playing {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
}

/* Filters */
.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.checkbox-group {
    display: flex;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-item input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: var(--transition);
}

.checkmark.metro {
    border-color: var(--accent-blue);
}

.checkmark.rer {
    border-color: var(--accent-orange);
}

.checkbox-item input:checked + .checkmark {
    background: var(--accent-blue);
}

.checkbox-item input:checked + .checkmark.rer {
    background: var(--accent-orange);
}

.checkbox-item input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

/* Lines Grid */
.lines-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.line-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.line-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px currentColor;
}

.line-btn.active {
    border-color: white;
    box-shadow: 0 0 20px currentColor;
}

.line-btn.inactive {
    opacity: 0.3;
    filter: grayscale(100%);
}

/* Flux Legend */
.flux-legend {
    display: flex;
    justify-content: space-between;
}

.flux-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.flux-indicator {
    width: 30px;
    height: 8px;
    border-radius: 4px;
}

.flux-indicator.low {
    background: var(--accent-green);
    opacity: 0.4;
}

.flux-indicator.medium {
    background: var(--accent-orange);
    opacity: 0.7;
}

.flux-indicator.high {
    background: var(--accent-red);
    animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-red); }
    50% { box-shadow: 0 0 20px var(--accent-red); }
}

/* Info Section */
.info-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.data-source {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Map Container ===== */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-dark);
}

#map {
    width: 100%;
    height: 100%;
}

/* Map SVG Styles */
#map svg {
    width: 100%;
    height: 100%;
}

.district {
    fill: var(--bg-card);
    stroke: var(--border-color);
    stroke-width: 0.5px;
    transition: var(--transition);
}

.district:hover {
    fill: var(--bg-hover);
}

.metro-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: var(--transition);
}

.metro-line.dimmed {
    opacity: 0.2;
}

.station {
    cursor: pointer;
    transition: var(--transition);
}

.station circle {
    fill: var(--bg-dark);
    stroke: white;
    stroke-width: 2px;
}

.station:hover circle {
    fill: var(--accent-blue);
    r: 8;
}

.station.major circle {
    r: 6;
    stroke-width: 3px;
}

.station-label {
    font-size: 10px;
    fill: var(--text-secondary);
    pointer-events: none;
    opacity: 0;
    transition: var(--transition);
}

.station:hover + .station-label,
.station-label.visible {
    opacity: 1;
}

/* Particles Animation */
.particle {
    fill: white;
    opacity: 0.9;
    filter: blur(0.5px);
}

.particle.high-traffic {
    fill: var(--accent-orange);
    filter: drop-shadow(0 0 3px var(--accent-orange));
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 250px;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-title {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
}

.tooltip-lines {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tooltip-line {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
}

.tooltip-stat {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.tooltip-stat strong {
    color: var(--accent-green);
}

/* Station Panel */
.station-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    z-index: 200;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.station-panel.hidden {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.station-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-right: 30px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--accent-red);
    color: white;
}

.station-lines {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.station-line-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}

.station-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.station-stat {
    background: var(--bg-hover);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.station-stat .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.station-stat .stat-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Map Controls */
.map-controls {
    position: absolute;
    bottom: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* Bottom Stats */
.bottom-stats {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px 30px;
    z-index: 100;
}

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

.mini-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.mini-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes train-move {
    0% { offset-distance: 0%; }
    100% { offset-distance: 100%; }
}

.train-particle {
    offset-rotate: 0deg;
    animation: train-move linear infinite;
}

/* Flow lines animation */
@keyframes flow-dash {
    to {
        stroke-dashoffset: -20;
    }
}

.flow-line {
    stroke-dasharray: 5 10;
    animation: flow-dash 1s linear infinite;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: -320px;
        transition: left 0.3s ease;
        z-index: 200;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .bottom-stats {
        display: none;
    }
}

/* ===== Paris Map Elements ===== */

/* Arrondissements */
.arrondissements-group path {
    transition: all 0.3s ease;
}

.arrond-label {
    pointer-events: none;
    user-select: none;
    font-family: 'Inter', sans-serif;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Seine river */
.seine {
    filter: drop-shadow(0 0 8px rgba(0, 150, 255, 0.3));
}

.seine-bright {
    animation: river-flow 3s linear infinite;
}

@keyframes river-flow {
    0% { stroke-opacity: 0.3; }
    50% { stroke-opacity: 0.6; }
    100% { stroke-opacity: 0.3; }
}

/* Monuments */
.monument {
    transition: transform 0.2s ease;
}

.monument:hover {
    transform: scale(1.1);
}

.monument-icon {
    filter: drop-shadow(0 0 4px rgba(255, 200, 100, 0.5));
    pointer-events: none;
}

.monument-label {
    pointer-events: none;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Inter', sans-serif;
}

.monument-glow {
    transition: all 0.3s ease;
}

/* Islands */
.islands-group path {
    filter: drop-shadow(0 0 3px rgba(100, 160, 220, 0.3));
}

/* Bois (forests) */
.bois-group text {
    pointer-events: none;
    font-style: italic;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

/* Périphérique */
.peripherique {
    animation: periph-dash 30s linear infinite;
}

@keyframes periph-dash {
    to {
        stroke-dashoffset: -100;
    }
}

/* Enhanced particle glow */
.particle {
    mix-blend-mode: screen;
}

/* Tooltip enhancements for monuments */
.tooltip .tooltip-stat {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ===== Île-de-France ===== */
.idf-group {
    pointer-events: none;
}

.idf-contour {
    transition: all 0.5s ease;
}

/* ===== Section Perturbation ===== */
.disruption-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(255, 59, 92, 0.05), transparent);
}

.disruption-section h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.disruption-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.disruption-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.disruption-select:hover {
    border-color: var(--accent-red);
}

.disruption-select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 3px rgba(255, 59, 92, 0.2);
}

.disruption-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.disruption-btn {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 59, 92, 0.2), rgba(255, 59, 92, 0.1));
    border: 1px solid rgba(255, 59, 92, 0.3);
    border-radius: 8px;
    color: var(--accent-red);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.disruption-btn:hover {
    background: linear-gradient(135deg, rgba(255, 59, 92, 0.3), rgba(255, 59, 92, 0.2));
    transform: translateY(-1px);
}

.disruption-btn.active {
    background: var(--accent-red);
    color: white;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 59, 92, 0); }
}

.disruption-info {
    background: rgba(255, 59, 92, 0.1);
    border: 1px solid rgba(255, 59, 92, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.disruption-info.hidden {
    display: none;
}

.disruption-text {
    color: var(--accent-red);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.disruption-impact {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Ligne perturbée */
.metro-line.disrupted {
    animation: disrupted-line 1s infinite;
}

@keyframes disrupted-line {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Lignes avec flux augmenté */
.metro-line.increased-flux {
    stroke-width: 6px !important;
}

.metro-line-glow.increased-flux {
    stroke-width: 14px !important;
    opacity: 0.5 !important;
}

/* Lignes masquées */
.metro-line.dimmed {
    opacity: 0 !important;
    pointer-events: none;
}

/* ===== Animation lignes filtrées ===== */
.metro-line {
    transition: opacity 0.3s ease, stroke-width 0.3s ease;
}

.station {
    transition: opacity 0.3s ease;
}

