/* ============================================
   PIBTS UTILITAIRES - v3.0.0
   ============================================
   ISSU de `pibts-variables.css` (P2.2) : classes utilitaires, animations et
   regles d'accessibilite. Servie JUSTE APRES les jetons, dans l'ordre
   d'origine des sections : aucune regle ne change de position relative,
   donc la cascade est identique (cf. `tools/ui/ui_split_variables.php`).

   Les JETONS `--pibts-*` vivent dans `pibts-variables.css`.
   ============================================ */

/* ============================================
   CLASSES UTILITAIRES - COULEURS
   ============================================ */

/* --- Couleurs textes --- */
.text-pibts { color: var(--pibts-orange) !important; }
.text-pibts-dark { color: var(--pibts-orange-dark) !important; }
.text-pibts-blue { color: var(--pibts-blue) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }
.text-purple { color: var(--color-purple) !important; }
.text-white-75 { color: rgba(255,255,255,0.75) !important; }
.text-muted { color: var(--pibts-muted) !important; }

/* --- Couleurs de fond --- */
.bg-pibts { background: var(--pibts-gradient) !important; }
.bg-pibts-reverse { background: var(--pibts-gradient-reverse) !important; }
.bg-pibts-soft { background: var(--pibts-orange-light) !important; }
.bg-pibts-blue-soft { background: var(--pibts-blue-light) !important; }
.bg-success-soft { background: var(--color-success-light) !important; }
.bg-danger-soft { background: var(--color-danger-light) !important; }
.bg-warning-soft { background: var(--color-warning-light) !important; }
.bg-info-soft { background: var(--color-info-light) !important; }
.bg-purple-soft { background: var(--color-purple-light) !important; }
.bg-light { background-color: #f8f9fa !important; }
.bg-white { background-color: #fff !important; }
.bg-dark { background-color: var(--pibts-ink) !important; }

/* --- Bordures --- */
.border-pibts { border-color: var(--pibts-orange) !important; }
.border-pibts-soft { border-color: var(--pibts-orange-light) !important; }
.border-success { border-color: var(--color-success) !important; }
.border-danger { border-color: var(--color-danger) !important; }
.border-warning { border-color: var(--color-warning) !important; }
.border-info { border-color: var(--color-info) !important; }

/* --- Ombres --- */
.shadow-pibts { box-shadow: var(--shadow-pibts) !important; }
.shadow-pibts-lg { box-shadow: var(--shadow-pibts-lg) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ============================================
   CLASSES UTILITAIRES - BADGES
   ============================================ */

.badge-pibts {
    background: var(--pibts-gradient) !important;
    color: #fff !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-pibts-soft {
    background: var(--pibts-orange-light) !important;
    color: var(--pibts-orange) !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-success-soft {
    background: var(--color-success-light) !important;
    color: var(--color-success) !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-danger-soft {
    background: var(--color-danger-light) !important;
    color: var(--color-danger) !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-warning-soft {
    background: var(--color-warning-light) !important;
    color: var(--color-warning) !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-info-soft {
    background: var(--color-info-light) !important;
    color: var(--color-info) !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-purple-soft {
    background: var(--color-purple-light) !important;
    color: var(--color-purple) !important;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
}

/* ============================================
   CLASSES UTILITAIRES - TYPOGRAPHIE
   ============================================ */

.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }
.fw-900 { font-weight: 900 !important; }

.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }
.fs-7 { font-size: 0.875rem !important; }
.fs-8 { font-size: 0.75rem !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-capitalize { text-transform: capitalize !important; }
.text-decoration-none { text-decoration: none !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word-break { word-break: break-word !important; }

/* ============================================
   CLASSES UTILITAIRES - SPACING
   ============================================ */

/* Paddings */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }
.p-6 { padding: 2.5rem !important; }
.p-7 { padding: 3rem !important; }

/* Margins */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 2rem !important; }

.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }
.mt-6 { margin-top: 2.5rem !important; }
.mt-7 { margin-top: 3rem !important; }

.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }
.mb-6 { margin-bottom: 2.5rem !important; }

.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }

/* Spacing personnalisé */
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 2rem; padding-bottom: 2rem; }
.py-6 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
.py-8 { padding-top: 5rem; padding-bottom: 5rem; }
.py-10 { padding-top: 6rem; padding-bottom: 6rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-5 { padding-left: 2rem; padding-right: 2rem; }

/* ============================================
   CLASSES UTILITAIRES - DISPLAY
   ============================================ */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-inline-flex { display: inline-flex !important; }
.d-inline-block { display: inline-block !important; }

.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-stretch { align-items: stretch !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 2rem !important; }

/* ============================================
   CLASSES UTILITAIRES - POSITION
   ============================================ */

.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0 { left: 0 !important; }
.end-0 { right: 0 !important; }

.z-1 { z-index: 1 !important; position: relative; }
.z-2 { z-index: 2 !important; position: relative; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-scroll { overflow: scroll !important; }
.overflow-visible { overflow: visible !important; }

.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.w-25 { width: 25% !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }

/* ============================================
   CLASSES UTILITAIRES - BOUTONS
   ============================================ */

.btn-outline-light {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    transition: var(--transition-fast);
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.btn-light {
    background: #fff;
    color: var(--pibts-ink);
    border: none;
    transition: var(--transition-fast);
}
.btn-light:hover {
    background: #f8f9fa;
    color: var(--pibts-orange);
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
}

.rounded-pill {
    border-radius: var(--radius-full) !important;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-xs {
    padding: 0.15rem 0.5rem;
    font-size: 0.65rem;
    border-radius: var(--radius-sm);
}

/* ============================================
   CLASSES UTILITAIRES - DIVERS
   ============================================ */

.max-w-600 { max-width: 600px; }
.max-w-800 { max-width: 800px; }
.max-w-1000 { max-width: 1000px; }

.opacity-10 { opacity: 0.1 !important; }
.opacity-25 { opacity: 0.25 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }

.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

.user-select-none { user-select: none !important; }

.text-center { text-align: center !important; }
.text-start { text-align: start !important; }
.text-end { text-align: end !important; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* --- Classes d'animation --- */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }
.animate-in-delay-5 { animation-delay: 0.25s; }
.animate-in-delay-6 { animation-delay: 0.3s; }

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

.spin-animation {
    animation: spin 1s linear infinite;
}

.shimmer-animation {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* --- Large screens --- */
@media (max-width: 992px) {
    .d-lg-none { display: block !important; }
    .d-lg-block { display: none !important; }
}

/* --- Medium screens --- */
@media (max-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .text-md-center { text-align: center !important; }
}

/* --- Small screens --- */
@media (max-width: 576px) {
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .text-sm-center { text-align: center !important; }
}

/* --- Print --- */
@media print {
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
}

/* ============================================
   UTILITAIRES D'ACCESSIBILITÉ
   ============================================ */

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--pibts-orange);
    outline-offset: 2px;
}

/* Préférence de réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}