:root {
    --primary-color: #3b82f6;
    --overlay-bg: rgba(15, 23, 42, 0.8);
    --text-color: #f8fafc;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: #0f172a;
    color: var(--text-color);
    overflow: hidden;
}

#map {
    height: 100vh;
    width: 100vw;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--overlay-bg);
    padding: 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 320px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.overlay-toggle-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 999;
    width: 50px;
    height: 50px;
    background: var(--overlay-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.overlay-toggle-btn:hover {
    background: rgba(15, 23, 42, 0.95);
}

.overlay-toggle-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-color);
}

.overlay-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.overlay-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.overlay-close-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-color);
}

/* Overlay Header */
.overlay-header {
    margin-bottom: 0.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.overlay-logo {
    height: 85px;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.overlay-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overlay-header-text h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    /* line-height: 1.2; */
}

.overlay-header-text h1 .keep-light {
    font-weight: 300;
}

.overlay-header-text h1 .cam-bold {
    font-weight: 700;
}

.slogan-container {
    height: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    margin-top: -2px;
}

.slogan-animated {
    display: block;
    font-weight: 400;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    opacity: 1;
    transform: rotateX(0deg);
    transform-origin: center center;
}

@keyframes rollIn {
    0% {
        opacity: 0;
        transform: rotateX(-90deg);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
        transform: rotateX(0deg);
    }
}

.slogan-animated.roll-out {
    animation: rollOut 0.5s ease-in forwards;
}

@keyframes rollOut {
    0% {
        opacity: 1;
        transform: rotateX(0deg);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: rotateX(90deg);
    }
}

.slogan-animated.roll-in {
    animation: rollIn 0.5s ease-out forwards;
}

.overlay-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.overlay-subtitle p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.overlay-subtitle .about-btn {
    flex-shrink: 0;
}

.routes-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.routes-section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    flex-shrink: 0;
}

#routes-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
}

/* Scrollbar personnalisée discrète */
#routes-list::-webkit-scrollbar {
    width: 6px;
}

#routes-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#routes-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background 0.2s ease;
}

#routes-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox */
#routes-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

.route-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.route-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.route-item.inactive {
    opacity: 0.4;
}

.route-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}

.route-info {
    flex: 1;
    min-width: 0;
}

.route-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-toggle {
    width: 40px;
    height: 20px;
    background: rgba(100, 100, 100, 0.5);
    border-radius: 10px;
    position: relative;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.route-toggle.active {
    background: #4ade80;
}

.route-toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.route-toggle.active::after {
    transform: translateX(20px);
}

.toggle-all-btn {
    width: 100%;
    padding: 0.5rem;
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-all-btn:hover {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.5);
}

/* Responsive : Mobile */
@media (max-width: 768px) {
    .overlay {
        transform: translateX(calc(-100% - 40px));
        opacity: 0;
        max-width: none;
        max-height: calc(100vh - 100px);
        left: 20px;
        right: 20px;
    }

    .overlay.visible {
        transform: translateX(0);
        opacity: 1;
    }

    .overlay-toggle-btn {
        display: flex;
    }

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

    .overlay-close-btn {
        display: flex;
    }
}

.overlay h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.5;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    padding: 0.25rem 0.75rem;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Custom marker style */
.bus-marker {
    background-color: #3b82f6;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

/* Transition fluide pour les déplacements et rotations */
.custom-bus-marker {
    transition: transform 1s linear;
}

.bus-marker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bus-circle {
    position: absolute;
    z-index: 2;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bus-arrow {
    position: absolute;
    z-index: 1;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 9px solid white;
    top: -10px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition: transform 0.5s ease;
}

/* Désactive la transition pendant le zoom Leaflet */
.leaflet-zoom-anim .custom-bus-marker {
    transition: none;
}

/* Masquer le drapeau ukrainien dans l'attribution Leaflet */
.leaflet-control-attribution a[href*="ukraine"] {
    display: none !important;
}

/* Bouton À propos */
.about-btn {
    width: 28px;
    height: 28px;
    background: rgba(96, 165, 250, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #60a5fa;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.about-btn:hover {
    background: rgba(96, 165, 250, 0.3);
    border-color: rgba(96, 165, 250, 0.5);
}

/* Modal À propos */
.about-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.about-modal.visible {
    display: flex;
}

.about-content {
    background: var(--overlay-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.about-content h2 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.about-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.about-content .credits {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    opacity: 0.8;
}

.about-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.about-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.about-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-color);
}
