/* ========================================
   BASE.CSS - Styles de base pour MPPEEP Dashboard
   ========================================
   Reset, variables et styles fondamentaux
*/

/* === Reset CSS === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === HTML & Body === */
html {
    height: 100%;
    font-size: 16px;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #000000;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Transition de page élégante */
    animation: fadeInPage 0.4s ease-in-out;
}

/* Animation de fade-in pour les pages */
@keyframes fadeInPage {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de sortie lors de la navigation */
body.page-exit {
    animation: fadeOutPage 0.3s ease-in-out forwards;
}

@keyframes fadeOutPage {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* === Animations d'apparition pour les éléments === */
.card, .stat-card, .table-container, .form-group, .page-header {
    animation: fadeInUp 0.5s ease-out backwards;
}

/* Délai progressif pour les éléments multiples */
.card:nth-child(1), .stat-card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2), .stat-card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3), .stat-card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4), .stat-card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5), .stat-card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6), .stat-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Transitions douces pour les interactions */
a, button, .btn, input, textarea, select {
    transition: all 0.2s ease-in-out;
}

/* === Images & Médias === */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* === Formulaires === */
input,
button,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* === Liens === */
a {
    text-decoration: none;
    color: inherit;
}

/* === Lists === */
ul,
ol {
    list-style: none;
}

/* === Titres === */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    font-weight: 600;
}

/* === Paragraphes === */
p {
    overflow-wrap: break-word;
}

/* === Focus Visible (Accessibilité) === */
:focus-visible {
    outline: 2px solid #ffd300;
    outline-offset: 2px;
}

/* === Scrollbar Styling (Chrome, Safari, Edge) === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* === Selection === */
::selection {
    background-color: #ffd300;
    color: #000000;
}

::-moz-selection {
    background-color: #ffd300;
    color: #000000;
}

/* === Print === */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    img {
        page-break-inside: avoid;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
