/* ===================================
   CALENDRIER INSTALLATION - STYLE MINIMAL MODERNE
   Design: Clean White + Cyan (#00C2FF) Accent
   Resp: Mobile First
   FIX: Z-INDEX MAXIMAL
   =================================== */

/* Container Principal */
.ui-datepicker {
    width: 320px !important;
    /* Largeur optimale mobile */
    max-width: 90vw !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 20px !important;
    /* Coins très arrondis demandés */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25) !important;
    /* Ombre forte pour détacher du fond */
    padding: 20px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;

    /* CORRECTION CRITIQUE VISIBILITÉ */
    z-index: 2147483647 !important;
    /* Maximum possible pour un integer 32-bit */
    position: absolute !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* En-tête (Mois Année) */
.ui-datepicker-header {
    background: transparent !important;
    border: none !important;
    padding: 0 0 20px 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px !important;
}

/* Titre Centré */
.ui-datepicker-title {
    color: #111827 !important;
    /* Noir doux */
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    width: 100% !important;
    text-align: center !important;
    order: 2;
}

/* Flèches Navigation */
.ui-datepicker-prev,
.ui-datepicker-next {
    top: 0 !important;
    width: 32px !important;
    height: 32px !important;
    background: #F3F4F6 !important;
    /* Gris très clair */
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease !important;
    border: none !important;
}

.ui-datepicker-prev {
    left: 0 !important;
}

.ui-datepicker-next {
    right: 0 !important;
}

.ui-datepicker-prev:hover,
.ui-datepicker-next:hover {
    background: #E5E7EB !important;
    transform: scale(1.05);
}

/* Icônes flèches (SVG ou texte) - Nettoyage icônes jQuery UI par défaut */
.ui-datepicker-prev span,
.ui-datepicker-next span {
    display: none !important;
    /* Cache icônes par défaut */
}

.ui-datepicker-prev::after {
    content: "←" !important;
    font-size: 16px;
    color: #374151;
    font-weight: bold;
}

.ui-datepicker-next::after {
    content: "→" !important;
    font-size: 16px;
    color: #374151;
    font-weight: bold;
}

/* Grille Semaine */
.ui-datepicker-calendar {
    width: 100% !important;
    border-collapse: separate !important;
    /* Important pour border-radius sur cellules */
    border-spacing: 0 6px !important;
    /* Espacement vertical entre semaines */
    margin: 0 !important;
}

.ui-datepicker th {
    color: #9CA3AF !important;
    /* Gris clair */
    font-size: 13px !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    padding-bottom: 10px !important;
}

.ui-datepicker td {
    padding: 0 2px !important;
    /* Espacement horizontal */
}

/* Styles des Jours (Cellules) */
.ui-datepicker td a,
.ui-datepicker td span {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
    /* Forme un peu carrée arrondie */
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Jours Disponibles (Par défaut) */
.ui-datepicker td a {
    background: #F9FAFB !important;
    /* Gris très très clair */
    color: #374151 !important;
    /* Gris foncé */
    border: 1px solid transparent !important;
}

/* Hover sur jours disponibles */
.ui-datepicker td a:hover {
    background: rgba(0, 194, 255, 0.1) !important;
    /* Cyan très clair */
    color: #00C2FF !important;
    /* Cyan */
    transform: translateY(-1px);
}

/* Aujourd'hui */
.ui-datepicker-today a {
    background: #EFF6FF !important;
    color: #3B82F6 !important;
    /* Bleu un peu plus soutenu pour today */
    border: 1px solid #BFDBFE !important;
    font-weight: 600 !important;
}

/* Jour SÉLECTIONNÉ (Cyan #00C2FF) */
.ui-datepicker-current-day a,
.ui-state-active {
    background: #00C2FF !important;
    /* CYAN ACCENT */
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 194, 255, 0.4) !important;
    /* Ombre glow cyan */
    font-weight: 700 !important;
    border: none !important;
}

/* JOURS BLOQUÉS / INDISPONIBLES */
.ui-datepicker td.ui-state-disabled span,
.ui-datepicker-blocked span {
    background: transparent !important;
    color: #D1D5DB !important;
    /* Gris inactif */
    cursor: not-allowed !important;
    text-decoration: line-through !important;
}

/* Animation d'ouverture Smooth */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ui-datepicker {
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* OVERLAY BACKDROP POUR ASSURER CONTRASTE (Optionnel si jQuery UI ajoute un overlay) */
.ui-widget-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
    opacity: 1 !important;
    z-index: 2147483646 !important;
    /* Juste derrière le calendrier */
}