/* Styles mobile pour la feuille de temps */

@media (max-width: 768px) {
    /* Header compact mobile */
    .header-premium-modern {
        padding: 1.5rem 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .header-premium-modern h1 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .header-premium-modern .lead {
        display: none !important; /* Masquer la description sur mobile */
    }
    
    .header-premium-modern .icon-wrapper {
        display: none !important; /* Masquer l'icône sur mobile */
    }
    
    /* Navigation simplifiée */
    .header-premium-modern .btn-group {
        width: 100%;
        margin-top: 0.75rem;
    }
    
    .header-premium-modern .btn {
        font-size: 0.75rem !important;
        padding: 0.5rem 1rem !important;
        min-height: 44px;
    }
    
    /* Masquer certains boutons sur mobile */
    .header-premium-modern .dropdown-toggle span {
        display: none;
    }
    
    /* Calendrier mensuel mobile - vue liste */
    .calendar-month-list {
        padding: 0.5rem;
    }
    
    .calendar-day-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .calendar-day-card:active {
        transform: scale(0.98);
    }
    
    .activity-item {
        transition: transform 0.2s ease;
        min-height: 60px;
    }
    
    .activity-item:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    .date-badge {
        background: linear-gradient(135deg, #00AE9E 0%, #33C2B5 100%);
        color: white;
        border-radius: 12px;
        padding: 0.5rem;
    }
    
    .calendar-day {
        margin-bottom: 1rem;
        min-height: auto !important;
        padding: 1rem !important;
    }
    
    /* Calendrier hebdomadaire mobile - Timeline verticale */
    .calendar-week-timeline {
        padding: 0.5rem;
    }
    
    .day-timeline-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .day-timeline-card:active {
        transform: scale(0.98);
    }
    
    .timeline-activity-item {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        position: relative;
    }
    
    .timeline-activity-item:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    .time-indicator {
        border-radius: 0 4px 4px 0;
    }
    
    /* Calendrier hebdomadaire desktop (conservé) */
    .calendar-week-view {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-week-view table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    .calendar-week-view th,
    .calendar-week-view td {
        padding: 4px !important;
    }
    
    /* Formulaires adaptés */
    .form-control-lg,
    .form-select-lg {
        font-size: 16px !important; /* Évite le zoom sur iOS */
        padding: 0.75rem !important;
    }
    
    /* Cartes statistiques empilées */
    .row.g-3 > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    /* Liste activités mobile - Vue cartes */
    .entries-cards-mobile {
        max-height: calc(100vh - 300px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .day-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .day-card:active {
        transform: scale(0.98);
    }
    
    .activity-card-item {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        min-height: 80px;
    }
    
    .activity-card-item:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Tableaux responsive (desktop) */
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem !important;
        white-space: nowrap;
    }
    
    /* Actions swipe améliorées */
    .swipeable-row,
    .activity-item,
    tbody tr {
        position: relative;
        overflow: hidden;
        touch-action: pan-y;
    }
    
    .swipe-actions {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(90deg, transparent 0%, #f8f9fa 20%);
        padding: 0 1.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 10;
        min-width: 120px;
    }
    
    .swipeable-row.swiped .swipe-actions,
    .activity-item.swiped .swipe-actions,
    tbody tr.swiped .swipe-actions {
        transform: translateX(0);
    }
    
    /* Indicateur visuel pendant le swipe */
    .swipeable-row.swiping,
    .activity-item.swiping,
    tbody tr.swiping {
        opacity: 0.9;
    }
    
    /* Feedback haptique (si supporté) */
    @supports (haptic-feedback: auto) {
        .swipeable-row:active,
        .activity-item:active {
            haptic-feedback: light;
        }
    }
    
    /* Modals fullscreen sur mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    /* Boutons plus grands pour le tactile */
    .btn {
        min-height: 44px; /* Taille minimale recommandée pour le tactile */
        padding: 0.5rem 1rem;
    }
    
    /* Espacement réduit */
    .container-fluid.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Cards avec moins de padding */
    .card-body {
        padding: 1rem !important;
    }
    
    /* Templates en liste sur mobile */
    .activity-templates-grid {
        display: block !important;
    }
    
    .activity-templates-grid > [class*="col-"] {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Statistiques graphiques adaptées */
    #evolutionChart,
    #elementChart {
        max-height: 250px !important;
    }
    
    /* Filtres empilés */
    .filter-form .row > [class*="col-"] {
        margin-bottom: 1rem;
    }
    
    /* Badges plus petits */
    .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Icônes ajustées */
    .fa-2x {
        font-size: 1.5rem !important;
    }
    
    .fa-3x {
        font-size: 2rem !important;
    }
    
    /* Masquer certains éléments sur mobile */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Afficher les éléments spécifiques mobile */
    .d-mobile-only {
        display: block !important;
    }
    
    /* Pull to refresh indicator */
    .pull-to-refresh {
        text-align: center;
        padding: 1rem;
        color: #6c757d;
        font-size: 0.875rem;
    }
    
    /* Optimisations pour les cartes */
    .day-card,
    .day-timeline-card,
    .calendar-day-card {
        will-change: transform;
        backface-visibility: hidden;
    }
    
    /* Améliorer le scroll sur iOS */
    .entries-cards-mobile,
    .calendar-month-list,
    .calendar-week-timeline {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

@media (max-width: 576px) {
    /* Très petits écrans */
    .header-premium-modern {
        padding: 1.5rem 1rem !important;
    }
    
    .header-premium-modern h1 {
        font-size: 1.5rem !important;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.5rem !important;
        margin-bottom: 0.5rem;
    }
    
    /* Textes plus petits */
    .display-4 {
        font-size: 2rem !important;
    }
    
    .lead {
        font-size: 0.875rem !important;
    }
    
    /* Cards plus compactes */
    .card-body {
        padding: 0.75rem !important;
    }
    
    /* Tableaux très compacts */
    .table {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem !important;
    }
}

/* Optimisations pour le tactile */
@media (hover: none) and (pointer: coarse) {
    /* Désactiver les effets hover sur mobile */
    .btn:hover,
    .card:hover {
        transform: none !important;
    }
    
    /* Zones de clic plus grandes */
    .timeline-entry {
        min-height: 44px;
        padding: 0.75rem !important;
    }
    
    /* Espacement entre éléments cliquables */
    .clickable-item {
        margin-bottom: 0.5rem;
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header-premium-modern {
        padding: 1.5rem 1rem !important;
    }
    
    .header-premium-modern h1 {
        font-size: 1.5rem !important;
    }
    
    /* Réduire la hauteur des cartes en paysage */
    .day-card,
    .day-timeline-card,
    .calendar-day-card {
        margin-bottom: 1rem;
    }
}

/* Améliorations pour très petits écrans (< 360px) */
@media (max-width: 360px) {
    .header-premium-modern h1 {
        font-size: 1.25rem !important;
    }
    
    .btn {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.8rem !important;
    }
    
    .card-body {
        padding: 0.5rem !important;
    }
    
    .preset-btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.6rem !important;
    }
}
