/**
 * Tailwind Custom CSS — Annuaire CEJCA
 *
 * Contient uniquement ce que Tailwind CDN ne peut pas faire nativement.
 * Garder ce fichier < 200 lignes.
 */

/* ========================================
   ANIMATIONS COMPLEXES
   ======================================== */

/* Glassmorphism effect */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Shimmer loading placeholder */
.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Fade in up — pour éléments qui apparaissent au scroll */
.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Staggered animations */
.animate-delay-100 { animation-delay: 0.1s; }
.animate-delay-200 { animation-delay: 0.2s; }
.animate-delay-300 { animation-delay: 0.3s; }
.animate-delay-400 { animation-delay: 0.4s; }
.animate-delay-500 { animation-delay: 0.5s; }

/* ========================================
   SELECT2 OVERRIDES (pour matcher le thème)
   ======================================== */

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 2px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    padding: 0.375rem 0.5rem !important;
    min-height: 2.75rem !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #b75200 !important;
    box-shadow: 0 0 0 2px rgba(183, 82, 0, 0.1) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #b75200 !important;
}

.select2-dropdown {
    border: 2px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    margin-top: 4px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #fff7ed !important;
    border: 1px solid #fed7aa !important;
    border-radius: 9999px !important;
    color: #9a4500 !important;
    padding: 2px 8px !important;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 4px 4px 0 0 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #b75200 !important;
    margin-right: 6px;
    font-size: 0.875rem;
    font-weight: bold;
    border-right: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #7c2d12 !important;
    background: transparent !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear {
    margin-top: 6px !important;
    margin-right: 8px;
    font-size: 1.25rem;
    font-weight: bold;
    color: #9ca3af !important;
    cursor: pointer;
    float: right;
}

.select2-container--default .select2-selection--multiple .select2-selection__clear:hover {
    color: #b75200 !important;
}

/* ========================================
   TURNSTILE CAPTCHA
   ======================================== */

.cf-turnstile {
    margin: 1rem 0;
}

.cf-turnstile iframe {
    border-radius: 0.5rem;
}

/* ========================================
   SIDEBAR STATE CLASSES
   ======================================== */

/* Ces classes sont togglées par sidebar.js */
.sidebar-collapsed .sidebar-expanded-only {
    display: none !important;
}

.sidebar-collapsed .sidebar-collapsed-only {
    display: flex !important;
}

.sidebar-collapsed #sidebar {
    width: 4rem !important; /* 64px */
}

.sidebar-collapsed #main-content {
    margin-left: 4rem !important;
}

/* ========================================
   RESPONSIVE HELPERS
   ======================================== */

/* Empêcher le débordement de texte long (URLs, emails) */
.prose {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Images responsives par défaut dans le contenu */
.prose img {
    max-width: 100%;
    height: auto;
}

/* Améliorer le touch target sur mobile */
@media (max-width: 640px) {
    .prose {
        font-size: 0.9375rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    #sidebar,
    #mobile-topbar,
    #public-nav,
    footer {
        display: none !important;
    }

    #main-content {
        margin-left: 0 !important;
    }

    main {
        padding: 0 !important;
    }

    .no-print {
        display: none !important;
    }
}

