/* Styles de base. */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #05b14c;
    --warning-color: #be7806;
    --danger-color: #e74c3c;
    --gray-color: #95a5a6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Styles d'en-tête. */
header {
    background-color: var(--dark-color);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

header h1 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a, nav span {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateY(-2px);
}

nav span {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Styles de pied de page. */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

footer p {
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

footer b {
    color: var(--primary-color);
}

/* Styles de bouton. */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--success-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--dark-color);
}

.btn-secondary {
    background-color: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--dark-color);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.btn-complete {
    background-color: var(--success-color);
    color: white;
}

.btn-cancel {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}


/* cancel day */
.day-header-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px solid #ddd;
}

.cancel-day-btn {
    font-size: 0.8em;
    padding: 2px 8px;
    margin-left: 10px;
}

.btn-sm.btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
}

.btn-sm.btn-danger:hover {
    background-color: #c82333;
}


/* Styles de formulaire. */
.auth-form {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--dark-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Styles du tableau de bord. */
.dashboard-section {
    background: white;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.dashboard-section h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.appointment-form {
    max-width: 700px; /* Set the maximum width */
    margin: 0 auto;   /* Center the form horizontally */
    padding: 10px;    /* Add some padding for spacing */
    background-color: white; /* Optional: Add a background color */
    border-radius: 8px; /* Optional: Add rounded corners */
}

.appointments-list table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-list th,
.appointments-list td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.appointments-list th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.appointments-list tr:hover {
    background-color: #f8f9fa;
}

/* Styles du calendrier. */
.calendar-view {
    margin-top: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.day-header {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background-color: #f8f9fa;
}

.day-cell {
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    background-color: white;
}

.day-cell.empty {
    background-color: #f8f9fa;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Highlight today's date in calendar */
.day-number.today {
    background-color: #11b37d;
    color: white;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -4px 0 4px -4px;
}

/* Highlight the border of today's date in the calendar */
.day-cell.today {
    border: 2px solid var(--primary-color);
    border-radius: 8px;
}

.appointment-slot {
    background-color: var(--light-color);
    padding: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.status-letter {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    color: #fffcfc;
    font-weight: bold;
    margin-left: 5px;
}

.status-letter.planifié {
    background-color: #53a6ff; /* Blue for "Planifié" */
}

.status-letter.terminé {
    background-color: #4dfd76; /* Green for "Terminé" */
}

.status-letter.annulé {
    background-color: #fc5565; /* Red for "Annulé" */
}

.filters-section {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.filters-section select,
.filters-section input {
    max-width: 200px;
}

/* Section principale.
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 8px;
    margin-bottom: 40px;
} */

.hero {
    position: relative; /* Ensure ::before is positioned relative to this container */
    background-image: url('/static/images/photo1.jpg'); /* Path to your background image */
    background-size: cover; /* Ensure the image covers the entire section */
    background-position: center; /* Center the image */
    background-repeat: no-repeat; /* Prevent the image from repeating */
    color: var(--dark-color); /* Change text color for better contrast */
    text-align: center; /* Center-align text */
    padding: 60px 20px; /* Add padding for spacing */
    overflow: hidden; /* Prevent the overlay from spilling out */
    z-index: 0; /* Ensure the hero section stays below the overlay */
    margin-bottom: 40px;
    border-radius: 8px;

}

.hero::before {
    content: '';
    position: absolute; /* Position it absolutely inside .hero */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4); /* white with 60% opacity */
    z-index: 1; /* Layer it above the .hero but below the text */
}


.hero * {
    position: relative; /* Ensure text and other elements are above the overlay */
    z-index: 2; /* Make sure text/content stays above the overlay */
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Style for the "Aujourd'hui" button */
#reset-week {
    width: auto; /* Allow the button to fit its text */
    padding: 0 10px; /* Add horizontal padding for text */
    font-size: 0.9rem; /* Adjust font size to match other buttons */
    text-align: center; /* Center the text */
    background-color: var(--gray-color); /* Button background */
    border: none; /* Remove border */
    cursor: pointer;
    height: 30px; /* Match height with arrow buttons */
}

#reset-week:hover {
    background-color: var(--dark-color); /* Change background on hover */
    color: white; /* Ensure text is visible */
}

/* Add these styles for reschedule */
.btn-reschedule {
    background-color: #0697eb;
    color: white;
}

/* Modal styles for reschedule */
#reschedule-modal .modal-content {
    max-width: 400px;
}

#reschedule-modal .form-group {
    margin-bottom: 15px;
}

#reschedule-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

#reschedule-modal input[type="date"],
#reschedule-modal input[type="time"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#new-appointment-date {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #333;
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    background-color: #fff;
}

#new-appointment-date:focus {
    border-color: #f2f7fc;
    background-color: #f0f8ff;
}

/* fin reschedule */

/* CSS pour la page d'oubli de mot de passe */
.auth-form {
    width: 100%;
    max-width: 500px;
    margin: auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.btn-primary2 {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary2:hover {
    background-color: var(--secondary-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: 1px solid #bee5eb;
}

.btn-primarys {
    background-color: var(--primary-color);
    color: white;
    width: 15%;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primarys:hover {
    background-color: var(--secondary-color);
}

/* fin mdp recup */


/* Section des fonctionnalités. */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.feature {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(0deg, #ecfffc, #eefffe, #d7fffd); /* gradient added */
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.feature i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

/* ajouter pour flatpicker*/
#appointment-date {
    border: 2px solid #007bff;
    border-radius: 5px;
    padding: 10px;
    font-size: 16px;
    color: #333;
}

/* Flatpickr calendar style override */
.flatpickr-calendar {
    background-color: #f9f9f9e8;
    border: 1px solid #cccccc9a;
}

.flatpickr-day.today {
    background-color: #007bff;
    color: rgb(235, 185, 127);
}
/* fin ajouter pour flatpickr*/

/* Adjust spacing between buttons */
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px; /* Reduce the gap between buttons */
}
/* Style for the arrow buttons */
.btn-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px; /* Set a fixed width */
    height: 30px; /* Set a fixed height */
    padding: 0; /* Remove extra padding */
    background-color: var(--gray-color); /* Button background */
    border: none; /* Remove border */
    cursor: pointer;
    position: relative; /* For positioning the arrows */
}

.btn-arrow:hover {
    background-color: var(--dark-color); /* Change background on hover */
}

/* Left arrow */
.arrow-left::before {
    content: '';
    position: absolute;
    border: solid transparent;
    border-width: 6px;
    border-right-color: white; /* Arrow color */
    left: 11px; /* Position inside the button */
    top: 50%;
    transform: translateY(-50%);
}

/* Right arrow */
.arrow-right::before {
    content: '';
    position: absolute;
    border: solid transparent;
    border-width: 6px;
    border-left-color: white; /* Arrow color */
    right: 11px; /* Position inside the button */
    top: 50%;
    transform: translateY(-50%);
}

/* Admin Dashboard Styles */
.admin-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.admin-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}



.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filters input, .filters select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Table Styles */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}
#appointment-list-doc,
#patients-table,
#users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

#appointment-list-doc th,
#appointment-list-doc td,
#patients-table th,
#patients-table td,
#users-table th,
#users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#appointment-list-doc th,
#patients-table th,
#users-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

#appointment-list-doc tr:hover,
#patients-table tr:hover,
#users-table tr:hover {
    background-color: #f5f5f5;
}

#appointment-list-doc tr:nth-child(even),
#patients-table tr:nth-child(even),
#users-table tr:nth-child(even){
    background-color: #f9f9f9;
}

/* Make table cells use available space */
#appointment-list-doc,
#patients-table,
#users-table {
    table-layout: auto;
}


#appointment-list-doc th:nth-child(1) { width: 30%; }  /* full name */
#appointment-list-doc th:nth-child(2) { width: 20%; } /* datetime */
#appointment-list-doc th:nth-child(3) { width: 15%; } /* statut */
#appointment-list-doc th:nth-child(4) { width: 35%; } /* actions */

#patients-table th:nth-child(1) { width: 5%; }  /* ID */
#patients-table th:nth-child(2) { width: 20%; } /* Username */
#patients-table th:nth-child(3) { width: 30%; } /* Full Name */
#patients-table th:nth-child(4) { width: 30%; } /* Email */
#patients-table th:nth-child(5) { width: 15%; } /* Actions */

#users-table th:nth-child(1) { width: 5%; }  /* ID */
#users-table th:nth-child(2) { width: 20%; } /* Username */
#users-table th:nth-child(3) { width: 25%; } /* Full Name */
#users-table th:nth-child(4) { width: 25%; } /* Email */
#users-table th:nth-child(5) { width: 25%; } /* Actions */



/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: flex-start;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    max-height: 90vh; /* Limit height to 90% of the viewport */
    overflow-y: auto;
    scrollbar-width: thin;              /* "auto" or "thin" */
    scrollbar-color: #888 #e4dfdf;
    margin-top: 30px;
    width: 50%;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}


/* patient form box */
.forms-container {
    display: flex;
    justify-content: space-between;
    gap: 20px; /* Space between the forms */
}

.form-left,
.form-right {
    flex: 1; /* Make both forms take equal width */
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-left {
    margin-right: 10px; /* Optional: Add spacing to the left form */
}

.form-right {
    margin-left: 10px; /* Optional: Add spacing to the right form */
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    nav a, nav span {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    footer {
        padding: 1.5rem 0;
    }
    
    footer p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .forms-container {
        flex-direction: column; /* Stack forms vertically on smaller screens */
    }

    .form-left,
    .form-right {
        margin: 0; /* Remove margins for stacked layout */
    }
}

/* Responsive adjustments */
/* Styles adaptatifs. */


@media (max-width: 992px) {
    .table-container {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    #users-table {
        display: inline-block;
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
    
    .filters {
        flex-direction: column;
    }

    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav {
        margin-top: 15px;
    }
    
    nav a {
        margin: 0 10px;
    }
    
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 10px;
    }

    #users-table th,
    #users-table td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 3px 6px;
        font-size: 0.8rem;
    }
}



