/* Style de la barre de navigation */
nav {
    background-color: #333;
    padding: 11px;
    text-align: left;
    justify-content: flex-start; /* Les éléments sont alignés à gauche */
    gap: 15px; /* Default gap */
}
/* Overall Nav Bar Styling */
nav {
    display: flex; /* Use Flexbox for the main layout */
    align-items: center; /* Vertically align items */
    flex-wrap: wrap; /* Allow items to wrap onto the next line */
    background-color: #333; /* Example background */
    padding: 5px 15px; /* Padding around the nav bar */
    gap: 15px; /* Space between flex items (logo, links container, user controls) */
    min-height: 60px; /* Ensure a minimum height */
}

/* Logo Styling */
.logo {
    /* Remove absolute positioning */
    /* position: absolute; */
    /* top: 20px; */
    /* right: 20px; */

    max-height: 50px; /* Control max height - adjust as needed */
    width: auto;      /* Maintain aspect ratio */
    object-fit: contain;
    flex-shrink: 0; /* Prevent logo from shrinking if space is tight */
}

/* Container for the main navigation links */
.nav-links-container {
    display: flex; /* Use Flexbox for the links themselves */
    flex-wrap: wrap; /* Allow links to wrap */
    gap: 8px; /* Space between individual links */
    flex-grow: 1; /* Allow this container to grow and take available space */
    justify-content: flex-start; /* Align links to the start (or center, space-around) */
    min-width: 200px; /* Give it some minimum width before wrapping aggressively */
}

/* Individual Navigation Link Styling */
nav a.main-nav { /* More specific selector if needed */
    color: white;
    text-decoration: none;
    font-size: 14px; /* Slightly adjusted size */
    padding: 8px 12px; /* Slightly adjusted padding */
    cursor: pointer;
    border-radius: 4px;
    display: inline-block; /* Keep as inline-block or block */
    background-color: #444; /* Default background for links */
    transition: background-color 0.2s ease; /* Smooth hover */
    /* Remove margin-right, use gap in container */
}

nav a.main-nav:hover {
    background-color: #575757;
}

/* Style du lien actif */
nav a.main-nav.active {
    background-color: #ff6f61; /* Couleur du bouton actif */
    font-weight: bold;
}


/* Container for User Controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between user display and logout */
    margin-left: auto; /* Push this group to the far right */
    flex-shrink: 0; /* Prevent shrinking */
}

/* User Display Styling */
#loggedInUserDisplay {
    color: white;
    padding: 8px 10px; /* Consistent padding */
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    white-space: nowrap; /* Prevent username from wrapping */
    /* Remove margin-left: auto (handled by parent) */
}

/* Logout Link/Button Styling */
#logoutLink {
    background-color: #dc3545;
    color: white;
    padding: 8px 12px; /* Consistent padding */
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    white-space: nowrap; /* Prevent text wrapping */
    /* Remove margin-left */
    transition: background-color 0.2s ease; /* Smooth hover */
}
#logoutLink:hover {
    background-color: #c82333;
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}

#content {
    width: 100%;
    height: 80vh;
    border: none;

}


/* Sous-titres */
h2 {
    color: rgb(0, 0, 0);
    text-align: center;
    background-color: #f8f9fa;
    padding: 10px;
    font-size: 14px;
}

/* Corps de la page */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    text-align: center;
    font-size: 12px;
}

fieldset {
    width: 80%;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    border: 2px solid #007bff;
}

/* Légende principale */
legend {
    font-size: 14px;
    font-weight: bold;
    color: #007bff;
    padding: 5px 10px;
    border-radius: 10px;
    background-color: #e6f0ff;
    border: 1px solid #007bff;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}
.file-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    overflow-wrap: break-word;
}

.select-list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    overflow-wrap: break-word;
}

.display-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Responsive columns */
    row-gap: 0;
    column-gap: 0;
    overflow-wrap: break-word;
}

/* Media Query for Mobile Devices */
@media (max-width: 1000px) {
    .display-columns {
        grid-template-columns: repeat(5, 1fr); /* Adjust to 3 columns for smaller screens */
    }
}
@media (max-width: 850px) {
    .display-columns {
        grid-template-columns: repeat(3, 1fr); /* Adjust to 3 columns for smaller screens */
    }
}

@media (max-width: 600px) {
    .display-columns {
        grid-template-columns: repeat(2, 1fr); /* Adjust to 3 columns for smaller screens */
    }
    .select-list {
        grid-template-columns: repeat(2, 1fr); /* Adjust to 3 columns for smaller screens */
    }
    .file-list {
        grid-template-columns: repeat(2, 1fr); /* Adjust to 3 columns for smaller screens */
    }
}

@media (max-width: 400px) {
    .display-columns {
        grid-template-columns: 1fr; /* Adjust to 1 column for very small screens */
    }
    .select-list {
        grid-template-columns: 1fr; /* Adjust to 1 column for very small screens */
    }
    .file-list {
        grid-template-columns: 1fr; /* Adjust to 1 column for very small screens */
    }
}
/* Contenu du champ */
#columnDisplay {
    color: #333;
    text-align: center;

}

/* Effet au survol */
#columnDisplay:hover {
    background-color: #e6f0ff;
    border-color: #0056b3;
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.25);
    color: #0056b3;
}

/* Container for Language and User Controls */
.controls-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between language and user controls */
    margin-left: auto; /* Push this group to the far right */
    flex-shrink: 0; /* Prevent shrinking */
    flex-wrap: wrap; /* Allow wrapping if space is tight */
}

/* Language Selector Styling */
.language-selector {
    display: flex;
    align-items: center;
}

/* Style the select dropdown */
#languageSelect {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #666;
    background-color: #555;
    color: white;
    font-size: 13px;
    cursor: pointer;
    margin-left: 5px; /* Space between label (if shown) and select */
}

#languageSelect:focus {
    outline: none;
    border-color: #aaa;
    box-shadow: 0 0 0 2px rgba(150, 150, 150, 0.5);
}

/* Optional: Style the options */
#languageSelect option {
    background-color: #333;
    color: white;
}


/* Visually hidden class for accessibility labels */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* Container for User Controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between user display and logout */
    /* remove margin-left: auto; */ /* Handled by the parent .controls-container */
    flex-shrink: 0; /* Prevent shrinking */
}
/* Boutons */
    .button1 {
        height: 30px;
        width: 10%;
        color: white;
        background-color: #007bff;
        border: none;
        border-radius: 30px;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.3s ease-in-out;
        text-align: center;
    }


    /* Media query for tablets */
    @media (max-width: 1200px) {
        .button1 {
            width: 15%; /* Increase button width for tablets */
        }
    }
    @media (max-width: 900px) {
        .button1 {
            width: 20%; /* Increase button width for tablets */
        }
    }

    @media (max-width: 700px) {
        .button1 {
            width: 32%; /* Increase button width for tablets */
        }

    }
    /* Media query for mobile devices */
    @media (max-width: 450px) {
        .button1 {
            width: 50%; /* Increase button width for mobile */
            height: 40px; /* Slightly smaller height */
            margin: 5px 0;
        }
    }

.button1:hover {
    background-color: #0056b3;
}

/* Labels */
label {
    display: inline-block;
    margin: 5px;
    padding: 8px 12px;
    border-radius: 30px;
    border: 1px solid #007bff;
    cursor: pointer;
    transition: 0.3s;
}

label:hover {
    color: white;
    background-color: #007bff;
}


input[type="file"] {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

/* Styling for Prediction Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 101;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex; /* Changed to flex for better structure */
    flex-direction: column;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #007bff;
}

.modal p {
    margin-bottom: 15px;
    font-size: 1em;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    overflow-y: auto; /* Make the list scrollable */
    flex-grow: 1; /* Allow the list to take available space */
}
.feature-list div {
    display: flex;
    align-items: center;
}
.feature-list label {
    margin-left: 5px;
    font-size: 0.9em;
}

.modal-buttons {
    margin-top: 20px;
    text-align: right;
}
.modal-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}
.modal-buttons button#confirmPredictionFeatures {
    background-color: #28a745;
    color: white;
}
.modal-buttons button#cancelPredictionFeatures {
    background-color: #dc3545;
    color: white;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Poppins', sans-serif;
}

.loading-box {
    text-align: center;
    background-color: #444;
    padding: 30px 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.loading-box p {
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: 500;
}

.hourglass {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}
.hourglass:after {
    content: " ";
    display: block;
    border-radius: 50%;
    width: 0;
    height: 0;
    margin: 8px;
    box-sizing: border-box;
    border: 32px solid #fff;
    border-color: #fff transparent #fff transparent;
    animation: hourglass-spin 1.2s infinite;
}

@keyframes hourglass-spin {
    0% {
        transform: rotate(0);
        animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    }
    50% {
        transform: rotate(900deg);
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    }
    100% {
        transform: rotate(1800deg);
    }
}