/* =====================================================
   ENLA 2.0 — MODULE DOS
   Fichier : assets/css/dos.css
   Style général de l'application
===================================================== */

/* =====================================================
   1. VARIABLES GLOBALES
===================================================== */

:root {
    --enla-primary: #165BFB;
    --enla-primary-hover: #104bd4;
    --enla-dark: #202b46;
    --enla-white: #ffffff;

    --enla-background: #f6f4fc;
    --enla-text: #29243a;
    --enla-text-secondary: #898499;
    --enla-border: #eae7f1;

    --sidebar-width: 260px;
    --navbar-height: 82px;

    --transition: 0.2s ease;
}

/* =====================================================
   2. RÉINITIALISATION
===================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;

    color: var(--enla-text);
    background: var(--enla-background);

    font-family:
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    font-size: 14px;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

/* =====================================================
   3. STRUCTURE PRINCIPALE
===================================================== */

#app {
    min-height: 100vh;
    min-height: 100dvh;
}

/*
   Le menu latéral est fixe.
   Le contenu principal doit donc être décalé
   de la largeur du menu sur ordinateur.
*/

#main-container {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;

    margin-left: var(--sidebar-width);

    transition: margin-left var(--transition);
}

/* =====================================================
   4. CONTENU DES PAGES
===================================================== */

#content {
    min-width: 0;
    min-height: calc(100vh - var(--navbar-height));

    padding: 28px;
}

/* =====================================================
   5. CHARGEMENT
===================================================== */

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 240px;
    padding: 30px;

    color: var(--enla-text-secondary);
    text-align: center;
}

.loading-container p {
    margin: 0;
    font-size: 14px;
}

/* =====================================================
   6. VOILE DE FOND DU MENU MOBILE
===================================================== */

#overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    background: rgba(20, 25, 40, 0.48);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity var(--transition),
        visibility var(--transition);
}

#app.sidebar-open #overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =====================================================
   7. ÉLÉMENTS COMMUNS
===================================================== */

.page-container {
    width: 100%;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;

    margin-bottom: 24px;
}

.page-title {
    margin: 0;
    color: var(--enla-text);
    font-size: 1.4rem;
    font-weight: 700;
}

.page-description {
    margin: 6px 0 0;
    color: var(--enla-text-secondary);
    font-size: 0.875rem;
}

/* =====================================================
   8. BOUTONS COMMUNS
===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 38px;
    padding: 9px 15px;

    border: 1px solid transparent;
    border-radius: 7px;

    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;

    transition:
        color var(--transition),
        background var(--transition),
        border-color var(--transition);
}

.btn-primary {
    color: var(--enla-white);
    background: var(--enla-primary);
    border-color: var(--enla-primary);
}

.btn-primary:hover {
    background: var(--enla-primary-hover);
    border-color: var(--enla-primary-hover);
}

.btn-secondary {
    color: var(--enla-text);
    background: var(--enla-white);
    border-color: var(--enla-border);
}

.btn-secondary:hover {
    background: #f1eff7;
}

.btn:focus-visible {
    outline: 3px solid rgba(22, 91, 251, 0.25);
    outline-offset: 2px;
}

/* =====================================================
   9. CARTES COMMUNES
===================================================== */

.card {
    min-width: 0;
    padding: 22px;

    background: var(--enla-white);
    border: 1px solid var(--enla-border);
    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(35, 29, 65, 0.03);
}

.card-title {
    margin: 0 0 8px;
    color: var(--enla-text);
    font-size: 1rem;
    font-weight: 700;
}

/* =====================================================
   10. RESPONSIVE — TABLETTES
===================================================== */

@media (max-width: 991px) {
    :root {
        --navbar-height: 72px;
    }

    #main-container {
        margin-left: 0;
    }

    #content {
        min-height: calc(100vh - var(--navbar-height));
        padding: 22px;
    }
}

/* =====================================================
   11. RESPONSIVE — MOBILES
===================================================== */

@media (max-width: 600px) {
    #content {
        padding: 16px 12px;
    }

    .page-header {
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .card {
        padding: 16px;
        border-radius: 9px;
    }

    .btn {
        min-height: 36px;
        padding: 8px 12px;
    }
}

/* =====================================================
   12. ACCESSIBILITÉ
===================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
