/*!
 * Dashboard Utility Classes
 * Classes utilitaires pour résoudre des problèmes spécifiques de responsivité
 */

/* ================================================
   CLASSES UTILITAIRES RESPONSIVES
   ================================================ */

/* Masquer des éléments sur mobile */
.d-mobile-none {
    @media (max-width: 768px) {
        display: none !important;
    }
}

/* Afficher seulement sur mobile */
.d-mobile-block {
    display: none !important;
    @media (max-width: 768px) {
        display: block !important;
    }
}

.d-mobile-flex {
    display: none !important;
    @media (max-width: 768px) {
        display: flex !important;
    }
}

/* Masquer des éléments sur desktop */
.d-desktop-none {
    @media (min-width: 769px) {
        display: none !important;
    }
}

/* ================================================
   CLASSES POUR LES TEXTES RESPONSIFS
   ================================================ */

.text-mobile-sm {
    @media (max-width: 768px) {
        font-size: 0.875rem !important;
    }
}

.text-mobile-xs {
    @media (max-width: 768px) {
        font-size: 0.75rem !important;
    }
}

.text-mobile-truncate {
    @media (max-width: 768px) {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }
}

/* ================================================
   CLASSES POUR LES ESPACEMENTS RESPONSIFS
   ================================================ */

.p-mobile-sm {
    @media (max-width: 768px) {
        padding: 0.5rem !important;
    }
}

.p-mobile-xs {
    @media (max-width: 768px) {
        padding: 0.25rem !important;
    }
}

.m-mobile-sm {
    @media (max-width: 768px) {
        margin: 0.5rem !important;
    }
}

.m-mobile-0 {
    @media (max-width: 768px) {
        margin: 0 !important;
    }
}

.gap-mobile-1 {
    @media (max-width: 768px) {
        gap: 0.25rem !important;
    }
}

/* ================================================
   CLASSES POUR LES BOUTONS RESPONSIFS
   ================================================ */

.btn-mobile-block {
    @media (max-width: 768px) {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
}

.btn-mobile-sm {
    @media (max-width: 768px) {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.8rem !important;
    }
}

.btn-mobile-xs {
    @media (max-width: 768px) {
        padding: 0.25rem 0.375rem !important;
        font-size: 0.7rem !important;
    }
}

/* ================================================
   CLASSES POUR LES CARTES RESPONSIVES
   ================================================ */

.card-mobile-compact {
    @media (max-width: 768px) {
        margin-bottom: 0.75rem !important;
    }
}

.card-mobile-compact .card-body {
    @media (max-width: 768px) {
        padding: 0.75rem !important;
    }
}

.card-mobile-compact .card-header {
    @media (max-width: 768px) {
        padding: 0.75rem !important;
    }
}

.card-mobile-compact .card-footer {
    @media (max-width: 768px) {
        padding: 0.75rem !important;
    }
}

/* ================================================
   CLASSES POUR LES TABLEAUX RESPONSIFS
   ================================================ */

.table-mobile-compact {
    @media (max-width: 768px) {
        font-size: 0.8rem !important;
    }
}

.table-mobile-compact th,
.table-mobile-compact td {
    @media (max-width: 768px) {
        padding: 0.375rem 0.25rem !important;
    }
}

.table-mobile-stack {
    @media (max-width: 768px) {
        display: block !important;
    }
}

.table-mobile-stack thead {
    @media (max-width: 768px) {
        display: none !important;
    }
}

.table-mobile-stack tbody,
.table-mobile-stack tr,
.table-mobile-stack td {
    @media (max-width: 768px) {
        display: block !important;
        width: 100% !important;
    }
}

.table-mobile-stack tr {
    @media (max-width: 768px) {
        border: 1px solid #dee2e6;
        margin-bottom: 1rem;
        padding: 0.5rem;
        border-radius: 0.375rem;
    }
}

/* ================================================
   CLASSES POUR LES FORMULAIRES RESPONSIFS
   ================================================ */

.form-mobile-stack {
    @media (max-width: 768px) {
        display: block !important;
    }
}

.form-mobile-stack .col-md-1,
.form-mobile-stack .col-md-2,
.form-mobile-stack .col-md-3,
.form-mobile-stack .col-md-4,
.form-mobile-stack .col-md-6 {
    @media (max-width: 768px) {
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }
}

.form-control-mobile-lg {
    @media (max-width: 768px) {
        min-height: 48px !important;
        font-size: 16px !important; /* Évite le zoom sur iOS */
    }
}

/* ================================================
   CLASSES POUR LES MODALS RESPONSIFS
   ================================================ */

.modal-mobile-fullscreen {
    @media (max-width: 768px) {
        padding: 0 !important;
    }
}

.modal-mobile-fullscreen .modal-dialog {
    @media (max-width: 768px) {
        margin: 0 !important;
        max-width: 100% !important;
        height: 100vh !important;
        display: flex !important;
        align-items: stretch !important;
    }
}

.modal-mobile-fullscreen .modal-content {
    @media (max-width: 768px) {
        height: 100% !important;
        border-radius: 0 !important;
    }
}

/* ================================================
   CLASSES POUR LA NAVIGATION RESPONSIVE
   ================================================ */

.nav-mobile-stack {
    @media (max-width: 768px) {
        flex-direction: column !important;
    }
}

.nav-mobile-stack .nav-item {
    @media (max-width: 768px) {
        width: 100% !important;
        margin-bottom: 0.25rem !important;
    }
}

/* ================================================
   CLASSES POUR LES IMAGES RESPONSIVES
   ================================================ */

.img-mobile-sm {
    @media (max-width: 768px) {
        max-width: 40px !important;
        max-height: 40px !important;
    }
}

.img-mobile-xs {
    @media (max-width: 768px) {
        max-width: 30px !important;
        max-height: 30px !important;
    }
}

.avatar-mobile-sm {
    @media (max-width: 768px) {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
}

/* ================================================
   CLASSES POUR LES BADGES RESPONSIFS
   ================================================ */

.badge-mobile-sm {
    @media (max-width: 768px) {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }
}

.badge-mobile-xs {
    @media (max-width: 768px) {
        font-size: 0.55rem !important;
        padding: 0.15rem 0.3rem !important;
    }
}

/* ================================================
   CLASSES POUR LES DROPDOWNS RESPONSIFS
   ================================================ */

.dropdown-mobile-fullwidth {
    @media (max-width: 768px) {
        position: static !important;
    }
}

.dropdown-mobile-fullwidth .dropdown-menu {
    @media (max-width: 768px) {
        position: static !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
        border-radius: 0.375rem !important;
    }
}

/* ================================================
   CLASSES POUR LES ALERTES RESPONSIVES
   ================================================ */

.alert-mobile-compact {
    @media (max-width: 768px) {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
        margin-bottom: 0.75rem !important;
    }
}

/* ================================================
   CLASSES POUR LES TOOLTIPS RESPONSIFS
   ================================================ */

.tooltip-mobile-disabled {
    @media (max-width: 768px) {
        pointer-events: none !important;
    }
}

/* Désactiver les tooltips sur mobile */
@media (max-width: 768px) {
    .tooltip {
        display: none !important;
    }
}

/* ================================================
   CLASSES POUR LES ANIMATIONS RESPONSIVES
   ================================================ */

.no-animation-mobile {
    @media (max-width: 768px) {
        animation: none !important;
        transition: none !important;
    }
}

.smooth-scroll-mobile {
    @media (max-width: 768px) {
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
}

/* ================================================
   CLASSES POUR LES FLEXBOX RESPONSIFS
   ================================================ */

.flex-mobile-column {
    @media (max-width: 768px) {
        flex-direction: column !important;
    }
}

.flex-mobile-wrap {
    @media (max-width: 768px) {
        flex-wrap: wrap !important;
    }
}

.justify-content-mobile-center {
    @media (max-width: 768px) {
        justify-content: center !important;
    }
}

.align-items-mobile-stretch {
    @media (max-width: 768px) {
        align-items: stretch !important;
    }
}

/* ================================================
   CLASSES POUR LES BORDURES RESPONSIVES
   ================================================ */

.border-mobile-0 {
    @media (max-width: 768px) {
        border: 0 !important;
    }
}

.rounded-mobile-0 {
    @media (max-width: 768px) {
        border-radius: 0 !important;
    }
}

/* ================================================
   CLASSES POUR LES POSITIONS RESPONSIVES
   ================================================ */

.position-mobile-relative {
    @media (max-width: 768px) {
        position: relative !important;
    }
}

.position-mobile-static {
    @media (max-width: 768px) {
        position: static !important;
    }
}

/* ================================================
   CLASSES POUR L'OVERFLOW RESPONSIF
   ================================================ */

.overflow-mobile-hidden {
    @media (max-width: 768px) {
        overflow: hidden !important;
    }
}

.overflow-x-mobile-auto {
    @media (max-width: 768px) {
        overflow-x: auto !important;
    }
}

.overflow-y-mobile-auto {
    @media (max-width: 768px) {
        overflow-y: auto !important;
    }
}
