/* ================================
   STYLES GLOBAUX - ANTI-ZOOM
   ================================ */

/* Désactiver la sélection et le zoom indésirable */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Empêcher le zoom sur double-tap et les gestes indésirables */
html,
body {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Empêcher le zoom sur les inputs (optionnel) */
input,
select,
textarea {
    font-size: 16px;
    /* Empêche le zoom automatique sur iOS */
}

/* ================================
   CALENDRIER - STYLES PRINCIPAUX
   ================================ */

/* Container des dates - swipe friendly */
#dates-container {
    touch-action: pan-x;
    will-change: transform;
    backface-visibility: hidden;
}

.date-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    backface-visibility: hidden;
}

/* Curseur durant le drag */
#dates-container.dragging {
    cursor: grabbing !important;
    -webkit-cursor: grabbing !important;
}

/* ================================
   ANIMATIONS ET TRANSITIONS
   ================================ */

/* Animation fluide pour le modal */
.calendar-modal-content {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-modal-content.show {
    transform: scale(1);
    opacity: 1;
}

/* Transitions fluides pour les dates */
.date-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.date-btn:active {
    transform: scale(0.95);
}

/* ================================
   CALENDRIER COMPLET - STYLES
   ================================ */

/* Style pour les jours du calendrier */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    touch-action: manipulation;
    border: 1px solid transparent;
    font-size: 0.875rem;
    color: #ffffff;
    background: rgba(40, 40, 40, 0.5);
    min-height: 40px;
}

.calendar-day:hover {
    background: rgba(29, 185, 84, 0.1);
    border-color: rgba(29, 185, 84, 0.5);
    transform: scale(1.05);
}

.calendar-day:active {
    transform: scale(0.95);
}

/* Jour actuel */
.calendar-day.today {
    background: rgba(29, 185, 84, 0.2);
    color: #1DB954;
    border: 1px solid #1DB954;
    font-weight: 600;
}

/* Jour sélectionné */
.calendar-day.selected {
    background: linear-gradient(135deg, #1DB954, #1ed760);
    color: #000000;
    font-weight: bold;
    border: 1px solid #1DB954;
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.3);
}

/* Jours désactivés (passés) */
.calendar-day.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(40, 40, 40, 0.2);
    color: #666666;
}

/* Jours d'un autre mois */
.calendar-day.other-month {
    opacity: 0.3;
    color: #666666;
    background: transparent;
}

.calendar-day.other-month:hover {
    background: rgba(29, 185, 84, 0.05);
}

/* ================================
   INDICATEURS DE NAVIGATION
   ================================ */

.nav-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-indicator.active {
    background-color: #1DB954;
    transform: scale(1.2);
}

.nav-indicator.inactive {
    background-color: #666666;
    transform: scale(1);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {

    /* Modal calendrier responsive */
    .calendar-modal-content {
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
        width: calc(100% - 2rem);
    }

    /* Dates container sur mobile */
    #dates-container .date-btn {
        min-width: 70px;
        padding: 0.75rem 0.5rem;
    }

    /* Texte des dates plus petit sur mobile */
    #dates-container .date-btn p:first-child {
        font-size: 0.625rem;
        margin-bottom: 0.25rem;
    }

    #dates-container .date-btn p:nth-child(2) {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }

    #dates-container .date-btn p:last-child {
        font-size: 0.625rem;
        font-weight: 600;
    }

    /* Boutons de navigation plus petits */
    #prev-dates,
    #next-dates {
        padding: 0.5rem;
    }

    /* Grille calendrier responsive */
    .calendar-day {
        min-height: 36px;
        font-size: 0.8125rem;
    }

    /* Boutons du modal plus grands pour le touch */
    #calendar-today,
    #calendar-confirm {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {

    /* Très petits écrans */
    #dates-container .date-btn {
        min-width: 65px;
        padding: 0.5rem 0.25rem;
    }

    .calendar-modal-content {
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }

    .calendar-day {
        min-height: 32px;
        font-size: 0.75rem;
    }
}

/* ================================
   EFFETS VISUELS
   ================================ */

/* Effet de brillance sur les éléments glass-effect */
.glass-effect {
    position: relative;
    overflow: hidden;
}

.glass-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.glass-effect:hover::before {
    left: 100%;
}

/* Effet de glow pour les éléments sélectionnés */
.glow-effect {
    box-shadow: 0 0 20px rgba(29, 185, 84, 0.3);
}

/* ================================
   ANIMATIONS KEYFRAMES
   ================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Classes d'animation */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ================================
   STATES ET INTERACTIONS
   ================================ */

/* Focus states pour l'accessibilité */
.date-btn:focus,
.calendar-day:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.5);
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #1DB954;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   UTILITAIRES
   ================================ */

/* Masquer le scrollbar mais permettre le scroll */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Transitions personnalisées */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-spring {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}