/*
Template Name: Web App Foundation
Author: Synergy Web
Website: https://www.synergyweb.fr
Contact: support@synergyweb.fr
File: Custom Css File
*/


/* Couleurs */
:root {
    --purple-color : #482668; 
}

.custom-blue-border {
  border-color: #299cdb; /* Same blue as .border-info but without !important to avoid conflict with css validation rules */
}


/* Couleur de background */
.bg-purple {
    background-color: var(--purple-color) !important;
}

.bg-blue-light {
    background-color: #d0dcf8 !important;
}

/* Couleur de bordure */
.btn-outline-purple {
    border: 1px solid var(--purple-color);
}

.btn-outline-purple:hover {
    border: 1px solid var(--purple-color);
    background-color: var(--purple-color) !important;
    color: #fff;
}

/* Pagination des tables de liste */

#syn_table_navigation .pagination {
    gap: 8px;
    }

#syn_table_navigation .pagination .page {
    display: block;
    padding: .375rem .75rem;
    color: var(--vz-link-color);
    background-color: var(--vz-card-bg-custom);
    border: 1px solid var(--vz-border-color);
    border-radius: .25rem;
    }

#syn_table_navigation .pagination .current {
    color: #fff;
    background-color: #405189;
    border-color: #405189;
    display: block;
    padding: .375rem .75rem;
    border: 1px solid var(--vz-border-color);
    border-radius: .25rem;
    }

#syn_table_navigation .pagination .next,
#syn_table_navigation .pagination .previous,
#syn_table_navigation .pagination .first,
#syn_table_navigation .pagination .last {
    display: block;
    padding: .375rem .75rem;
    color: var(--vz-link-color);
    background-color: var(--vz-card-bg-custom);
    border: 1px solid var(--vz-border-color);
    border-radius: .25rem;
    }

/* Hauteur minimum card body*/
.syn-card-min-height {
    min-height: 400px;
}

/* Couleurs des badges par état : nouveau, traité, retard, cloture */

.badge.bg-nouveau {
    background-color: #007bffa8 !important ;
}

.badge.bg-traite {
    background-color: #28a745a8 !important ;
}

.badge.bg-retard {
    background-color: #dc3545a8 !important ;
}

.badge.bg-cloture {
    background-color: #6b767fa8 !important ;
}

.badge.bg-abandonne {
    background-color: #838b91a8 !important ;
}

/* REGISTRE : vue New et Edit */
#registre_quiEstConcerne
{
    padding-left: 0;
}

#registre_quiEstConcerne_1,
#registre_quiEstConcerne_2,
#registre_quiEstConcerne_3
{
    margin-left: 20px;
}

#registre_quiEstConcerne_0,
#registre_quiEstConcerne_1, 
#registre_quiEstConcerne_2,
#registre_quiEstConcerne_3
{
    margin-right: 5px!important;
}

#registre_quiEstConcerne #registre_quiEstConcerne_placeholder,
#registre_quiEstConcerne label[for=registre_quiEstConcerne_placeholder]
{
    display: none;
}

/* CK Editor*/
.ck-content{
    color: #000;
}

/* Overlay de soumission de formulaires */
.submission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #dae6fda8; /* Semi-transparent background */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it appears on top of everything */
}

/* Spinner container with some padding and background */
.spinner-container {
    background-color: #cee3f4;
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* CMS Pages */
.cms-content {
    line-height: 1.8;
}

.cms-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.cms-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #555;
}

.cms-content p {
    margin-bottom: 1rem;
}

.cms-content ul, .cms-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.cms-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.cms-content table th,
.cms-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.cms-content table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.cms-content blockquote {
    padding: 0.5rem 1rem;
    margin: 0 0 1rem;
    font-size: 1.25rem;
    border-left: 0.25rem solid #eceeef;
    background-color: #f8f9fa;
}


/* ============================================================ */
/* STYLES DRAG & DROP - Zone d'upload interactive */
/* ============================================================ */

/* Zone d'upload par défaut */
.upload-zone {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px dashed #cbd5e1;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    position: relative;
}

/* Hover sur la zone */
.upload-zone:hover {
    border-color: #F59E0B;
    background: linear-gradient(145deg, #fff8e1, #ffe4b5);
    transform: scale(1.02);
}

/* État actif pendant le drag */
.upload-zone.drag-active {
    border-color: #10B981;
    border-width: 3px;
    background: linear-gradient(145deg, #d1fae5, #a7f3d0);
    transform: scale(1.05);
}

/* Animation de pulsation pendant le drag */
.upload-zone.drag-active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #10B981;
    border-radius: inherit;
    animation: pulse 1.5s infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

/* Icône d'upload */
.upload-zone i {
    transition: transform 0.3s ease;
}

.upload-zone:hover i {
    transform: scale(1.1);
}

.upload-zone.drag-active i {
    color: #10B981;
    transform: scale(1.2);
}

/* Liste des fichiers */
#documents-preview .list-group-item {
    transition: all 0.2s ease;
}

#documents-preview .list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Bouton supprimer fichier */
.remove-file {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.remove-file:hover {
    opacity: 1;
}

/* Icônes de fichiers avec couleurs */
.ri-file-pdf-line {
    color: #dc2626;
}

.ri-image-line {
    color: #10B981;
}

.ri-file-line {
    color: #3b82f6;
}

/* ============================================================ */
/* FIX : Suppression double flèche Choices.js + Bootstrap      */
/* ============================================================ */

/* Supprimer la flèche Bootstrap sur les selects avec Choices.js */
select.pce-select.choices__input[hidden] {
    /* Le select original est caché, pas de style nécessaire */
}

/* Supprimer l'icône de flèche Bootstrap du conteneur Choices */
.choices.form-select {
    background-image: none !important;
    padding-right: 0.75rem !important;
}

/* S'assurer que le conteneur Choices a le bon style */
.choices.form-select .choices__inner {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
}

/* Style de la flèche Choices.js */
.choices.form-select[data-type*="select-one"]::after {
    border-color: #6c757d transparent transparent transparent;
    border-style: solid;
    border-width: 5px 5px 0 5px;
    content: "";
    height: 0;
    pointer-events: none;
    position: absolute;
    right: 11.5px;
    top: 50%;
    margin-top: -2.5px;
    width: 0;
}

/* Rotation de la flèche quand ouvert */
.choices.form-select[data-type*="select-one"].is-open::after {
    border-color: transparent transparent #6c757d transparent;
    border-width: 0 5px 5px 5px;
    margin-top: -7.5px;
}

/* Focus state */
.choices.form-select:focus-within .choices__inner,
.choices.form-select.is-focused .choices__inner {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Dropdown list styling */
.choices__list--dropdown {
    z-index: 1050;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.choices__list--dropdown .choices__item--selectable {
    padding: 0.5rem 0.75rem;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #0d6efd;
    color: #fff;
}

/* Input de recherche dans le dropdown */
.choices__input--cloned {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

/* Texte "Aucun résultat" */
.choices__item--choice.has-no-results {
    color: #6c757d;
    padding: 0.5rem 0.75rem;
}

/* ============================================================ */
/* RESPONSIVE - Ajustements pour petits écrans                 */
/* ============================================================ */

@media (max-width: 768px) {
    .choices.form-select .choices__inner {
        font-size: 0.875rem;
    }
    
    .choices__list--dropdown .choices__item--selectable {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* ============================================================ */
/* VARIANT : form-select-sm (si utilisé)                        */
/* ============================================================ */

.choices.form-select-sm {
    background-image: none !important;
    padding-right: 0.5rem !important;
}

.choices.form-select-sm .choices__inner {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 2rem 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.choices.form-select-sm[data-type*="select-one"]::after {
    right: 8px;
    border-width: 4px 4px 0 4px;
}

.choices.form-select-sm[data-type*="select-one"].is-open::after {
    border-width: 0 4px 4px 4px;
    margin-top: -6px;
}

/* ============================================================ */
/* DROPDOWN PCE - LARGEUR ADAPTATIVE (VERSION RENFORCÉE)      */
/* ============================================================ */

/* Version avec !important et sélecteurs plus spécifiques */

/* Cibler spécifiquement la dropdown du champ PCE */
.choices[data-type*="select-one"].pce-select-choices .choices__list--dropdown,
select.pce-select + .choices[data-type*="select-one"] .choices__list--dropdown,
.pce-select.choices__input + .choices__list.choices__list--dropdown,
div.choices .choices__list.choices__list--dropdown {
    /* Forcer la largeur adaptative */
    min-width: 100% !important;
    width: auto !important;
    max-width: 800px !important;
    
    /* Positionnement */
    position: absolute !important;
    left: 0 !important;
    
    /* Z-index élevé */
    z-index: 99999 !important;
    
    /* Affichage */
    display: block !important;
}

/* Items de la dropdown : une seule ligne */
.choices[data-type*="select-one"] .choices__list--dropdown .choices__item--choice,
.choices .choices__list--dropdown .choices__item.choices__item--selectable {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: block !important;
    width: auto !important;
}

/* Container de la liste interne */
.choices .choices__list--dropdown .choices__list[role="listbox"] {
    width: auto !important;
    min-width: 100% !important;
}

/* Input de recherche dans la dropdown */
.choices .choices__list--dropdown .choices__input.choices__input--cloned {
    width: 100% !important;
    min-width: 100% !important;
}

/* ============================================================ */
/* ALTERNATIVE : LARGEUR FIXE SI max-content NE FONCTIONNE PAS */
/* ============================================================ */

/* Si width: auto ne suffit pas, forcer une largeur minimale */
.choices .choices__list--dropdown {
    min-width: 600px !important;
}

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

@media (max-width: 992px) {
    .choices .choices__list--dropdown {
        min-width: 500px !important;
        max-width: calc(100vw - 40px) !important;
    }
}

@media (max-width: 768px) {
    .choices .choices__list--dropdown {
        min-width: 400px !important;
        max-width: calc(100vw - 30px) !important;
        left: 0 !important;
        right: auto !important;
    }
}

@media (max-width: 576px) {
    .choices .choices__list--dropdown {
        min-width: 100% !important;
        max-width: calc(100vw - 20px) !important;
    }
    
    .choices .choices__list--dropdown .choices__item {
        white-space: normal !important;
        word-wrap: break-word !important;
    }
}

/* ============================================================ */
/* SCROLLBAR PERSONNALISÉE                                     */
/* ============================================================ */

.choices__list--dropdown .choices__list {
    max-height: 400px !important;
    overflow-y: auto !important;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar {
    width: 8px;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.choices__list--dropdown .choices__list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================================ */
/* AMÉLIORATION VISUELLE                                        */
/* ============================================================ */

.choices .choices__list--dropdown {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2) !important;
}

/* Police légèrement plus petite pour compacité */
.choices .choices__list--dropdown .choices__item {
    font-size: 0.8125rem !important;
    padding: 0.4rem 0.75rem !important;
}