/* ==========================================================================
   1. VARIABLES & GLOBAUX
   ========================================================================== */
:root {
    --spacing-unit: 8px;
    --border-color: #ced4da;
    --border-default: 1px solid var(--border-color);
    /* Simplifié ici */
    --shadow: 0 4px 6px rgba(0, 123, 255, 0.08);
    --primary-blue: #007bff;
    --light-blue: #e6f2ff;
    --text-color: #333;
    --background-light: #f8f9fa;
    --border-radius: 8px;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-light);
    color: var(--text-color);
}

.bg-purple {
    background-color: #6f42c1 !important;
    color: white !important;
}

.bg-blue {
    background-color: var(--primary-blue) !important;
    color: white !important;
}

/* ==========================================================================
   2. HEADER
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: var(--spacing-unit);
    padding: calc(var(--spacing-unit) * 2);
    background-color: white;
    border: var(--border-default);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
}

header h1 {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 2em;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

header time {
    font-weight: 400;
    color: #6c757d;
}

.header-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.date-controls {
    display: flex;
    align-items: center;
}

/* ==========================================================================
   3. LAYOUT PRINCIPAL (MAIN)
   ========================================================================== */
main {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    padding: 0 var(--spacing-unit);
    align-items: flex-start;
}

main>* {
    height: 80vh;
    background-color: white;
    border: var(--border-default);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow-y: auto;
}

#planning-container {
    flex: 3;
    padding: 1rem;
}

main>div:not(#planning-container) {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-unit);
}

/* ==========================================================================
   4. COMPOSANTS (Badges, Listes, Boutons, Inputs)
   ========================================================================== */
#nb_stag,
#liste_formateurs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: calc(var(--spacing-unit) * 2);
    padding: var(--spacing-unit);
    border: var(--border-default);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    background-color: var(--light-blue);
}

#nb_stag h2,
#liste_formateurs h2 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary-blue);
    margin: 0;
}

#stagiaire-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.stagiaire-icon {
    width: 20px;
    height: 20px;
    fill: var(--primary-blue);
    flex-shrink: 0;
}

#liste_formateurs ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#liste_formateurs li {
    padding: 5px 0;
    border-bottom: 1px dotted var(--border-color);
    font-size: 1.1em;
}

#liste_formateurs li:last-child {
    border-bottom: none;
}

.date-picker {
    padding: 0 8px;
    height: 42px;
    border: var(--border-default);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1.1em;
    color: var(--text-color);
    outline: none;
    background-color: white;
}

#location-filter {
    cursor: pointer;
    min-width: 150px;
}

#filtre_lieu {
    display: none;
}

.btn-custom {
    display: inline-block;
    border-radius: 10px;
    background-color: #5D8E9F;
    border: none;
    color: #FFFFFF;
    text-align: center;
    font-size: 1.1em;
    padding: 8px 15px;
    transition: all 0.5s;
    cursor: pointer;
    white-space: nowrap;
}

.btn-custom span {
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: 0.5s;
}

.btn-custom span:after {
    content: '\00bb';
    position: absolute;
    opacity: 0;
    top: 0;
    right: -20px;
    transition: 0.5s;
}

.btn-custom:hover span {
    padding-right: 25px;
}

.btn-custom:hover span:after {
    opacity: 1;
    right: 0;
}

/* ==========================================================================
   5. FOOTER & RESPONSIVE
   ========================================================================== */
footer {
    margin-top: var(--spacing-unit);
    text-align: center;
    padding: var(--spacing-unit);
    color: #6c757d;
}

@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }

    main>* {
        width: 100%;
        max-height: none;
        overflow: visible;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        position: static;
    }

    header h1 {
        position: static;
        transform: none;
        white-space: normal;
    }

    .header-controls {
        flex-direction: column;
        width: 100%;
    }

    #planning-container {
        order: 2;
    }

    main>div:not(#planning-container) {
        order: 1;
    }
}