/* ======= GLOBAL STYLES ======= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    padding: 20px;
}

/* ======= HEADER / MENU ======= */
h2 {
    text-align: center;
    margin-bottom: 20px;
}

h3.month-display {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
    margin: 15px 0;
}

/* ======= FORMS ======= */
form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

form label {
    font-weight: bold;
}

form input, form select, form button, form textarea {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 5px;
    width: 100%;
}

form button {
    background: #007bff;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease;
}

form button:hover {
    background: #0056b3;
}

/* ======= AUTOCOMPLETE DROPDOWN FIX ======= */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-results {
    position: absolute;
    top: 100%; /* Ensures dropdown appears right below input */
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
}

.autocomplete-results div {
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-results div:hover {
    background: #f0f0f0;
}

/* ======= CALENDAR TABLE ======= */
.calendar {
    width: 100%;
    max-width: 1000px;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.calendar th, .calendar td {
    border: 1px solid #ddd;
    text-align: center;
    padding: 15px;
    min-width: 120px;
}

.calendar th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

.calendar td {
    vertical-align: top;
    background: #f9f9f9;
}

.calendar .date {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

/* ======= USER DISPLAY IN CALENDAR ======= */
.user {
    font-size: 14px;
    padding: 6px;
    border-radius: 5px;
    margin-top: 5px;
    text-align: center;
    color: black;
}

/* ======= REASON TYPE COLORS ======= */
.conge { background-color: green; }
.maladie { background-color: yellow; color: black; }
.absence { background-color: red; }
.sans-motif { background-color: red; }
.autre { background-color: lightblue; }

/* ======= FORM CONTAINER ======= */
.form-container {
    max-width: 600px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.form-container h3 {
    text-align: center;
}

/* ======= TABLE STYLING ======= */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

table th {
    background-color: #007bff;
    color: white;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* ======= RESPONSIVE DESIGN ======= */
@media (max-width: 768px) {
    .calendar td {
        min-width: 80px;
        padding: 10px;
    }

    .user {
        font-size: 12px;
        padding: 4px;
    }

    form {
        flex-direction: column;
        align-items: center;
    }

    form input, form select, form button {
        width: 100%;
    }
}


.delete-btn {
    background-color: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
}
.delete-btn:hover {
    background-color: darkred;
}
