/* Basic reset */
body, h1, h2, table, input, button, form, ul, li, p {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
}

/* Body styling with futuristic background */
body {
    background: url('{{ url_for('Static', 'images/futuristic-bg.jpg') }}') no-repeat center center fixed;
    background-size: cover;
    color: #ececec;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 20px;
}

/* Semi-transparent background for content */
main {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6); /* Dark semi-transparent background */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-top: 20px;
}

a.nav-link {
    color: #00bfff; /* Jaune clair pour les liens */
    text-decoration: none; /* Pas de soulignement par défaut */
    margin: 0 10px; /* Espacement autour des liens */
    font-weight: bold; /* Met le texte en gras */
    text-decoration: underline;
}

/* Effet de survol pour les liens */
a.nav-link:hover {
    text-decoration: none; /* Souligner les liens au survol */
    color: #00bfE4; /* Jaune clair pour les liens */
}

/* Styles pour les liens visités */
a.nav-link:visited {
    color: #00bfff; /* Garder la même couleur après avoir été visités */
}

/* Styles pour les liens actifs */
a.nav-link.active {
    color: #00bfff; /* Couleur pour le lien actif */
    text-decoration: underline; /* Souligner le lien actif */
}
/* Headings */
h1, h2 {
    color: #00bfff; /* Deep sky blue */
    margin-bottom: 20px;
}

/* Flash messages */
ul {
    list-style: none;
    padding: 10px;
    background: rgba(0, 191, 255, 0.3); /* Bleu clair avec transparence */
    border: 1px solid rgba(0, 191, 255, 0.5); /* Bordure bleu clair légèrement plus opaque */
    border-radius: 5px;
    margin-bottom: 20px;
}

li {
    color: #ffffff;
}
.red-text {
  color: red;
  background-color: #333; /* ou un autre code hexadécimal pour un background foncé */
  font-weight: bold
}
/* Messages d'avertissement */


/* Styles généraux pour les messages flash */
.flash-message {
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    color: white; /* Texte noir pour le contraste */
    border: 1px solid transparent; /* Bordure transparente, remplacée par des bordures spécifiques */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Ombre légère pour une meilleure lisibilité */
    animation: fadeInOut 5s forwards; /* Animation pour la disparition des messages */
}

/* Messages d'information */
.flash-message-info {
    background-color: #007bff; /* Bleu */
    border-color: #0056b3; /* Bordure bleue plus foncée */
}

/* Messages de succès */
.flash-message-success {
    background-color: #28a745; /* Vert */
    border-color: #1e7e34; /* Bordure verte plus foncée */
}

/* Messages d'avertissement */
.flash-message-warning {
    background-color: #ffc107; /* Jaune */
    color: #000; /* Texte noir pour le contraste */
    border-color: #e0a800; /* Bordure jaune plus foncée */
}

/* Messages d'erreur */
.flash-message-error {
    background-color: #dc3545; /* Rouge */
    border-color: #c82333; /* Bordure rouge plus foncée */
}

/* Animation pour la disparition des messages */
@keyframes fadeInOut {
    0% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    border: 1px solid #444;
    padding: 15px;
    text-align: center;
}

th {
    background: #1e1e1e; /* Dark grey */
    color: #00bfff; /* Deep sky blue */
}

td {
    background: rgba(30, 30, 30, 0.8); /* Dark semi-transparent grey */
    color: #ececec;
}

/* Button styling */
button {
    background: #00bfff; /* Deep sky blue */
    border: none;
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, box-shadow 0.3s;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(0, 191, 255, 0.5); /* Light blue */
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
    z-index: 0;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.8); /* Light blue neon glow */
}

button:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

button:hover {
    background: #009acd; /* Darker deep sky blue */
}

/* Form styling */
form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6); /* Dark semi-transparent background */
    border: 1px solid #1e1e1e; /* Dark grey */
    border-radius: 10px;
}

label {
    margin-bottom: 5px;
    color: #00bfff; /* Deep sky blue */
}

input, select {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #00bfff; /* Deep sky blue */
    border-radius: 5px;
    background: #1e1e1e; /* Dark grey */
    color: #ececec;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 10px #00bfff; /* Deep sky blue */
}

/* Footer styling */
footer {
    margin-top: auto;
    padding: 10px 20px;
    background: rgba(30, 30, 30, 0.9); /* Dark grey with transparency */
    width: 100%;
    text-align: center;
    color: #00bfff; /* Deep sky blue */
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
}

footer p {
    margin: 0;
}

/* Additional elements */
.select-container {
    text-align: center;
    width: 200px;
    margin: 0 auto;
}

.logout-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px 20px;
    background-color: #ff4500; /* Orange red */
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
}

.logout-button:hover {
    background-color: #ff6347; /* Tomato */
}

.welcome-message {
    position: absolute;
    top: 60px;
    right: 10px;
    color: #ececec;
    font-size: 16px;
    font-weight: bold;
}

.logo {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

.logo img {
    width: 150px;
    height: auto;
    border-radius: 5px;
}

.center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    padding: 20px;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.6); /* Dark semi-transparent background */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid #1e1e1e; /* Dark grey */
    border-radius: 10px;
}

.loading-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Darker background for loading */
  overflow-y: auto;
}

.loading-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #1e1e1e;
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  color: #00bfff; /* Deep sky blue */
}

.toggle-button {
    padding: 10px 20px;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.toggle-button.on {
    background-color: #4CAF50; /* Green */
}

.toggle-button.off {
    background-color: #f44336; /* Red */
}

#password-modal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

#password-modal-content {
    background-color: #1e1e1e;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 300px;
    color: #00bfff; /* Deep sky blue */
    border-radius: 5px;
}
#submit-password {
    padding: 10px 20px;
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 10px;
}

.close-password-modal {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-password-modal:hover,
.close-password-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Conteneur pour le champ datetime-local */
.datetime-wrapper {
    position: relative;
    display: inline-block;
}



/* Icône personnalisée */
.custom-calendar-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none; /* L'icône n'intercepte pas les clics */
    color: #007BFF; /* Couleur de l'icône personnalisée */
    font-size: 20px; /* Taille de l'icône */
}

/* Ajouter des effets au survol pour le champ */
input[type="datetime-local"]:hover,
input[type="datetime-local"]:focus {
    border-color: #007BFF; /* Couleur de la bordure au survol et au focus */
    outline: none; /* Supprime le contour par défaut */
}

    /* Style pour le modal */
    .modal {
        display: none; /* Par défaut, le modal est caché */
        position: fixed; /* Position fixe pour qu'il soit toujours visible */
        z-index: 1000; /* Valeur de z-index élevée pour s'assurer que le modal est au-dessus du contenu */
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5); /* Fond semi-transparent pour l'effet d'ombrage */
    }

    .modal-content {
        background-color: #1e1e1e;
        margin: 15% auto; /* Centre le modal verticalement */
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
        max-width: 600px;
        position: relative; /* Position relative pour permettre de centrer le contenu */
    }

    .close-contact {
     position: absolute;
     top: 10px;
     right: 15px;
     font-size: 25px;
     font-weight: bold;
     color: #fff;
     background-color: #f44336; /* Fond rouge pour le bouton de fermeture */
     border: 2px solid #fff; /* Bordure blanche autour du bouton */
     border-radius: 5px; /* Coins légèrement arrondis */
     padding: 5px 10px; /* Espace autour du "X" */
     cursor: pointer;
     box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Effet d'ombre */
     transition: background-color 0.3s ease, color 0.3s ease;
 }

 .close-contact:hover,
 .close-contact:focus {
     background-color: #d32f2f; /* Couleur de fond plus sombre au survol */
     color: #fff; /* Texte blanc */
     text-decoration: none;
     cursor: pointer;
 }

/* Responsive Design */

/* For medium screens (tablets) */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    main {
        padding: 15px;
        margin-top: 10px;
    }

    form {
        width: 100%;
        max-width: 90%;
        padding: 15px;
    }

    table {
        font-size: 14px;
    }

    th, td {
        padding: 10px;
    }

    .logout-button {
        top: 5px;
        right: 5px;
        padding: 8px 15px;
        font-size: 14px;
    }

    .welcome-message {
        top: 40px;
        right: 5px;
        font-size: 14px;
    }

    .logo img {
        width: 100px;
    }

    .center-container {
        padding: 15px;
        max-width: 90%;
    }

    .modal-content {
        width: 90%;
    }
}

/* For small screens (smartphones) */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    main {
        padding: 10px;
        margin-top: 5px;
    }

    form {
        width: 100%;
        max-width: 100%;
        padding: 10px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    .logout-button {
        top: 3px;
        right: 3px;
        padding: 5px 10px;
        font-size: 12px;
    }

    .welcome-message {
        top: 30px;
        right: 3px;
        font-size: 12px;
    }

    .logo img {
        width: 80px;
    }

    .center-container {
        padding: 10px;
        max-width: 100%;
    }

    .modal-content {
        width: 95%;
    }

    .nav-link {
        margin: 0 5px;
        font-size: 14px;
    }

    h1, h2 {
        font-size: 24px;
    }

    button {
        font-size: 12px;
        padding: 8px 15px;
    }

    .village-table td, .village-table th {
        padding: 6px;
    }

    .alert-count {
        font-size: 14px;
    }
}

/* Additional responsive adjustments */
img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
}

.center-container {
    width: 100%;
    max-width: 100%;
}

.modal-content {
    width: 90%;
    max-width: 90%;
}

.logo img {
    width: 150px; /* Adjust as necessary */
    height: auto;
}

body, p, label, input, button, a.nav-link {
    font-size: 16px;
}

@media (max-width: 768px) {
    body, p, label, input, button, a.nav-link {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    body, p, label, input, button, a.nav-link {
        font-size: 12px;
    }

    h1, h2 {
        font-size: 18px;
    }
}

/* Flexbox for main container */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Flexbox for form */
form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Responsive navigation */
.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    a.nav-link {
        padding: 10px 0;
    }
}
