/* CSS extrait du fichier vikappcommunes.php - Bloc principal (onAfterRender) */
.vap-filterbar-group { 
    margin-bottom: 20px; 
    clear: both;
}
.vap-filterbar-label { 
    margin-bottom: 10px;
    display: block;
}
.vap-filterbar-label label { 
    font-weight: 600;
    display: block;
    color: #2D3436;
    font-size: 15px;
}
.vap-filterbar-control { 
    width: 100%;
    position: relative;
}
.vap-filterbar-control select { 
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.vap-commune-select { 
    min-width: 300px !important;
    max-width: 100% !important;
}

/* ========================================
   THÈME SELECT2 MODERNE - PALETTE PERSONNALISÉE
   ======================================== */

/* Container principal Select2 */
.vap-commune-select2-container .select2-container {
    min-width: 300px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Sélection principale */
.vap-commune-select2-container .select2-selection--single {
    height: 48px !important;
    background: linear-gradient(135deg, #FAFAFA 0%, #ffffff 100%) !important;
    border: 2px solid #e8e8e8 !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 4px rgba(45, 52, 54, 0.05) !important;
}

.vap-commune-select2-container .select2-selection--single:hover {
    border-color: #C604BC !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(198, 4, 188, 0.1) !important;
}

.vap-commune-select2-container .select2-container--focus .select2-selection--single,
.vap-commune-select2-container .select2-container--open .select2-selection--single {
    border-color: #C604BC !important;
    box-shadow: 0 0 0 4px rgba(198, 4, 188, 0.1), 0 4px 12px rgba(198, 4, 188, 0.15) !important;
    transform: translateY(-1px) !important;
}

/* Texte de la sélection */
.vap-commune-select2-container .select2-selection__rendered {
    line-height: 44px !important;
    padding-left: 18px !important;
    padding-right: 45px !important;
    color: #2D3436 !important;
    font-weight: 500 !important;
    font-size: 15px !important;
}

.vap-commune-select2-container .select2-selection__placeholder {
    color: #636e72 !important;
    font-weight: 400 !important;
}

/* Flèche dropdown */
.vap-commune-select2-container .select2-selection__arrow {
    height: 44px !important;
    right: 15px !important;
    top: 2px !important;
}

.vap-commune-select2-container .select2-selection__arrow b {
    border-color: #008999 transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
    transition: all 0.3s ease !important;
}

.vap-commune-select2-container .select2-container--open .select2-selection__arrow b {
    transform: rotate(180deg) !important;
    border-color: #C604BC transparent transparent transparent !important;
}

/* Dropdown */
.vap-commune-select2-container .select2-dropdown {
    border: 2px solid #C604BC !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(198, 4, 188, 0.15), 0 4px 10px rgba(45, 52, 54, 0.1) !important;
    margin-top: 4px !important;
    overflow: hidden !important;
}

/* Options du dropdown */
.vap-commune-select2-container .select2-results__options {
    max-height: 250px !important;
}

.vap-commune-select2-container .select2-results__option {
    padding: 14px 18px !important;
    color: #2D3436 !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid rgba(45, 52, 54, 0.05) !important;
}

.vap-commune-select2-container .select2-results__option:last-child {
    border-bottom: none !important;
}

.vap-commune-select2-container .select2-results__option--highlighted {
    background-color: #C604BC !important;
    color: #FAFAFA !important;
    transform: translateX(4px) !important;
}

.vap-commune-select2-container .select2-results__option[aria-selected="true"] {
    background-color: rgba(0, 137, 153, 0.1) !important;
    color: #008999 !important;
    font-weight: 600 !important;
}

/* Recherche dans le dropdown */
.vap-commune-select2-container .select2-search--dropdown {
    padding: 12px !important;
    background: #FAFAFA !important;
    border-bottom: 1px solid rgba(45, 52, 54, 0.1) !important;
}

.vap-commune-select2-container .select2-search__field {
    border: 2px solid #e8e8e8 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

.vap-commune-select2-container .select2-search__field:focus {
    border-color: #C604BC !important;
    outline: none !important;
}

/* Message "Aucun résultat" */
.vap-commune-select2-container .select2-results__message {
    padding: 20px 18px !important;
    color: #636e72 !important;
    font-style: italic !important;
    text-align: center !important;
}

/* Animation d'ouverture */
.vap-commune-select2-container .select2-dropdown {
    animation: vapDropdownFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes vapDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* État désactivé */
.vap-commune-select2-container .select2-container--disabled .select2-selection--single {
    background: #f1f3f4 !important;
    border-color: #dadce0 !important;
    color: #9aa0a6 !important;
    cursor: not-allowed !important;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .vap-commune-select2-container .select2-container {
        min-width: 100% !important;
    }
    
    .vap-commune-select2-container .select2-selection--single {
        height: 52px !important;
        border-radius: 8px !important;
    }
    
    .vap-commune-select2-container .select2-selection__rendered {
        line-height: 48px !important;
        font-size: 16px !important;
    }
    
    .vap-commune-select2-container .select2-results__option {
        padding: 16px 18px !important;
        font-size: 15px !important;
    }
}

/* ========================================
   LOADER DE COMMUNE - UX MODERNE
   ======================================== */

/* Overlay principal */
.vap-commune-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vap-commune-loader-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Container du loader */
.vap-commune-loader-container {
    text-align: center;
    padding: 30px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(45, 52, 54, 0.1), 0 8px 16px rgba(45, 52, 54, 0.05);
    border: 1px solid rgba(198, 4, 188, 0.1);
    max-width: 320px;
    width: 90%;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vap-commune-loader-overlay.show .vap-commune-loader-container {
    transform: translateY(0) scale(1);
}

/* Spinner moderne */
.vap-commune-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    position: relative;
}

.vap-commune-spinner::before,
.vap-commune-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: vapSpinnerPulse 2s infinite ease-in-out;
}

.vap-commune-spinner::before {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #C604BC, #008999);
    animation: vapSpinnerRotate 1.5s linear infinite;
}

.vap-commune-spinner::after {
    width: 80%;
    height: 80%;
    background: #ffffff;
    top: 10%;
    left: 10%;
    animation: vapSpinnerPulse 2s infinite ease-in-out;
}

/* Animations du spinner */
@keyframes vapSpinnerRotate {
    0% {
        transform: rotate(0deg);
        border-radius: 50%;
    }
    25% {
        border-radius: 50% 40% 50% 40%;
    }
    50% {
        transform: rotate(180deg);
        border-radius: 40% 50% 40% 50%;
    }
    75% {
        border-radius: 50% 40% 50% 40%;
    }
    100% {
        transform: rotate(360deg);
        border-radius: 50%;
    }
}

@keyframes vapSpinnerPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

/* Texte du loader */
.vap-commune-loader-text {
    font-size: 16px;
    font-weight: 600;
    color: #2D3436;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.vap-commune-loader-subtext {
    font-size: 14px;
    color: #636e72;
    font-weight: 400;
    opacity: 0.8;
}

/* Points d'animation pour le texte */
.vap-commune-loader-dots::after {
    content: '';
    animation: vapLoaderDots 1.5s infinite;
}

@keyframes vapLoaderDots {
    0%, 20% {
        content: '';
    }
    25%, 45% {
        content: '.';
    }
    50%, 70% {
        content: '..';
    }
    75%, 95% {
        content: '...';
    }
}

/* Version compacte pour mobile */
@media screen and (max-width: 768px) {
    .vap-commune-loader-container {
        padding: 25px 20px;
        border-radius: 12px;
        max-width: 280px;
    }
    
    .vap-commune-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 15px;
    }
    
    .vap-commune-loader-text {
        font-size: 15px;
    }
    
    .vap-commune-loader-subtext {
        font-size: 13px;
    }
}

/* Variante discrète pour la vérification de compatibilité */
.vap-commune-loader-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(198, 4, 188, 0.05), rgba(0, 137, 153, 0.05));
    border: 1px solid rgba(198, 4, 188, 0.2);
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    color: #2D3436;
}

.vap-commune-loader-inline .vap-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(198, 4, 188, 0.3);
    border-top: 2px solid #C604BC;
    border-radius: 50%;
    animation: vapSpinnerSmall 1s linear infinite;
}

@keyframes vapSpinnerSmall {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation d'apparition fluide */
.vap-commune-loader-fade-in {
    animation: vapLoaderFadeIn 0.3s ease-out forwards;
}

@keyframes vapLoaderFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* New styles for employee-commune incompatibility warning */
.vap-employee-commune-incompatible-warning {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-left: 4px solid #f0ad4e;
    border-radius: 4px;
    color: #856404;
    display: none;
    clear: both;
}
.vap-employee-commune-incompatible-warning h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #d58512;
    font-size: 16px;
}
.vap-employee-commune-incompatible-warning p {
    margin-bottom: 15px;
    line-height: 1.5;
}
.vap-employee-commune-incompatible-warning .btn {
    display: inline-block;
    padding: 8px 15px;
    margin-right: 10px;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.42857143;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
}
.vap-employee-commune-incompatible-warning .btn-warning {
    color: #fff;
    background-color: #f0ad4e;
    border-color: #eea236;
}
.vap-employee-commune-incompatible-warning .btn-warning:hover {
    background-color: #ec971f;
    border-color: #d58512;
}
.vap-employee-commune-incompatible-warning .btn-link {
    color: #d58512;
    background: transparent;
    border: none;
    text-decoration: underline;
}
.vap-employee-commune-incompatible-warning .btn-link:hover {
    color: #b8860b;
    text-decoration: none;
}
.vap-timeline-hidden {
    display: none !important;
}
.vap-compatibility-loading {
    text-align: center;
    padding: 10px;
    color: #666;
    font-style: italic;
}
@media screen and (max-width: 480px) {
    .vap-commune-select {
        width: 100% !important;
    }
    .vap-employee-commune-incompatible-warning .btn {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }
}

/* CSS extrait du fichier vikappcommunes.php - Bloc champs verrouillés (handleConfirmAppCommuneField) */
.vap-commune-field-locked {
    background-color: #f8f9fa !important;
    border: 2px solid #008999 !important;
    color: #155724 !important;
    font-weight: 500 !important;
    pointer-events: none !important;
    opacity: 0.8;
}

.select2-container.vap-commune-field-locked {
    pointer-events: none !important;
    opacity: 0.8 !important;
}

.select2-container.vap-commune-field-locked .select2-choice,
.select2-container.vap-commune-field-locked .select2-selection {
    background-color: #f8f9fa !important;
    border: 2px solid #008999 !important;
    color: #155724 !important;
    font-weight: 500 !important;
    cursor: not-allowed !important;
}

.vap-commune-explanation {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
    margin-top: 15px;;
    padding: 8px 12px;
    background-color: #f9f9f9;
    border-left: 4px solid #008999;
    border-radius: 0 4px 4px 0;
    box-shadow: none;
}

.vap-commune-explanation strong {
    color: #008999;
    font-weight: 600;
}

.vap-commune-container-locked {
    position: relative;
}

/* CSS extrait du fichier vikappcommunes.php - Bloc administration (displayCommunesList) */
.vap-communes-container { margin: 20px; }
.vap-communes-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.vap-communes-table th, .vap-communes-table td { padding: 10px; text-align: left; border-bottom: 1px solid #ddd; }
.vap-communes-table th { background-color: #f5f5f5; }
.vap-communes-actions { display: flex; gap: 10px; }
.vap-communes-status { display: inline-block; padding: 5px 10px; border-radius: 3px; }
.vap-communes-status.active { background-color: #dff0d8; color: #3c763d; }
.vap-communes-status.inactive { background-color: #f2dede; color: #a94442; }
.vap-communes-add { margin-bottom: 20px; }
.vap-communes-search { margin-bottom: 20px; }
.info-message { padding: 15px; background-color: #d9edf7; border: 1px solid #bce8f1; color: #31708f; border-radius: 4px; margin-bottom: 20px; }

/* CSS extrait du fichier tmpl/communes.php - Gestion des communes d'employés */
.vap-communes-container { margin: 20px 0; }
.vap-communes-container .select2-container { width: 90% !important; }
.vap-communes-help { margin: 10px 0; color: #666; }
.vap-communes-tip { font-size: 0.9em; color: #999; margin: 5px 0; }
.select2-container--default .select2-selection--multiple { border-color: #ddd; }
.select2-container--default.select2-container--focus .select2-selection--multiple { border-color: #66afe9; }
.vap-communes-save { margin-top: 15px; }

/* ========================================
   MESSAGE D'ERREUR DE RÉSERVATION
   ======================================== */

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message d'erreur contextuel pour les réservations */
.vap-error-message {
    animation: fadeIn 0.3s ease-in;
}

/* Animation de sortie */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.vap-error-message.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
} 