body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    /* Fond clair */
}

#header {
    background: white;
    padding: 15px;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}


footer {
    background-color: #f0f0f0;
    text-align: center;
    font-size: small;
    margin-top: auto;
    text-align: center;
  }

.btn {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
margin-bottom: 10px;
    display: flex;
    justify-content: right;

}

#devices {
    display: flex;
    /* Disposer les appareils en ligne */
    justify-content: center;
    
}

.device, .router, .switch, .client1, .client2, .client3 ,.printer, .internet, .firewall, .server, .wifi, .camera, .raspberry {
    width: 100px;
    height: 100px;
    
    /* Couleur des appareils */
    color: white;
  
    line-height: 100px;
    margin: 20px;
    border-radius: 5px;
    cursor: move;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    user-select: none;
}

.device-controls {
    position: absolute;
    top: -20px;
    right: 0;
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.drag-handle,
.link-handle,
.delete-handle,
.routing-handle,
.ip-config-handle {
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #bfcbeb;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.drag-handle:hover,
.link-handle:hover,
.delete-handle:hover,
.routing-handle:hover,
.ip-config-handle:hover {
    background: #727272;
}

.drag-handle {
    cursor: move;
}

.link-handle.active {
    background: #4CAF50;
    color: white;
}

.device:hover {
    transform: scale(1.05);
}

#workspace {
    border: 2px dashed #007bff;
    height: 500px;
    position: relative;
    overflow: hidden;
    margin: 20px;
    background-color: white;

}

/* Barre latérale contenant les appareils et la poubelle */
#sidebar {
    width: 200px;
    padding: 10px;
    border-right: 1px solid #ddd;
    background-color: #f9f9f9;
}

/* Styles pour la poubelle */
#trash {
    margin-top: 20px;
    padding: 15px;
    border: 2px dashed #d9534f;
    /* Rouge clair pour signaler une zone de suppression */
    border-radius: 10px;
    background-color: #ffeded;
    /* Légèrement rosé pour attirer l'attention */
    text-align: center;
    font-size: 18px;
    color: #d9534f;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Animation au survol de la poubelle */
#trash:hover {
    background-color: #f8d7da;
    /* Rouge plus clair pour le survol */
}





.basicLine {
    stroke: #000000;
    stroke-width: 2px;
}

.selectedBtn {
    background-color: #007bff;
    color: white;
    border: 2px solid #007bff;
    font-weight: bold;
}


button {
    padding: 10px 20px;
    /* Ajouter un peu d'espace autour du texte des boutons */
    margin: 5px;
    /* Espacement entre les boutons */
    cursor: pointer;
    /* Changer le curseur au survol */
    border: none;
    /* Supprimer la bordure par défaut */
    border-radius: 5px;
    /* Arrondir les bords des boutons */
    transition: background-color 0.3s, color 0.3s;
    /* Effet de transition lors du survol */
}

button:hover {
    background-color: #007bff;
    /* Changer la couleur de fond au survol */
    color: rgb(148, 147, 147);
    /* Changer la couleur du texte au survol */
}

button:disabled {
    background-color: rgb(214, 230, 236);
    color: white;
     transition: background-color 0.3s, color 0.3s;
    cursor: not-allowed; /* Change le curseur pour indiquer l'état désactivé */
}


.options {

    display: flex;
    justify-content: center;
    margin: 20px 2px;


}


#check {
    display: flex;
    justify-content: center;

}




/* --------------------devices color-------------------------*/
.device {
    background-color: #ffffff;
    /* Bleu */
}

.disabled {
    pointer-events: none; /* Désactive le drag */
    opacity: 0.5; /* Rend l'élément visuellement grisé */
    cursor: not-allowed; /* Change le curseur */
}




/* ------------------------------------------*/



.scenario-controls {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 15px;
}

.scenario-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}



#scenarioInstructions {
    padding: 15px;
    background: #fff;
    border-left: 4px solid #007bff;
    margin: 10px 0;
    line-height: 1.5;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}


/* -------------------pop up--------------------- */
/* Style pour le fond de la pop-up */
#popupOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    display: none;
    /* Masqué par défaut */
}

/* Style de la boîte de dialogue */
#popupContent {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Style du bouton de démarrage */
#startButton {
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    margin-top: 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#startButton:hover {
    background-color: #0056b3;
}

.popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28c035;
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.popupWarning {
    position: fixed;
    top: 40px;
    right: 40px;
    background-color: #e94d4d;
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}



/* Style pour les paquets */
.packet-animation {
    width: 10px;
    /* Largeur du paquet */
    height: 10px;
    /* Hauteur du paquet */
    background-color: #00ff00;
    /* Couleur verte pour le paquet */
    border-radius: 50%;
    /* Forme circulaire */
    box-shadow: 0 0 5px #00ff00;
    /* Ombre pour le paquet */
    position: absolute;
    /* Positionnement absolu pour l'animation */
    z-index: 10;
    /* Assurez-vous qu'il est au-dessus des autres éléments */
}


.message-bubble {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    20% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.packet-animation {
    width: 10px;
    height: 10px;
    background-color: #2196F3;
    border-radius: 50%;
    position: absolute;
    z-index: 900;
}

/* Animation pour les appareils marqués comme morts */
.dead-device {
    animation: deadAnimation 1s forwards;
    /* Animation pour les appareils morts */
}

@keyframes deadAnimation {
    from {
        background-color: red;
        /* Commence en rouge */
    }

    to {
        opacity: 0;
        /* Devenir transparent */
    }
}

/* Effet de flash pour indiquer un succès */
.success-flash {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 255, 0, 0.5);
    /* Fond vert semi-transparent */
    border-radius: 50%;
    /* Forme circulaire */
    animation: flash 0.5s ease-out;
}

@keyframes flash {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Style par défaut */
.device-controls div {
    width: 20px;
    height: 20px;
    font-size: 14px;
}

/* Agrandir pour les appareils tactiles */
@media (pointer: coarse) {
    .device-controls div {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}


/*-----Pour le menu----- */
ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #e6e6e6;
  }
  
  li {
    float: left;
  }
  
  li a {
    display: block;
    color: rgb(0, 0, 0);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
  }
  
  li a:hover {
    background-color: #bec8d3;
  }



  .basicLine {
    stroke: black;
    stroke-width: 60px; /* Augmente la surface cliquable */
    pointer-events: all; /* Active les interactions pour la ligne */
    cursor: pointer; /* Change le curseur pour indiquer que c'est interactif */
  }
  
  .basicLine:hover {
    stroke: red; /* Change la couleur au survol pour plus de clarté */
  }
  
  

  table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 8px;
}

table th {
    background-color: #f4f4f4;
    font-weight: bold;
    text-align: left;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #797979;
}


.interface-connection-popup {
    width: 300px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.popup-header {
    background: #007BFF;
    color: #fff;
    padding: 10px;
    cursor: move;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    position: relative;
}

.popup-header span {
    position: absolute;
    right: 10px;
    top: 5px;
}

form label {
    display: block;
    margin: 10px 0 5px;
}

form select, form button {
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
}


.device-ip {
    font-size: 12px;
    color: #555;
    position: absolute;
margin-top: -60%;
}


.ip-config-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #ccc;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 300px;
    text-align: center;
}

.ip-config-modal h3 {
    margin-bottom: 10px;
}

.ip-config-modal input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.ip-config-modal button {
    padding: 8px 16px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.ip-config-modal button:first-child {
    background-color: #007BFF;
    color: white;
}

.ip-config-modal button:last-child {
    background-color: #f0f0f0;
}

.ip-config-modal button:last-child {
    background-color: #FF5733;
    color: white;
}

.ip-config-modal button:last-child:hover {
    background-color: #e74c3c;
}


/*--------------------------------------------------------------------------------------------------*/


/* Style des pop-ups */
.tutorial-popup {
    position: fixed;  /* Position fixe pour pouvoir la déplacer sur l'écran */
    bottom: 20px;     
    right: 20px;      
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 8px;
    z-index: 9999;
    text-align: center;
    max-width: 200px;  /* Taille maximale de la pop-up */
    font-size: 14px;   /* Taille de police adaptée */
    display: none;     /* Initialement invisible */
    animation: slideUp 0.5s ease-out forwards;
}

.tutorial-popup button {
    background-color: #007BFF;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.tutorial-popup button:hover {
    background-color: #45a049;
}

/* Style de base pour le reste de la page */
body {
    font-family: Arial, sans-serif;
}

.scenario-controls {
    margin: 20px;
}

.scenario-selector button {
    padding: 10px;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: #f4f4f4;
}

.scenario-selector button.selectedBtn {
    background-color: #007BFF;
    color: white;
}



/* Style pour le tooltip */
#tutorial-tooltip {
    position: absolute;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 100px;
}

/* Style pour le bouton de démarrage du tutoriel avec l'icône de point d'interrogation */
#start-tutorial-btn {
    position: fixed;
    top: 20px;
    right: 100px; 
    z-index: 1000;
    padding: 10px 15px; /* Petit padding pour une notification plus discrète */
    background-color: #70a9e6;
    color: white;
    border: none;
    border-radius: 50%; /* Rendre le bouton rond */
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3); /* Ombre plus marquée */
    font-size: 20px; /* Taille du texte pour l'icône */
    opacity: 1;    
}




/* Overlay background */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

/* Tooltip */
#tutorial-tooltip {
    position: absolute;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-width: 300px;
    margin-top: 50px;
}

/* Button styles inside the tooltip */
#tutorial-tooltip button {
    padding: 8px 16px;
    border: none;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    border-radius: 5px;
}

#tutorial-tooltip button:hover {
    background-color: #007BFF;
}



/* Highlight the target element during tutorial */
.highlighted {
    outline: 6px solid #ff0000;
    margin-bottom: 10px;
}

video {
    width: 100%;
    max-width: 600px;

}
#streambox{
    display: block;
    margin: auto;
}