﻿/* ========== HLD NETWORK DESIGNER - STYLES COMPLETS OPTIMISÉS ========== */

/* ========== BASE STYLES & RESET ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* ========== STYLES POUR LA POPUP 2 NODES ========== */

/* Container principal pour les infos 2 nodes */
.two-nodes-info {
    padding: 20px 0;
}

/* Affichage des nodes avec flèche */
.nodes-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(52, 73, 94, 0.3);
    border-radius: 12px;
}

/* Carte pour chaque node */
.node-card {
    background: rgba(44, 62, 80, 0.6);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 140px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.node-card:hover {
    border-color: rgba(52, 152, 219, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

/* Icône du node */
.node-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

/* Nom du node */
.node-name {
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

/* Type du node */
.node-type {
    color: #95a5a6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Flèche de connexion animée */
.connection-arrow {
    font-size: 32px;
    color: #3498db;
    font-weight: bold;
    animation: pulse 2s infinite;
}
/* ========== STYLES POUR LA POPUP 2 NODES COMPACTE ========== */

/* Version compacte de la popup topology-content */
.topology-content.compact {
    max-width: 450px;
    padding: 20px;
}

/* Container pour l'affichage compact 2 nodes */
.two-nodes-compact {
    background: rgba(52, 73, 94, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

/* Ligne des nodes */
.nodes-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

/* Mini carte de node */
.node-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: rgba(44, 62, 80, 0.6);
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.node-mini:hover {
    border-color: rgba(52, 152, 219, 0.6);
    transform: translateY(-1px);
}

.node-mini .node-icon {
    font-size: 20px;
}

.node-mini .node-name {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

/* Indicateur de connexion */
.connection-indicator {
    font-size: 24px;
    color: #3498db;
    animation: pulse 2s infinite;
}

/* Info de distance */
.distance-info {
    text-align: center;
    color: #95a5a6;
    font-size: 13px;
}

.distance-info strong {
    color: #3498db;
    font-size: 14px;
}

/* Ajuster les boutons pour avoir des icônes */
.topology-btn span {
    margin-right: 8px;
}

/* S'assurer que la popup a le bon z-index */
#twoNodesPopup {
    z-index: 10000;
}

/* Animation d'entrée pour la popup */
#twoNodesPopup.active .topology-content {
    animation: slideInUp 0.3s ease;
}

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

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

/* Section d'information de connexion */
.connection-info {
    text-align: center;
    padding: 20px;
}

/* Texte informatif */
.info-text {
    color: #bdc3c7;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

/* Distance approximative */
.info-distance {
    color: #95a5a6;
    font-size: 13px;
}

.info-distance span {
    color: #3498db;
    font-weight: 600;
    font-size: 15px;
}

/* Ajuster les boutons pour avoir des icônes */
.topology-btn span {
    margin-right: 8px;
}

/* S'assurer que la popup a le bon z-index */
#twoNodesPopup {
    z-index: 10000;
}

/* Animation d'entrée pour la popup */
#twoNodesPopup.active .topology-content {
    animation: slideInUp 0.3s ease;
}

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


/* ========== ROUTE NODE INSERTION STYLES ========== */
/* À ajouter dans app.css */

/* Marqueur d'insertion */
.insertion-marker {
    animation: pulse 1.5s infinite;
    cursor: crosshair;
}

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

/* Routes survolées */
.leaflet-interactive:hover {
    stroke-width: 7 !important;
    stroke-opacity: 1 !important;
    cursor: crosshair;
}

/* Routes en mode insertion */
.route-insertable {
    cursor: crosshair !important;
}

.route-highlight {
    stroke: #f39c12 !important;
    stroke-width: 7 !important;
    stroke-opacity: 1 !important;
    filter: drop-shadow(0 0 8px rgba(243, 156, 18, 0.6));
}

/* Node en cours d'insertion */
.node-inserting {
    opacity: 0.7;
    filter: drop-shadow(0 0 10px rgba(243, 156, 18, 0.8));
}

/* Indicateur de split */
.route-split-preview {
    stroke-dasharray: 5, 10;
    stroke: #e74c3c;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -15;
    }
}

/* Tooltip pour mode insertion */
.insertion-tooltip {
    position: fixed;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 10000;
    border: 1px solid #f39c12;
    backdrop-filter: blur(5px);
}

.insertion-tooltip::before {
    content: "📍";
    margin-right: 5px;
}

/* Node draggable avec routes connectées */
.node-with-routes {
    cursor: move !important;
}

.node-with-routes.dragging {
    opacity: 0.6;
    filter: drop-shadow(0 0 15px rgba(52, 152, 219, 0.8));
}

/* Animation de reconnexion */
.route-reconnecting {
    stroke: #27ae60 !important;
    stroke-width: 6 !important;
    animation: reconnect 0.5s ease-in-out;
}

@keyframes reconnect {
    0% {
        stroke-dasharray: 10, 10;
        stroke-opacity: 0.5;
    }
    50% {
        stroke-dasharray: 20, 5;
        stroke-opacity: 1;
    }
    100% {
        stroke-dasharray: none;
        stroke-opacity: 0.8;
    }
}

/* Bouton toggle insertion mode */
.insertion-mode-btn {
    position: fixed;
    top: 200px;
    right: 20px;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 10px 15px;
    border: 2px solid #f39c12;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.insertion-mode-btn:hover {
    background: rgba(243, 156, 18, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.insertion-mode-btn.active {
    background: rgba(243, 156, 18, 0.9);
    border-color: #27ae60;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Visual feedback pour suppression */
.node-deleting {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* Routes en cours de suppression */
.route-deleting {
    stroke-opacity: 0.3 !important;
    stroke-dasharray: 5, 10 !important;
    animation: fadeOut 0.5s ease-out;
}

/* Notification spécifique insertion */
.notification.insertion {
    border-left-color: #f39c12;
    background: rgba(243, 156, 18, 0.1);
}

/* Guide visuel pendant drag */
.drag-guide-line {
    stroke: #f39c12;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    stroke-opacity: 0.7;
    fill: none;
    pointer-events: none;
}

/* Zone de drop sur route */
.route-drop-zone {
    stroke-width: 15 !important;
    stroke-opacity: 0 !important;
    cursor: copy !important;
}

.route-drop-zone:hover {
    stroke-opacity: 0.2 !important;
    stroke: #f39c12 !important;
}

#map {
    transition: opacity 0.3s ease;
}

/* Style pour le bouton de changement de carte */
#mapStyleBtn span {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Hover effect spécifique pour le bouton style */
#mapStyleBtn:hover {
    background: linear-gradient(135deg, #3498db, #9b59b6);
}

/* Animation de pulsation pour indiquer le changement */
@keyframes styleChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.map-control-btn.style-changing {
    animation: styleChange 0.5s ease;
}

/* Styles pour le menu utilisateur déroulant */
.user-info {
    position: relative;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px; /* OPTIMISÉ: Réduit */
    background: rgba(44, 62, 80, 0.95);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 4px;
    color: white;
    font-size: 11px; /* OPTIMISÉ: Réduit */
    cursor: pointer;
    transition: all 0.3s ease;
}

.lock-icon {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: rgba(44, 62, 80, 0.9);
    border: 1px solid rgba(52, 152, 219, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 15;
}

.lock-icon:hover {
    background: rgba(52, 152, 219, 0.8);
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.6);
}

.network-node-marker.locked {
    border-color: #e67e22 !important;
    background: rgba(230, 126, 34, 0.2) !important;
}

.network-node-marker.locked .lock-icon {
    background: rgba(230, 126, 34, 0.9);
    border-color: #d35400;
}

/* ========== AMÉLIORATION 2: ANIMATION DES SEGMENTS ========== */
@keyframes flowAnimation {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -30;
    }
}

.animated-route {
    animation: flowAnimation 2s linear infinite;
    stroke-dasharray: 10, 5;
}

.animated-route.active {
    animation-duration: 1s;
    stroke: #2ecc71 !important;
    stroke-width: 5 !important;
    filter: drop-shadow(0 0 8px rgba(46, 204, 113, 0.6));
}

.animated-route.maintenance {
    animation-duration: 3s;
    stroke: #f39c12 !important;
    stroke-dasharray: 15, 10;
}

.animated-route.down {
    animation: none;
    stroke: #e74c3c !important;
    opacity: 0.5;
}

@keyframes pulseRoute {
    0%, 100% {
        stroke-width: 4;
        opacity: 0.8;
    }
    50% {
        stroke-width: 6;
        opacity: 1;
        filter: drop-shadow(0 0 12px currentColor);
    }
}

.animated-route.critical {
    animation: pulseRoute 2s ease-in-out infinite;
}

.network-node-marker.dragging {
    opacity: 0.7;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.6);
    cursor: grabbing !important;
}

.drag-guide-line {
    stroke: #3498db;
    stroke-width: 2;
    stroke-opacity: 0.5;
    stroke-dasharray: 5, 5;
    fill: none;
    pointer-events: none;
}

.lock-control-panel {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(44, 62, 80, 0.95);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    z-index: 500;
    backdrop-filter: blur(10px);
}

.lock-all-btn, .unlock-all-btn {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.lock-all-btn:hover, .unlock-all-btn:hover {
    background: rgba(52, 152, 219, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

.lock-all-btn {
    background: rgba(230, 126, 34, 0.8);
}

.lock-all-btn:hover {
    background: rgba(230, 126, 34, 1);
}

.leaflet-tooltip {
    background: rgba(44, 62, 80, 0.95) !important;
    color: white !important;
    border: 1px solid rgba(52, 152, 219, 0.5) !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-tooltip::before {
    border-top-color: rgba(44, 62, 80, 0.95) !important;
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: rgba(44, 62, 80, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(44, 62, 80, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #95a5a6;
}

.dropdown-header .user-email {
    color: #ecf0f1;
    font-weight: 500;
    margin-top: 4px;
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.dropdown-menu-item:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.dropdown-menu-item.danger {
    color: #e74c3c;
}

.dropdown-menu-item.danger:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-arrow {
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.3s ease;
}

.user-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.element-icon {
    width: 20px; /* OPTIMISÉ: Réduit */
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.network-element {
    display: flex;
    align-items: center;
    gap: 8px; /* OPTIMISÉ: Réduit */
    padding: 8px; /* OPTIMISÉ: Réduit de 12px à 8px */
    background: rgba(52, 73, 94, 0.6);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin-bottom: 6px; /* OPTIMISÉ: Ajouté pour compacter */
}

.network-element:hover {
    background: #e0e0e0;
    transform: translateX(5px);
}

.element-label {
    font-weight: 600;
    color: white;
    font-size: 12px; /* OPTIMISÉ: Réduit */
}

/* ========== OPTIMISATION LAYOUT - BODY ET HEADER ========== */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding-top: 120px !important; /* OPTIMISÉ: Réduit de 220px à 120px */
}

/* ========== HEADER OPTIMISÉ ========== */
.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(44, 62, 80, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    z-index: 1000 !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    padding: 8px 20px; /* OPTIMISÉ: Réduit le padding */
    box-sizing: border-box;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* OPTIMISÉ: Réduit */
    flex-wrap: nowrap;
    gap: 15px;
    height: 40px; /* OPTIMISÉ: Hauteur fixe */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    justify-content: flex-end;
}

/* Logo Section OPTIMISÉE */
.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.logo-icon {
    font-size: 24px;
}

.title-section h1 {
    margin: 0;
    font-size: 16px; /* OPTIMISÉ: Réduit */
    font-weight: bold;
    color: #ecf0f1;
    line-height: 1.2;
}

.subtitle {
    font-size: 10px; /* OPTIMISÉ: Réduit */
    color: #bdc3c7;
    margin-top: 1px;
}

/* Network Stats OPTIMISÉES */
.network-stats {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px; /* OPTIMISÉ: Réduit */
    color: #bdc3c7;
    flex: 1;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-value {
    color: #3498db;
    font-weight: bold;
}

/* Project Controls OPTIMISÉS */
.project-controls {
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(52, 73, 94, 0.8);
    padding: 4px 8px; /* OPTIMISÉ: Réduit */
    border-radius: 4px;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.project-controls select {
    background: rgba(44, 62, 80, 0.9);
    color: white;
    border: 1px solid #34495e;
    padding: 4px 8px; /* OPTIMISÉ: Réduit */
    border-radius: 3px;
    font-size: 11px; /* OPTIMISÉ: Réduit */
    min-width: 120px; /* OPTIMISÉ: Réduit */
}

.project-controls select:focus {
    outline: none;
    border-color: #3498db;
}

.project-controls button {
    background: rgba(52, 152, 219, 0.8);
    color: white;
    border: 1px solid #34495e;
    padding: 4px 8px; /* OPTIMISÉ: Réduit */
    border-radius: 3px;
    font-size: 10px; /* OPTIMISÉ: Réduit */
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-controls button:hover {
    background: rgba(52, 152, 219, 1);
    transform: translateY(-1px);
}

.project-controls button.danger {
    background: rgba(231, 76, 60, 0.8);
}

.project-controls button.danger:hover {
    background: rgba(231, 76, 60, 1);
}

/* User Info OPTIMISÉE */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.user-info .username {
    font-weight: 600;
}

.user-info button {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.user-info button:hover {
    background: rgba(231, 76, 60, 1);
}

/* Project Details OPTIMISÉS */
.project-details {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px; /* OPTIMISÉ: Réduit */
    margin-top: 8px; /* OPTIMISÉ: Réduit */
    padding-top: 8px; /* OPTIMISÉ: Réduit */
    border-top: 1px solid rgba(52, 152, 219, 0.2);
    height: 40px; /* OPTIMISÉ: Hauteur fixe */
    align-items: center;
}

.project-field {
    flex: 1;
    min-width: 100px; /* OPTIMISÉ: Réduit */
    margin-bottom: 0; /* OPTIMISÉ: Supprimé */
}

.project-field label {
    display: block;
    font-size: 9px; /* OPTIMISÉ: Réduit */
    color: #bdc3c7;
    margin-bottom: 2px; /* OPTIMISÉ: Réduit */
    font-weight: 600;
    text-transform: uppercase;
}

.project-field input, 
.project-field textarea {
    width: 100%;
    background: rgba(52, 73, 94, 0.8);
    border: 1px solid #34495e;
    color: white;
    padding: 4px 8px; /* OPTIMISÉ: Réduit */
    border-radius: 3px;
    font-size: 11px; /* OPTIMISÉ: Réduit */
    box-sizing: border-box;
    height: 24px; /* OPTIMISÉ: Hauteur fixe */
}

.project-field input:focus, 
.project-field textarea:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(52, 73, 94, 1);
}

/* ========== MODALS ========== */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.project-modal-content {
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 25px;
    border-radius: 12px;
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.project-modal h3 {
    margin: 0 0 20px 0;
    color: #3498db;
}

.project-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.project-item {
    padding: 10px;
    margin: 5px 0;
    background: rgba(52, 73, 94, 0.6);
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.project-item:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.2);
}

.project-name {
    font-weight: bold;
    margin-bottom: 4px;
    color: white;
}

.project-meta {
    font-size: 11px;
    color: #bdc3c7;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: #3498db;
    color: white;
}

.modal-btn.secondary {
    background: #95a5a6;
    color: white;
}

.modal-btn.danger {
    background: #e74c3c;
    color: white;
}

.modal-btn:hover {
    transform: translateY(-1px);
}

/* ========== MAIN CONTAINER OPTIMISÉ ========== */
.main-container {
    display: flex;
    height: calc(100vh - 120px) !important; /* OPTIMISÉ: Ajusté */
    margin-top: 0 !important;
    padding-top: 0 !important;
    gap: 0;
}

/* ========== SIDEBARS OPTIMISÉES ========== */
.left-sidebar {
    width: 220px !important; /* OPTIMISÉ: Réduit de 280px à 220px */
    background: rgba(44, 62, 80, 0.95);
    border-right: 1px solid rgba(52, 152, 219, 0.3);
    overflow-y: auto;
    padding: 15px; /* OPTIMISÉ: Réduit de 20px à 15px */
}

.right-sidebar {
    width: 320px !important; /* OPTIMISÉ: Augmenté de 280px à 320px */
    background: rgba(44, 62, 80, 0.95);
    border-left: 1px solid rgba(52, 152, 219, 0.3);
    overflow-y: auto;
    padding: 15px;
}

.sidebar-title, .control-panel-title {
    font-size: 14px; /* OPTIMISÉ: Réduit */
    font-weight: bold;
    color: #3498db;
    margin-bottom: 15px; /* OPTIMISÉ: Réduit */
    padding-bottom: 8px; /* OPTIMISÉ: Réduit */
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
}

/* Network Elements */
.network-elements {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.network-element:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    transform: translateX(5px);
}

.network-element:active {
    cursor: grabbing;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px; /* OPTIMISÉ: Réduit */
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 12px; /* OPTIMISÉ: Réduit */
}

.action-btn.clear-btn {
    background: rgba(231, 76, 60, 0.8);
}

.action-btn.example-btn {
    background: rgba(155, 89, 182, 0.8);
}

.action-btn.export-btn {
    background: rgba(39, 174, 96, 0.8);
}

.action-btn.connect-btn {
    background: rgba(52, 152, 219, 0.8);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-btn.clear-btn:hover {
    background: rgba(231, 76, 60, 1);
}

.action-btn.example-btn:hover {
    background: rgba(155, 89, 182, 1);
}

.action-btn.export-btn:hover {
    background: rgba(39, 174, 96, 1);
}

.action-btn.connect-btn:hover, .action-btn.connect-btn.active {
    background: rgba(52, 152, 219, 1);
}

/* Sections */
.selection-section, .properties-section, .route-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.3);
}

/* Selection Info */
.selection-info, .node-properties, .route-info {
    background: rgba(52, 73, 94, 0.4);
    border-radius: 8px;
    padding: 15px;
    min-height: 100px;
}

.empty-state {
    text-align: center;
    color: #7f8c8d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
}

.empty-state span {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    margin: 0;
    font-size: 13px;
}

.selected-nodes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-node {
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 12px;
}

.property-item {
    margin-bottom: 12px;
}

.property-label {
    display: block;
    font-size: 11px;
    color: #bdc3c7;
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: capitalize;
}

.property-input {
    width: 100%;
    background: rgba(44, 62, 80, 0.8);
    border: 1px solid #34495e;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.property-input:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(44, 62, 80, 1);
}

.property-input[readonly] {
    background: rgba(44, 62, 80, 0.5);
    color: #bdc3c7;
}

/* ========== MAP CONTAINER OPTIMISÉ ========== */
.map-container {
    flex: 1;
    position: relative;
    background: #2c3e50;
    /* OPTIMISÉ: La map prend maintenant plus d'espace horizontal */
}

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

.map-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 500;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: rgba(44, 62, 80, 0.9);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.map-control-btn:hover {
    background: rgba(52, 152, 219, 0.8);
    transform: scale(1.1);
}

.map-control-btn span {
    font-size: 16px;
}

.map-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(44, 62, 80, 0.9);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(5px);
    z-index: 500;
}

.zoom-level, .coordinates {
    font-size: 12px;
    color: #bdc3c7;
    margin-bottom: 2px;
}

.coordinates {
    margin-bottom: 0;
}

/* ========== ROUTES MULTI-GESTION ========== */
.routes-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 10px 0;
}

.route-item {
    margin: 10px 0;
    padding: 10px;
    background: rgba(52, 73, 94, 0.4);
    border-radius: 6px;
    border-left: 4px solid #2ecc71;
    transition: all 0.3s ease;
}

.route-item:hover {
    background: rgba(52, 73, 94, 0.6);
    transform: translateX(2px);
}

.route-item h5 {
    margin: 0 0 5px 0;
    color: white;
    font-size: 14px;
}

.route-item button {
    background: none;
    border: 1px solid #7f8c8d;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.route-item button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.route-item button.delete-btn {
    background: #e74c3c;
    border: none;
}

.route-item button.delete-btn:hover {
    background: #c0392b;
}

.route-stats {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px;
    background: rgba(44, 62, 80, 0.6);
    border-radius: 4px;
    font-size: 12px;
}

.route-stats .stat-item {
    color: #ecf0f1;
}

.route-item.new {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== NETWORK NODE MARKERS ========== */
.custom-network-icon {
    background: none !important;
    border: none !important;
}

.network-node-marker {
    background: rgba(44, 62, 80, 0.9);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-size: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.network-node-marker:hover {
    transform: scale(1.1);
    border-color: #2ecc71;
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.network-node-marker.selected {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.9);
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.node-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.node-label {
    font-weight: 600;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== ROUTE LINES ========== */
.route-line {
    stroke: #2ecc71;
    stroke-width: 4;
    stroke-opacity: 0.8;
    fill: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.connection-segment {
    stroke: #f39c12;
    stroke-width: 3;
    stroke-opacity: 0.7;
    stroke-dasharray: 5,5;
    fill: none;
}

.direct-connection {
    stroke: #9b59b6;
    stroke-width: 4;
    stroke-opacity: 0.8;
    stroke-dasharray: 10,5;
    fill: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.route-point {
    fill: #e74c3c;
    stroke: white;
    stroke-width: 2;
    r: 6;
}

/* ========== NOTIFICATIONS & LOADING ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.loading-content {
    background: rgba(44, 62, 80, 0.95);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.3);
    border-left: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 14px;
    color: #bdc3c7;
}

.notification {
    position: fixed;
    top: 130px; /* OPTIMISÉ: Ajusté */
    right: 20px;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    z-index: 1001;
    max-width: 300px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.notification.success {
    border-left-color: #27ae60;
}

.notification.error {
    border-left-color: #e74c3c;
}

.notification.warning {
    border-left-color: #f39c12;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification-content span {
    font-size: 14px;
}

/* ========== MULTI-NODE CONNECTION SYSTEM STYLES ========== */
.multi-select-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 62, 80, 0.95);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    animation: slideUp 0.3s ease;
}

.multi-select-bar.active {
    display: flex;
    align-items: center;
    gap: 20px;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.selected-nodes-list {
    display: flex;
    gap: 10px;
    align-items: center;
}

.selected-node-chip {
    background: rgba(52, 152, 219, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(52, 152, 219, 0.5);
}

.selected-node-chip .remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-left: 5px;
}

.selected-node-chip .remove:hover {
    opacity: 1;
    color: #e74c3c;
}

.connect-multi-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.connect-multi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
    background: linear-gradient(135deg, #2980b9, #3498db);
}

.connect-multi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========== MENU RADIAL SIMPLIFIÉ - 3 BOUTONS ========== */
.radial-menu {
    position: fixed;
    width: 200px;
    height: 200px;
    display: none;
    z-index: 10000;
    pointer-events: none;
}

.radial-menu.active {
    display: block;
}

.radial-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(44, 62, 80, 0.95);
    border: 2px solid #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
}

.radial-option {
    position: absolute;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    pointer-events: auto;
    border: 2px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.radial-menu.active .radial-option {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.radial-option.direct {
    top: 30px;
    left: 100px;
    background: rgba(155, 89, 182, 0.95);
}

.radial-option.edit {
    top: 140px;
    left: 45px;
    background: rgba(39, 174, 96, 0.95);
}

.radial-option.delete {
    top: 140px;
    left: 155px;
    background: rgba(231, 76, 60, 0.95);
}

.radial-option:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.radial-option span.icon {
    font-size: 22px;
}

.radial-option span.label {
    font-size: 10px;
    font-weight: 600;
}

/* ========== SCROLLBAR OPTIMISÉ ========== */
.left-sidebar::-webkit-scrollbar {
    width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
    background: rgba(44, 62, 80, 0.3);
}

.left-sidebar::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 3px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(44, 62, 80, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(52, 152, 219, 0.6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 152, 219, 0.8);
}

/* ========== RESPONSIVE DESIGN OPTIMISÉ ========== */
@media (max-width: 1200px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
    }
    
    .project-details {
        flex-wrap: wrap;
        height: auto;
    }
    
    body {
        padding-top: 140px !important;
    }
    
    .main-container {
        height: calc(100vh - 140px) !important;
    }
    
    .notification {
        top: 150px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 160px !important;
    }
    
    .main-container {
        height: calc(100vh - 160px) !important;
        flex-direction: column;
    }
    
    .left-sidebar, .right-sidebar {
        width: 100% !important;
        height: 150px;
        padding: 10px;
    }
    
    .project-details {
        flex-direction: column;
        gap: 5px;
        height: auto;
    }
    
    .project-field {
        min-width: 100%;
    }
    
    .notification {
        top: 170px;
        max-width: calc(100vw - 20px);
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 180px !important;
    }
    
    .main-container {
        height: calc(100vh - 180px) !important;
    }
    
    .header {
        padding: 6px 10px;
    }
    
    .left-sidebar, .right-sidebar {
        height: 120px;
        padding: 8px;
    }
    
    .notification {
        top: 190px;
    }
}

/* ========== SMOOTH SCROLLING ========== */
html {
    scroll-behavior: smooth;
}