/* Apply background image */
body {
    background-image: url("/static/images/custom_bg.jpg");
    background-size: cover;
    background-position: center;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
}



/* LOG IN PAGE ----------------------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Style the login box */
.login-box {
    background-color: rgba(255, 255, 255, 0.8);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 300px;
}

/* Style des labels */
.login-box label {
    display: block;          /* Chaque label sur une nouvelle ligne */
    font-weight: bold;       /* Rendre le texte en gras */
    margin-bottom: 5px;      /* Ajoute un espace entre le label et le champ */
    font-size: 16px;         /* Ajuste la taille du texte si nécessaire */
    color: #333;             /* Couleur du texte */
}

/* Style the input fields and button */
.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 16px;
    box-sizing: border-box;
}

.login-box button {
    width: 80%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    margin-top: 20px; 
}

.login-box button:hover {
    background-color: #45a049;
}

/* Style the register link */
.login-box p {
    margin-top: 15px;
}

.login-box a {
    color: #4CAF50;
    text-decoration: none;
}

.login-box a:hover {
    text-decoration: underline;
}

.logo {
    max-width: 60%; /* S'assure que l'image ne dépasse pas la largeur de son conteneur */
    height: auto;    /* Garde les proportions */
    display: block;  /* Centre l'image dans le conteneur */
    margin: 0 auto 20px auto;   /* Centre horizontalement */
}

/* ---------------------------------------------- */

/* FLASH MESSAGES ------------------------------- */
.flash-messages {
    position: absolute;        /* Position it absolutely relative to the .login-container */
    top: 40px;                 /* Adjust the top position to be above the login box */
    left: 50%;                 /* Center the message horizontally */
    transform: translateX(-50%); /* Center the container perfectly */
    width: 40%;                /* Width of the flash message */
    z-index: 10;               /* Make sure it's above other elements */
}

/* Flash message styles */
.flash-message {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
    animation: dropIn 2s ease-out, fadeOut 3s 2s forwards; /* Adding fade-out effect */
}

/* Error message styles (for duplicate company/logo) */
.flash-message.error {
    background-color: #ffcccc;
    color: #cc0000;
}

/* Success message styles (for successful creation) */
.flash-message.success {
    background-color: #d4edda;
    color: #155724;
}

/* Animation for drop-down effect */
@keyframes dropIn {
    from {
        transform: translateY(-50px);  /* Start from above the screen */
        opacity: 0;
    }
    to {
        transform: translateY(0);      /* End at the normal position */
        opacity: 1;
    }
}

/* Fade-out effect after 2 seconds */
@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ---------------------------------------------- */

/* NAVBAR ------------------------------------ */
#wrapper {
    width: 1000px; /* Set the desired width of the menu */
    margin: 0 auto; /* Centers the menu horizontally */
    position: absolute; /* Positioning the menu absolutely */
    top: 20px; /* Adjust the top distance from the page */
    left: 50%; /* Position it in the center horizontally */
    transform: translateX(-50%); /* Corrects the position for exact center */
    border: 2px solid black; /* Adds a black border around the menu */
    border-radius: 30px; /* Makes the border circular */
    padding: 10px;
    background-color: #ffffffcb; /* White background for the menu */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Adds subtle shadow for depth */
}

/* Menu list styling */
#wrapper ul {
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    height: 80px; /* Adjust the height as needed */
    font-size: 16px; /* Adjust font size */
}
  
  #wrapper ul:hover li {
    width: (100% / 6) / (5 / 4);
  }
  
  #wrapper ul li {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 16.666%; /* Adjust as needed */
    transition: all .1s;
    text-align: center;
    box-sizing: border-box;
    text-shadow: 0px 1px 3px rgba(white, 1);
    border-bottom: thin solid rgb(156, 155, 155);
    border-radius: 15px; /* Rounded corners for each item */
    padding: 5px;
}

/* Hover effect */
#wrapper ul li:hover {
    background: rgba(230, 230, 230, 1);
    width: 33.333%; /* Adjust as needed */
    box-shadow: inset 10px 10px 10px -10px rgba(black, 0.3),
                inset -10px 10px 10px -10px rgba(black, 0.3);
}

  /* Active item styling */
#wrapper ul li a {
    display: block;
    box-sizing: border-box;
    padding-top: 19px;
    height: 80px; /* Adjust the height to match the menu item */
    text-decoration: none;
    font-size: 20px;
    color: gray;
}

#wrapper ul li a:visited {
    color: gray;
}

#wrapper ul li div {
    margin-top: 5px;
    font-weight: 600;
    font-size: 13px;
}

/* Header Container */
.header {
    display: flex; /* Utilise Flexbox pour aligner les éléments */
    align-items: center; /* Aligne le logo et le menu verticalement */
    justify-content: center; /* Centre les enfants horizontalement */
    position: relative; /* Positionnement relatif pour ajustements */
    height: 100px; /* Hauteur de la barre de navigation */
    padding: 0 20px; /* Espacement horizontal */
}

/* Logo Styles */
.logohome {
    position: absolute; /* Place le logo en position absolue */
    left: 30px; /* Distance depuis le bord gauche */
    top: 20%; /* Centre verticalement */
    height: 120px; /* Ajuste la taille du logo */
  
}


  /*  ------------------------------------ */
/* Media Queries for Responsive Design */

@media screen and (max-width: 1280px) {
    .logohome {
        left: 10px; /* Réduit la distance à gauche */
        height: 90px; /* Réduit la taille du logo */
    }

}


@media screen and (max-width: 1024px) {
    .logohome {
        left: 10px; /* Réduit la distance à gauche */
        height: 60px; /* Réduit la taille du logo */
    }

    #wrapper {
        width: 75%; /* Réduit la largeur du menu */
        left: 50%;
        transform: translateX(-50%);
    }

    #wrapper ul {
        flex-wrap: wrap; /* Permet aux éléments de passer à la ligne */
        justify-content: space-around; /* Espace les éléments */
    }

    #wrapper ul li {
        width: 10%; /* Réduit la largeur des items à 33% */
        font-size: 12px; /* Réduit la taille de la police */
        padding: 3px; /* Ajoute de l'espace autour de chaque élément */
    }

    #wrapper ul li a {
        font-size: 14px; /* Réduit encore la taille de la police pour les éléments */
    }

    .login-box {
        width: 70%; /* Réduit encore la largeur du formulaire */
    }
}

@media screen and (max-width: 768px) {
    .logohome {
        left: 5px;
        height: 45px; /* Logo encore plus petit sur mobile */
    }

    #wrapper {
        width: 80%; /* Utilise toute la largeur disponible */
        padding: 1; /* Supprime les marges internes */
    }

    #wrapper ul {
        flex-wrap: wrap; /* Permet aux éléments de passer à la ligne */
        justify-content: center; /* Centre les éléments */
    }

    #wrapper ul li {
        width: 13%; /* Chaque élément prend 50% de la largeur */
        font-size: 5px; /* Réduit encore la taille de la police */
        padding: 1px; /* Réduit l'espace autour de chaque élément */
    }

    #wrapper ul li a {
        font-size: 12px; /* Réduit la taille du texte dans les liens */
    }

    .login-box {
        width: 85%; /* Réduit encore la largeur du formulaire */
    }
}



/* ENTREPRISE PAGES ------------------------------------ */

/* bouton haut de page 
 ------------------------------------ */
/* Button container styling */
.btn-container {
    position: absolute; /* Make it stay above the page */
    top: 80px; /* Adjust to ensure it stays below the navbar */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Correct the centering */
    z-index: 10; /* Ensure the button stays above other elements */
    margin-bottom: 20px; /* Add spacing below the button */
    display: flex; /* Use flexbox for alignment */
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 10px; /* Add space between buttons */
    justify-content: center; /* Center align the buttons */
}

/* Styled button */
.btn {
    padding: 15px 40px; /* Larger padding for bigger button */
    background-color: #007bffd5;
    color: white;
    border: 2px solid #0262c9; /* Add border */
    border-radius: 25px; /* Rounded corners */
    cursor: pointer;
    font-size: 16px; /* Increase font size */
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3); /* Subtle shadow for depth */
    transition: all 0.3s ease; /* Smooth transition for hover effects */
}

/* Hover effect */
.btn:hover {
    background-color: #0056b3;
    border-color: #003d80;
    transform: translateY(-2px); /* Slight movement on hover */
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5); /* Stronger shadow on hover */
}

/* Media query for smaller screens (e.g., iPads, tablets) */
@media (max-width: 768px) {
    .btn-container {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center; /* Center align the buttons */
        top: 30px;
    }

    .btn {
        width: 100%; /* Make buttons take up full width */
        max-width: 300px; /* Optional: Set a max width for large screens */
    }
}


/* section pour le tableau  ------------------------------------ */

/* Table container */
.container {
    display: flex;
    justify-content: center; /* Centers the table horizontally */
    align-items: flex-start; /* Keeps the table at the top of the container */
    width: 100%;
    height: 100%;
    position: relative;
}

/* Table stays at the current position */
table {
    width: 800px;
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;  /* Relative positioning */
    top: 200px;  /* Adjust top to ensure table isn't at the very top */
    background-color: white;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.336); /* Adds a black border around the menu */
    border-radius: 30px; /* Makes the border circular */
    max-height: 500px;
    overflow-y: auto; /* Make the table scrollable vertically */
    border-radius: 10px;
}


th,
td {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #000000;
    font-weight: bold; /* Make all text bold */
}

td {
    text-align: center; /* Centers text horizontally in the column */
    vertical-align: middle; /* Centers text vertically in the row */
}

thead{
    border: 2px solid black; /* Adds a black border around the menu */
    border-radius: 30px; /* Makes the border circular */
}


th {
    text-align: center;
    background-color: #2a42af54;
}

tbody tr:hover {
    background-color: rgba(0, 174, 255, 0.651);
}

.edit-btn,
.print-btn,
.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.edit-btn img,
.print-btn img,
.delete-btn img{
    display: block;
    width: 20px; /* Adjust the size as needed */
    height: 20px;
}

.edit-btn:hover img,
.print-btn:hover img,
.delete-btn:hover img {
    filter: brightness(1.2); /* Add a hover effect */
}




/* modale du bouton  ------------------------------------ */

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 50%;  /* Vertically center */
    left: 50%; /* Horizontally center */
    transform: translate(-50%, -50%); /* Adjust for true center alignment */
    width: 100vw;  /* Use full viewport width */
    height: 100vh; /* Full height of the viewport */
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    display: flex;
    justify-content: center; /* Center content horizontally */
    align-items: center; /* Center content vertically */
    z-index: 1000; /* Ensure the modal is above other elements */
}

.modal[hidden] {
    display: none !important; /* Ensure it's completely hidden */
}


/* Modal content */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 500px;  /* Set a fixed width */
    max-width: 90%;  /* Allow it to scale on smaller screens */
    display: flex;
    flex-direction: column;
    align-items: center;  /* Center content horizontally */
    gap: 20px;  /* Space between form elements */
    text-align: center; /* Center text horizontally */
}

/* Input fields styling */
.modal-content input[type="text"],
.modal-content input[type="file"],
.modal-content input[type="date"]  {
    width: 80%;  /* Ensure consistent width for inputs */
    padding: 12px;
    margin-top: 8px;
    margin-bottom: 20px;  /* Add space below the input field */
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
}

/* Reduce spacing between start_date and end_date fields */
.modal-content #start_date,
.modal-content #end_date {
    margin-bottom: 20px; /* Adjust the bottom margin for closer spacing */
}

/* Label styling */
.modal-content label {
    display: block; /* Ensure label is displayed as a block element */
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px; /* Add space below the label */
}

/* Close button */
.modal .close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

/* Align "Save" button at the bottom center of the modal */
.modal-content button {
    align-self: center;
    padding: 15px 40px;
    background-color: #007bffd5;
    color: white;
    border: 2px solid #0262c9;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
}

/* Hover effect for "Save" button */
.modal-content button:hover {
    background-color: #0056b3;
    border-color: #003d80;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}


.modal-content .form-group {
    width: 100%;         /* Take full width of the modal content */
    margin-bottom: 20px; /* Add spacing between form groups */
    text-align: left;    /* Align text to the left for labels */
}

/* Dropdown Styling */
.modal-content select {
    width: 100%;         /* Full width of the dropdown */
    padding: 12px;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box;
}

/* Quantity Input Styling */
.modal-content input[type="number"] {
    width: 100%;         /* Full width for consistency */
    padding: 12px;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box; /* Prevent overflow */
}




/* --------------------------------------------------- */

/* CSS for the checkbox in ticket page    ------------------------------------ */

.facture-row {
    background-color: #16dd45 !important; /* Light green */
}

/* Make Facturé Checkbox Bigger */
.facture-checkbox {
    width: 13px;  /* Adjust width */
    height: 13px; /* Adjust height */
    transform: scale(1.5); /* Scale up the checkbox */
    cursor: pointer; /* Make it clickable */
}



/* --------------------------------------------------- */

/* CSS for the scanning page   ------------------------------------ */


/* Scan Container */
.scan-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    margin-top: 100px;
    position: relative;
    z-index: 1; /* Ensure container and its children are above others */
}

/* Scanner Input */
.scanner-input {
    width: 40%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #007bffd5;
    border-radius: 10px;
}

.scanned-tickets-container .valid {
    color: green;
    font-weight: bold;
}

.scanned-tickets-container .invalid {
    color: red;
    font-weight: bold;
}


/* Confirm Button */
#confirmTickets {
    margin: 20px 0; /* Add spacing above and below the button */
    align-self: center; /* Center the button horizontally in the container */
    padding: 15px 40px;
    font-size: 18px;
    background-color: #007bffd5;
    color: white;
    border: 2px solid #0262c9;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 10; /* Ensure it is above other elements */
}

/* Confirm Button Hover */
#confirmTickets:hover {
    background-color: #0056b3;
    border-color: #003d80;
    transform: translateY(-2px); /* Slightly lift on hover */
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.5);
}

/* Scanned Tickets Table Container */
.scanned-tickets-container {
    margin-top: -150px; /* Reduce the spacing above the table */
    width: 100%;
    display: flex;
    justify-content: center; /* Center the table horizontally */
}


.custom-alert {
    display: none; /* Hide by default */
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.custom-alert.show {
    display: flex;
}


.custom-alert-content {
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    text-align: center;
    width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.custom-alert-icon-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


.alert-text {
    font-weight: bold;
    color: #e67e22; 
    font-size: 16px;
    margin: 0;
}

/* OK button */
#customAlertBtn {
    margin-top: 15px;
    padding: 8px 18px;
    cursor: pointer;
    background-color: #007bffd5;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease;
}

#customAlertBtn:hover {
    background-color: #1974d6d5;
}


.count-display-row {
    width: 75%;
    display: flex;
    justify-content: space-between;
    padding: 0 10%;
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
}

.count-valid {
    color: green;
}

.count-invalid {
    color: red;
}

/* --------------------------------------------------- */

/* CSS for the compte pages   ------------------------------------ */

.compte-container {
    margin: 125px auto; /* Increased top margin for more space from the navbar */
    width: 50%;
    background: #f9f9f9;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center; /* Centers the content within the container */
}

.compte-container h1 {
   margin-bottom: 60px;
}

.compte-container h2 {
    margin-top: 50px; /* Adds space above the h2 element */
    margin-bottom: 40px; /* Keeps the existing space below */
}

.form-compte {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center; /* Centers form elements horizontally */
}

.form-group {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers labels and inputs */
    width: 100%; /* Ensures inputs are responsive */
}

.form-group label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: center; /* Centers the label text */
}

.form-group input {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 10px;
    width: 90%; /* Keeps input consistent across screen sizes */
    max-width: 400px; /* Optional: limits input width on large screens */
}


.btn:hover {
    background-color: #0056b3;
}


/* --------------------------------------------------- */

/* CSS for the stats pages   ------------------------------------ */

.stats-container {
    padding: 20px;
    text-align: center;
    margin-top: 20px;
}

.stats-summary {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 20px 0;
    margin-top: 40px;
}

.stat {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    max-width: 200px;
}

.chart-container {
    margin: 40px auto;
    width: 100%;
    max-width: 800px;
    margin-top: 60px;
}

.top-companies {
    margin-top: 60px;
}

.top-companies ul {
    list-style: none;
    padding: 0;
}

.top-companies li {
    background: #f1f1f1;
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
}
