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

html, body {
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height pour gérer la barre d'adresse sur mobile */
}

/* Écran de chargement */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeOut 0.5s ease-out 4.5s forwards;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #1a1a1a;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Desktop : pas de scroll sur le body, juste sur la sidebar */
@media (min-width: 769px) {
    body {
        overflow: hidden;
        height: 100vh;
    }
    
    .app {
        height: 100vh;
    }
    
    .sidebar {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        height: 100vh;
    }
    
    .sidebar-header,
    .search-container,
    .filters {
        flex-shrink: 0;
    }
    
    .sidebar-scrollable-content {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex: 1 1 auto;
        min-height: 0;
        max-height: 100%;
    }
    
    .incidents-list {
        overflow-y: visible !important;
        flex: 0 0 auto;
    }
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
}

.app-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Footer */
.app-footer {
    width: 100%;
    background-color: #000000;
    border-top: 1px solid #3d3d3d;
    padding: 1rem 2rem;
    z-index: 100;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-powered {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #aaa;
}

.footer-logo {
    height: 24px;
    width: auto;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #aaa;
}

@media (max-width: 768px) {
    .app-footer {
        padding: 0.75rem 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .footer-powered {
        font-size: 0.8rem;
    }

    .footer-logo {
        height: 20px;
    }

    .footer-copyright {
        font-size: 0.8rem;
    }
}

/* Notification Banner */
.notification-banner {
    width: 100%;
    background-color: #4ade80;
    color: #000000;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.notification-content svg {
    flex-shrink: 0;
}

.notification-close {
    background: none;
    border: none;
    color: #000000;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    opacity: 0.7;
}

.notification-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 1;
}

/* Sidebar */
.sidebar {
    width: 33.333%;
    max-width: 400px;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #3d3d3d;
    flex: 0 0 33.333%;
    min-height: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d3d;
    position: relative;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s;
    position: absolute;
    left: 1rem;
    z-index: 10;
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    margin-left: auto;
    margin-right: auto;
}

.auth-button {
    display: none;
    position: absolute;
    right: 1.5rem;
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #000000;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.auth-button:hover {
    background-color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.5);
}

.auth-button-filter {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #000000;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}

.auth-button-filter:hover {
    background-color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Modal de connexion/inscription */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    background-color: #000000;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #3d3d3d;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
}

.view-details-button {
    display: none;
    padding: 0.5rem 1rem;
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.view-details-button:hover {
    background-color: #252525;
    border-color: #555;
}

.view-map-button-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.view-map-button-mobile:hover {
    background-color: #252525;
    border-color: #555;
}

.view-map-button-mobile svg {
    flex-shrink: 0;
}

.logo {
    height: 32px;
    width: auto;
}

.icon-button {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: #3d3d3d;
}

/* Search */
.search-container {
    position: relative;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d3d;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #555;
}

.search-input::placeholder {
    color: #888;
}

.search-icon {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

/* Filters */
.filters {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d3d;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.85rem;
    color: #aaa;
    font-weight: 500;
}

.filter-select {
    padding: 0.6rem;
    background-color: #1a1a1a !important;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #ffffff !important;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover,
.filter-select:focus {
    border-color: #555;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

.filter-select option {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    padding: 0.5rem;
}

/* Forcer le texte du select à ne pas avoir de background rouge */
.filter-select,
.filter-select:focus,
.filter-select:active,
.filter-select:hover {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

/* Styles pour le texte sélectionné dans le select */
.filter-select::-ms-value {
    background-color: transparent !important;
    color: #ffffff !important;
}

.filter-select::-webkit-select-value {
    background-color: transparent !important;
    color: #ffffff !important;
}

.filter-select::-webkit-select-placeholder {
    background-color: transparent;
    color: #ffffff;
}

.filter-select::-moz-placeholder {
    background-color: transparent;
    color: #ffffff;
}

.filters-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filters-button:hover {
    background-color: #252525;
}

/* Container scrollable pour communiqués + liste */
.sidebar-scrollable-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* Official Announcements Section */
.official-announcements {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #3d3d3d;
}

.announcements-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.announcements-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.announcements-scroll::-webkit-scrollbar {
    height: 6px;
}

.announcements-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.announcements-scroll::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.announcements-scroll::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.announcement-card {
    min-width: 280px;
    max-width: 280px;
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}

.announcement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.announcement-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3px;
    flex-shrink: 0;
}

.announcement-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.announcement-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-badge img {
    height: 20px;
    width: auto;
}

.announcement-content {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.announcement-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.announcement-service {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.announcement-time {
    font-size: 0.7rem;
    color: #888;
    white-space: nowrap;
}

.announcement-text {
    font-size: 0.75rem;
    color: #aaa;
    line-height: 1.3;
    margin: 0;
}

.confirm-outage-button {
    width: 100%;
    padding: 0.6rem 1rem;
    background-color: #dc2626;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 0.5rem;
}

.confirm-outage-button:hover {
    background-color: #b91c1c;
}

.confirm-outage-button:active {
    background-color: #991b1b;
}

.announcement-resolution {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #2d2d2d;
}

.resolution-label {
    font-size: 0.7rem;
    color: #888;
}

.resolution-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #60a5fa;
}

/* Composant de décompte de résolution */
.announcement-resolution-countdown {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #2d2d2d;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Dans la liste des incidents (sidebar) */
.incident-info .announcement-resolution-countdown {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #2d2d2d;
    gap: 0.4rem;
}

.resolution-countdown-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.resolution-countdown-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #39ff14;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.resolution-progress-bar {
    width: 100%;
    height: 4px;
    background-color: #2d2d2d;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

/* Ajustements pour la liste des incidents */
.incident-info .resolution-label {
    font-size: 0.65rem;
}

.incident-info .resolution-countdown-time {
    font-size: 0.7rem;
}

.incident-info .resolution-progress-bar {
    height: 3px;
}

.resolution-progress-fill {
    height: 100%;
    background-color: #39ff14;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Barre de progression orange pour les résolutions en attente */
.resolution-progress-bar-pending {
    position: relative;
    overflow: hidden;
}

.resolution-progress-fill-pending {
    height: 100%;
    width: 40%;
    background-color: #ff6b35;
    border-radius: 2px;
    position: absolute;
    animation: slidePending 2s ease-in-out infinite;
}

@keyframes slidePending {
    0% {
        left: -40%;
    }
    100% {
        left: 100%;
    }
}

/* Incidents List */
.incidents-list {
    flex: 1;
    overflow-y: visible;
    padding: 0.5rem 0;
    min-height: 0;
}

.incidents-list::-webkit-scrollbar {
    width: 6px;
}

.incidents-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.incidents-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.incidents-list::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.incident-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    transition: background-color 0.2s, border-color 0.2s;
    border-bottom: 1px solid #3d3d3d;
    border-left: 3px solid transparent;
    gap: 1rem;
}

.incident-item:hover {
    background-color: #252525;
}

@media (max-width: 768px) {
    .incident-item {
        cursor: pointer;
    }
}

@media (min-width: 769px) {
    .view-details-button {
        display: block;
    }
}

.incident-item.selected {
    border-left: none;
    background-color: #000000;
    border-color: transparent;
}

.incident-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    overflow: hidden;
    padding: 4px;
}

.incident-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.incident-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.incident-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
}

.incident-details {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #aaa;
}

.incident-distance {
    color: #aaa;
}

.incident-status-container {
    width: 100%;
    margin-top: 0.25rem;
}

.incident-status {
    color: #ff6b6b;
    display: block;
}

.incident-status.functional {
    color: #4ade80 !important;
}

.incident-status.warning {
    color: #fbbf24 !important;
}

.incident-status.recovery {
    color: #60a5fa !important;
}

.incident-time {
    font-size: 0.8rem;
    color: #888;
}

.incident-reports {
    font-size: 0.9rem;
    color: #aaa;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

.incident-action {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}

.incident-action:hover {
    color: #ffffff;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background-color: #1a1a1a;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5), 0 10px 40px rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.close-map-button {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background-color: #2d2d2d;
    border: 1px solid #3d3d3d;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.close-map-button:hover {
    background-color: #3d3d3d;
}

/* Report Button */
.report-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: #ff0000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.report-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.report-button:active {
    transform: translateY(0);
}

.report-button svg {
    flex-shrink: 0;
}

.map {
    width: 100%;
    height: 100%;
    transform: perspective(1000px) rotateX(2deg);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* Leaflet overrides pour le thème sombre */
.leaflet-container {
    background-color: #1a1a1a;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 30px rgba(0, 0, 0, 0.2);
    border-radius: 0;
}

.leaflet-control-zoom a {
    background-color: #2d2d2d;
    color: #ffffff;
    border: 1px solid #3d3d3d;
}

.leaflet-control-zoom a:hover {
    background-color: #3d3d3d;
}

.leaflet-control-attribution {
    background-color: rgba(45, 45, 45, 0.8);
    color: #aaa;
    font-size: 0.75rem;
}

.leaflet-control-attribution a {
    color: #888;
}

/* Leaflet Markers - Points rouges */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-point {
    position: relative;
    cursor: pointer;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.red-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff0000;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.5);
    transition: transform 0.2s;
}

.marker-point:hover .red-dot {
    transform: scale(1.3);
    box-shadow: 0 2px 12px rgba(255, 0, 0, 0.7);
}

/* Marqueur de position utilisateur */
.user-location-marker {
    background: transparent;
    border: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Marqueurs avec pastilles de temps */
.time-marker {
    background: transparent !important;
    border: none !important;
}

.time-marker div {
    cursor: pointer;
}

/* Popup unifié - détails + graphique */
.popup-unified {
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    left: 2rem;
    width: 900px;
    max-width: calc(100% - 4rem);
    max-height: calc(100vh - 4rem);
    background-color: #000000;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #3d3d3d;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.popup-chart-container {
    width: 100%;
    flex: 1 1 auto;
    min-height: 300px;
    background-color: #000000;
    border-radius: 8px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.chart-popup {
    width: 100%;
    height: 100%;
    flex: 1;
    display: block;
    min-height: 300px;
    position: relative;
}

.chart-popup canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

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

.popup-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3d3d3d;
    position: relative;
}

.close-popup-button {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background-color: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.close-popup-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.close-popup-button:active {
    transform: scale(0.95);
}

.popup-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
    overflow: hidden;
    padding: 6px;
}

.popup-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

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

.popup-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.popup-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #aaa;
}

.popup-meta .status-functional {
    color: #4ade80;
}

.popup-meta .status-outage {
    color: #ff6b6b;
}

.popup-meta .status-warning {
    color: #fbbf24;
}

.popup-meta .status-recovery {
    color: #60a5fa;
}

.popup-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3d3d3d;
}

.popup-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

.popup-stat svg {
    color: #888;
}

.popup-description {
    margin-bottom: 1rem;
}

.popup-description h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.popup-description p {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.5;
}

.panne-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.panne-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #2d2d2d;
}

.panne-type {
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 500;
}

.panne-percentage {
    font-size: 0.85rem;
    color: #60a5fa;
    font-weight: 600;
}

/* Section Communiqué Officiel dans le popup */
.popup-official-announcement {
    margin-bottom: 1rem;
}

.popup-official-announcement .announcements-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.popup-official-announcement .announcements-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #555 #1a1a1a;
}

.popup-official-announcement .announcements-scroll::-webkit-scrollbar {
    height: 6px;
}

.popup-official-announcement .announcements-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.popup-official-announcement .announcements-scroll::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.popup-official-announcement .announcements-scroll::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.popup-official-announcement .announcement-card {
    min-width: 280px;
    max-width: 280px;
    flex-shrink: 0;
}

.popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.popup-buttons-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.popup-button {
    flex: 1;
    padding: 0.75rem;
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.popup-stats .popup-button {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.popup-button:hover {
    background-color: #252525;
    border-color: #555;
}

.popup-button-primary {
    background-color: #1a1a1a;
}

.popup-button-secondary {
    background-color: #ff0000;
    border-color: #ff0000;
}

.popup-button-secondary:hover {
    background-color: #cc0000;
    border-color: #cc0000;
}

.popup-button-comments {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
    color: #ffffff;
    width: 100%;
}

.popup-button-comments:hover {
    background-color: #3d3d3d;
    border-color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        -webkit-overflow-scrolling: touch;
    }

    .app {
        flex-direction: column;
        overflow-x: hidden;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 !important;
        min-height: 100vh;
        min-height: 100dvh;
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Sur mobile, le container scrollable prend tout l'espace disponible */
    .sidebar-scrollable-content {
        flex: 1;
        overflow-y: visible;
        overflow-x: hidden;
        min-height: 0;
        padding-bottom: 80px; /* Espace pour le footer */
    }
    
    /* Sur mobile, permettre le scroll natif sur le body pour rétracter la barre d'adresse */
    body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    .app {
        min-height: auto;
    }
    
    .sidebar {
        overflow: visible;
    }

    /* Sur mobile, la liste des incidents ne scroll pas individuellement */
    .sidebar-scrollable-content .incidents-list {
        overflow-y: visible;
        flex: 0 0 auto;
    }

    /* Sur mobile, les communiqués restent horizontaux */
    .official-announcements {
        flex-shrink: 0;
    }

    /* Header fixe sur mobile */
    .sidebar-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background-color: #000000;
        width: 100%;
    }
    
    /* Search et filters restent fixes sur mobile */
    .search-container {
        position: fixed;
        top: 65px; /* Hauteur approximative du sidebar-header (padding 1rem top + 1rem bottom + contenu ~33px) */
        left: 0;
        right: 0;
        z-index: 199;
        background-color: #000000;
        width: 100%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .filters {
        position: fixed;
        top: 138px; /* Hauteur du header (65px) + search-container (padding 1rem top + 1rem bottom + input ~49px + border 1px = ~73px) */
        left: 0;
        right: 0;
        z-index: 198;
        background-color: #000000;
        width: 100%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    /* Ajouter un padding-top au contenu scrollable pour compenser les éléments fixes */
    .sidebar-scrollable-content {
        padding-top: 280px; /* Espace pour header (~65px) + search (~73px) + filters avec bouton Signalement rapide (~142px) */
    }

    .view-details-button {
        display: block;
    }

    /* Popup mobile overlay */
    .mobile-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        width: 100vw;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 3000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
        animation: fadeIn 0.2s ease-out;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

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

    .mobile-popup {
        width: 100%;
        max-width: 500px;
        max-height: 90dvh;
        overflow-y: auto;
        overflow-x: hidden;
        background-color: #000000;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        border: 1px solid #3d3d3d;
        animation: slideUp 0.3s ease-out;
        display: flex;
        flex-direction: column;
        position: relative;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .close-popup-button {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        background-color: rgba(26, 26, 26, 0.8);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: #ffffff;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .close-popup-button:hover {
        background-color: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    }

    .close-popup-button:active {
        transform: scale(0.95);
    }

    .mobile-popup .popup-header {
        position: relative;
        padding-right: 3rem;
    }

    /* Sur mobile, le bouton "Signaler une panne" passe à la ligne */
    .mobile-popup .popup-stats {
        flex-wrap: wrap;
    }

    .mobile-popup .popup-stats .popup-button {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 0.75rem;
    }

    .map-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        z-index: 2000;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .map-container.show {
        transform: translateX(0);
    }

    .close-map-button {
        display: flex;
        top: 1rem;
        right: 1rem;
        left: auto;
    }
    
    /* Déplacer les contrôles de zoom de Leaflet pour éviter la superposition */
    .leaflet-control-zoom {
        top: 4rem !important;
        right: 0.75rem !important;
        left: auto !important;
    }

    .popup-unified {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }

    .popup-chart-container {
        flex: 1;
        min-height: 250px;
    }

    .mobile-popup .popup-chart-container {
        flex: 1;
        min-height: 350px;
        margin-top: 1rem;
    }

    .mobile-popup .chart-popup {
        min-height: 350px;
        height: 100%;
    }

    .report-button {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }

    .report-button svg {
        width: 16px;
        height: 16px;
    }
}

/* Chat en bas de la carte */
.map-chat {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(61, 61, 61, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: height 0.3s ease;
}

/* Sur desktop, le chat est replié par défaut */
@media (min-width: 769px) {
    .map-chat {
        height: 50px;
        overflow: hidden;
    }
    
    .map-chat:not(.collapsed) {
        height: 300px;
    }
}

.map-chat.collapsed {
    height: 50px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(61, 61, 61, 0.5);
    background-color: rgba(0, 0, 0, 0.3);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-service-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #000000;
    padding: 4px;
    flex-shrink: 0;
}

.chat-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
}

.chat-toggle {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.map-chat.collapsed .chat-toggle {
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: #555 rgba(0, 0, 0, 0.3);
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.chat-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.chat-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-message-user {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
}

.chat-message-time {
    font-size: 0.7rem;
    color: #888;
}

.chat-message-text {
    font-size: 0.85rem;
    color: #ddd;
    line-height: 1.4;
    padding: 0;
    background-color: transparent;
    border: none;
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(61, 61, 61, 0.5);
    background-color: rgba(0, 0, 0, 0.3);
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid #3d3d3d;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.chat-input:focus {
    border-color: #555;
    background-color: rgba(255, 255, 255, 0.15);
}

.chat-input::placeholder {
    color: #888;
}

.chat-send-button {
    background-color: #ff4444;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.chat-send-button:hover {
    background-color: #ff6666;
}

.chat-send-button:active {
    background-color: #cc3333;
}

.map-chat.collapsed .chat-messages,
.map-chat.collapsed .chat-input-container {
    display: none;
}

/* Modal de dialogue personnalisé */
.dialog-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.dialog-modal {
    background-color: #1a1a1a;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

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

.dialog-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dialog-modal-icon-success {
    background-color: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.dialog-modal-icon-error {
    background-color: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.dialog-modal-icon-info {
    background-color: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
}

.dialog-modal-content {
    text-align: center;
    width: 100%;
}

.dialog-modal-message {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    white-space: pre-line;
}

.dialog-modal-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.dialog-modal-button {
    background-color: #ff4444;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 120px;
}

.dialog-modal-button:hover {
    background-color: #cc0000;
}

.dialog-modal-button:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    .dialog-modal {
        max-width: calc(100% - 2rem);
        padding: 1.5rem;
    }
    
    .dialog-modal-icon {
        width: 56px;
        height: 56px;
    }
    
    .dialog-modal-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .dialog-modal-message {
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .map-chat {
        height: 250px;
    }
    
    .chat-header {
        padding: 0.5rem 0.75rem;
    }
    
    .chat-title {
        font-size: 0.85rem;
    }
    
    .chat-messages {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .chat-message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .chat-message-text {
        font-size: 0.8rem;
    }
    
    .chat-input-container {
        padding: 0.5rem 0.75rem;
    }
    
    .chat-input {
        padding: 0.6rem 0.75rem;
        font-size: 16px;
    }
    
    .chat-send-button {
        padding: 0.6rem;
    }
}

/* Popup de commentaires mobile */
.mobile-comments-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-comments-popup {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background-color: #000000;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #3d3d3d;
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-search-popup {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    max-height: 90vh;
    background-color: #000000;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #3d3d3d;
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Correction pour le search-container dans le modal de recherche */
.mobile-search-popup .search-container {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: 1 !important;
    background-color: transparent !important;
    width: 100% !important;
    box-shadow: none !important;
}

/* Section de messages scrollable dans le modal de recherche */
.mobile-search-popup .mobile-comments-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.mobile-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #3d3d3d;
    background-color: #1a1a1a;
}

.mobile-comments-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-comments-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #000000;
    padding: 4px;
    flex-shrink: 0;
}

.mobile-comments-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
}

.close-comments-button {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.close-comments-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.close-comments-button:active {
    transform: scale(0.95);
}

.mobile-comments-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: #555 rgba(0, 0, 0, 0.3);
}

.mobile-comments-messages::-webkit-scrollbar {
    width: 6px;
}

.mobile-comments-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.mobile-comments-messages::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

.mobile-comments-messages::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.mobile-comments-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #3d3d3d;
    background-color: #1a1a1a;
}
