/* -------------------------------------------------------------------------- */
/*                                CSS Personnalisé                            */
/* -------------------------------------------------------------------------- */

.calendar .calendar-day {
    padding: 0.75rem;
}

.data-table thead th {
    cursor: pointer;
}

.processing {
    pointer-events: none; /* Empêche les interactions pendant le traitement */
    cursor: not-allowed;
}

.card .card-download-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
}

.numero-table-rond {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #b8b8b8;
    color: #ffffff !important;
    font-weight: bold;
    font-size: 25px;
    margin: 0 auto;
    transition: border-color 0.3s ease; /* Transition fluide */
}

.cursor-pointer:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* État vert */
.numero-table-rond.etat-vert {
    background-color: #28a745;
}

/* Styles pour les cases d'étapes */
tbody td[data-numero] {
    position: relative;
    height: 60px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    border: 2px solid #dee2e6;
}

/* Case d'étape active (verte) */
tbody td[data-numero].etape-active {
    background-color: #28a745;
    /* border-color: #1e7e34; */
    position: relative;
}

/* Effet clignotant pour la cuisine */
.clignotant-cuisine {
    animation: clignotement 1.5s infinite;
}

@keyframes clignotement {
    0%, 50% {
        background-color: #28a745;
        opacity: 1;
    }
    25%, 75% {
        background-color: #20c997;
        opacity: 0.7;
    }
}

/* Animation de pulsation pour les changements */
.pulse-animation {
    animation: pulse 1s ease-in-out 3;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Indicateur de changement récent */
.changement-recent {
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.8);
    /* border-color: #ffc107 !important; */
}

/* Styles pour les cases cliquables en salle */
.interface-salle tbody td[data-numero] {
    cursor: pointer;
    transition: all 0.2s ease;
}

.interface-salle tbody td[data-numero]:hover {
    /* background-color: #e9ecef; */
    transform: scale(1.01);
}

.interface-salle tbody td[data-numero].etape-active:hover {
    background-color: #218838;
}

/* Icône d'indication dans les cases actives */
tbody td[data-numero].etape-active::before {
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Style spécial pour les cases en cours de clignotement */
.clignotant-cuisine::before {
    animation: rotation 1.5s infinite linear;
}

@keyframes rotation {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* État confirmé pour les cases d'étapes */
tbody td[data-numero].etape-confirmee {
    background-color: #fd7e14; /* Orange Bootstrap */
    /* border-color: #fd7e14; */
    position: relative;
}

/* État confirmé avec icône check-circle */
tbody td[data-numero].etape-confirmee::before {
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Priorité des états pour éviter les conflits */
tbody td[data-numero].etape-confirmee.etape-active {
    background-color: #fd7e14; /* Orange prioritaire sur vert */
}

/* Arrêter le clignotement quand confirmé */
tbody td[data-numero].etape-confirmee.clignotant-cuisine {
    animation: none !important;
    background-color: #fd7e14 !important;
}

/* Hover pour la cuisine sur les cases confirmées */
.interface-cuisine tbody td[data-numero].etape-confirmee {
    cursor: pointer;
    transition: all 0.2s ease;
}

.interface-cuisine tbody td[data-numero].etape-confirmee:hover {
    background-color: #e8650e;
    transform: scale(1.02);
}

/* Styles responsives pour l'état confirmé */
@media (max-width: 768px) {
    tbody td[data-numero].etape-confirmee::before {
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    tbody td[data-numero].etape-confirmee::before {
        font-size: 16px;
    }
}

/* Animation de transition vers l'état confirmé */
.transition-vers-confirme {
    animation: transitionConfirme 0.5s ease-in-out;
}

@keyframes transitionConfirme {
    0% {
        background-color: #28a745;
        transform: scale(1);
    }
    50% {
        background-color: #ffc107;
        transform: scale(1.1);
    }
    100% {
        background-color: #fd7e14;
        transform: scale(1);
    }
}

/* État prêt (orange clignotant) */
tbody td[data-numero].etape-prete {
    background-color: #ff0000 !important;
    /* border-color: #ff0000; */
    animation: clignotementPret 1s infinite;
}

@keyframes clignotementPret {
    0%, 50% {
        background-color: #ff0000 !important;
        opacity: 1;
    }
    25%, 75% {
        background-color: #f94715 !important;
        opacity: 0.8;
    }
}

/* Priorité de l'état prêt */
tbody td[data-numero].etape-prete.etape-confirmee {
    animation: clignotementPret 1s infinite !important;
}

/* Classe pour l'état attente (bleu clignotant) */
tbody td[data-numero].etape-attente {
    background-color: #007bff;
    /* border-color: #0069d9; */
    position: relative;
    animation: clignotementAttente 1.5s infinite;
}

@keyframes clignotementAttente {
    0%, 50% {
        background-color: #007bff;
        opacity: 1;
    }
    25%, 75% {
        background-color: #17a2b8;
        opacity: 0.7;
    }
}

/* Arrêter le clignotement quand confirmé */
tbody td[data-numero].etape-attente-confirmee {
    background-color: #007bff;
    /* border-color: #0069d9; */
    position: relative;
    animation: none;
}

/* Priorité des états pour éviter les conflits */
tbody td[data-numero].etape-attente.etape-active {
    background-color: #007bff !important; /* Bleu prioritaire sur vert */
}

tbody td[data-numero][data-etape="attente"].etape-attente {
    background-color: #007bff !important;
    /* border-color: #0069d9 !important; */
    animation: clignotementAttente 1.5s infinite !important;
}

tbody td[data-numero][data-etape="attente"].etape-attente-confirmee {
    background-color: #007bff !important;
    /* border-color: #0069d9 !important; */
    animation: none !important;
}

/* Styles pour les toasts de notification */
.toast-container .toast {
    min-width: 300px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast-body {
    padding: 0.75rem;
}

.toast-body i {
    color: rgba(255, 255, 255, 0.8);
}

/* Styles responsives */
@media (max-width: 768px) {
    .numero-table-rond {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 14px;
    }
    
    tbody td[data-numero] {
        height: 50px;
    }
    
    tbody td[data-numero].etape-active::before {
        font-size: 20px;
    }
    
    .toast-container {
        width: 100%;
        padding: 0.5rem;
    }
    
    .toast-container .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .numero-table-rond {
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 12px;
    }
    
    tbody td[data-numero] {
        height: 40px;
    }
    
    tbody td[data-numero].etape-active::before {
        font-size: 16px;
    }
}

/* Style pour la table désactivée */
tbody tr.table-eteinte td[data-numero] {
    background-color: #6c757d !important;
    opacity: 0.5;
    cursor: not-allowed;
}

tbody tr.table-eteinte td[data-numero].etape-active {
    background-color: #6c757d !important;
}

/* Animation d'entrée pour les nouvelles notifications */
.toast.show {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .numero-table-rond {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

.btn-doree {
    background-color: #c0a357 !important;
    color: #ffffff !important;
    border-color: #0b0b0b !important;
}

.bg-doree {
    background-color: #c0a357 !important;
    color: #ffffff !important;
}

.btn-doree:hover {
    background-color: #b89c4f !important;
    color: #ffffff !important;
    border-color: #0b0b0b !important;
}

.card:hover > .card-download-btn {
    display: block;
}

/** Permet d'enlever la petite flèche du dropdown */
#add-row-button::after {
    display: none;
}

.column-grid-link {
    border: none;
}

.column-grid-link:hover .grid-bg {
    background-color: rgb(146, 241, 68) !important;
    color: #000000;
    transition: background-color 1s ease;
}

.row-control-buttons {
    top: 10px; /* Ajuster selon la marge supérieure désirée */
    bottom: 10px; /* Ajuster selon la marge inférieure désirée */
    left: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    height: calc(
        100% - 20px
    ); /* Ajuster si nécessaire pour la hauteur totale de la rangée */
}

.row-control-buttons a {
    font-size: 16px; /* Ajuster selon la taille désirée des icônes */
    display: flex;
}

.cursor-move {
    cursor: move !important;
}

.cursor-help {
    cursor: help !important;
}

.cursor-interdit {
    cursor: not-allowed !important;
}

disabled:hover {
    cursor: not-allowed !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    justify-content: start !important;
}

.text-truncate {
    max-width: 250px; /* Ajustez selon vos besoins */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-row {
    position: relative;
    padding-left: 30px; /* Espace pour le panneau de contrôle de rangée, ajuster selon le besoin */
}

.alert-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999; /* Assure que le message reste au-dessus des autres éléments */
    background-color: #f8d7da; /* Couleur de fond pour alert-danger de Bootstrap */
    color: #721c24; /* Couleur de texte pour alert-danger de Bootstrap */
    border-color: #f5c6cb; /* Bordure pour alert-danger de Bootstrap */
    padding: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5); /* Optionnel: Ajoute une ombre pour mieux voir l'alerte */
}

.CodeMirror {
    height: auto;
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.sql-toolbar {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.blocnote {
    background-color: #fff8bb;
    color: #000000;
}

.blocnote:focus {
    background-color: #fff8bb;
    color: #000000;
}

.nbNotifSuperieur100 {
    font-size: 0.5rem;
}

.nbNotifSuperieur999 {
    font-size: 0.40rem;
}

fieldset legend {
    color: #2362b7;
    width: auto;
}

fieldset {
    border: 1px solid #2362b7;
    padding: 10px;
}

.dropzone:hover {
    border: 2px dashed #0056b3 !important;
}

.dropzone {
    background: none !important;
}

.dropzone .dz-preview.dz-image-preview {
    background: none !important;
}

.excalidraw .dropdown-menu{
    display: unset !important;
    padding: unset !important;
}

#tableaublanc-container section {
    padding: 0 !important;
}

.custom-no-result-picker {
    background-color: #dadada !important;
    color: #dc3545 !important;
    padding: 10px !important;
    font-weight: bold !important;
    text-align: center !important;
    border: 1px solid #dc3545 !important;
    border-radius: 4px !important;
}

.bootstrap-select .no-results {
    background: #f5f5f5 !important;
    color: #dc3545 !important;
    padding: 10px !important;
    margin: 0 5px !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    font-size: 14px !important;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    top: 50% !important;
    left: 5px !important;
    height: 1em !important;
    width: 1em !important;
    margin-top: -9px !important;
    display: inline-block !important;
    color: white !important;
    border: .15em solid white !important;
    border-radius: 1em !important;
    box-shadow: 0 0 .2em #444 !important;
    box-sizing: content-box !important;
    text-align: center !important;
    text-indent: 0 !important;
    font-family: "Courier New", Courier, monospace !important;
    line-height: 1em !important;
    content: "+" !important;
    background-color: #31b131 !important;
}

table.dataTable.dtr-inline.collapsed>tbody>tr.dtr-expanded>td.dtr-control:before,
table.dataTable.dtr-inline.collapsed>tbody>tr.dtr-expanded>th.dtr-control:before{
    top: 50% !important;
    left: 5px !important;
    height: 1em !important;
    width: 1em !important;
    margin-top: -9px !important;
    display: inline-block !important;
    color: white !important;
    border: .15em solid white !important;
    border-radius: 1em !important;
    box-shadow: 0 0 .2em #444 !important;
    box-sizing: content-box !important;
    text-align: center !important;
    text-indent: 0 !important;
    font-family: "Courier New", Courier, monospace !important;
    line-height: 1em !important;
    content: "-" !important;
    background-color: #d33333 !important;
}

fieldset:hover {
    background-color: rgba(13, 110, 253, 0.02);
}

fieldset:hover legend {
    font-weight: 600;
}

.card-header[data-fermable="true"] {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.card-header[data-fermable="true"]:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.card-header[data-fermable="true"] i {
    transition: transform 0.3s ease;
}

.card-header[data-fermable="true"] i.fa-minus {
    transform: rotate(180deg);
}

[data-bs-theme=dark] input[readonly]:not(input[type="hidden"].flatpickr-input + input[readonly]) {
    background-color: #343a40 !important;
    color: #fff !important;
}

[data-bs-theme=light] input[readonly]:not(input[type="hidden"].flatpickr-input + input[readonly]) {
    background-color: #e4e4e4 !important;
    color: #000 !important;
}

.pdf-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #2C3E50;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

body.swal2-shown > [aria-hidden='true'] {
    transition: 0.1s filter;
    filter: blur(3px);
}

@media screen and (max-width: 767px) {
    .table-cards thead { 
        display: none; 
    }
    
    .table-cards,
    .table-cards tbody,
    .table-cards tr {
        display: block;
        width: 100%;
    }
    
    .table-cards tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.5rem;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        max-width: 100%;
        overflow: hidden;
        position: relative;
    }
    
    /* Styles pour le titre de la card */
    .table-cards .card-title {
        font-weight: bold;
        font-size: 1.1em;
        margin: -1rem -1rem 1rem -1rem;
        padding: 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .table-cards .toggle-icon {
        transition: transform 0.3s ease;
        display: inline-block;
    }

    /* Content container pour l'animation */
    .table-cards .card-content {
        transition: max-height 0.3s ease-out;
        overflow: hidden;
        max-height: 2000px;
    }

    .table-cards tr.collapsed .card-content {
        max-height: 0;
        overflow: hidden;
    }
    
    .table-cards td {
        display: flex;
        padding: 0.25rem 0;
        border: none !important;
        align-items: flex-start;
        min-width: 0;
        text-align: left !important;
        padding-left: 0 !important;
        /* Ajout de ces propriétés */
        flex-wrap: wrap;
        gap: 0.5rem; /* Espace entre les éléments */
    }
    
    .table-cards td::before {
        content: attr(data-label);
        font-weight: bold;
        color: rgb(117, 117, 117);
        width: 140px;
        min-width: 140px;
        flex-shrink: 0;
        padding-right: 1rem;
        text-align: left;
    }
    
    .table-cards td .td-content {
        flex: 1;
        min-width: 0;
        overflow: auto;
        text-overflow: unset;
        word-wrap: break-word;
        text-align: left !important;
    }

    .table-cards .td-content:has(button) {
        overflow: visible;
    }
    
    .table-cards .actions-cell {
        justify-content: flex-end;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 1px solid #dee2e6 !important;
    }
    
    .table-cards .actions-cell::before {
        display: none;
    }

    .table-cards tfoot {
        display: block;
        width: 100%;
        margin-top: 1rem;
    }

    .table-cards tfoot tr {
        background-color: #f8f9fa;
        padding: 0.5rem; /* Ajout d'un peu de padding */
    }

    .table-cards tfoot td::before {
        content: attr(data-label);
        font-weight: bold;
        color: rgb(117, 117, 117);
        width: 185px;
        min-width: 185px;
        flex-shrink: 0;
        padding-right: 1rem;
        text-align: left !important;
        white-space: nowrap; /* Empêche le retour à la ligne */
        overflow: hidden; /* Au cas où */
        text-overflow: ellipsis; /* Au cas où */
    }

    .table-cards tfoot td {
        display: flex;
        padding: 0.05rem 0.05rem; /* Ajout de padding horizontal */
        border: none !important;
        align-items: center; /* Changed from flex-start */
        min-width: 0;
        gap: 0.5rem; /* Ajoute un espacement entre label et contenu */
    }

    .table-cards tfoot td .td-content {
        flex: 1;
        min-width: 0;
        font-weight: bold;
        color: #000;
        text-align: right !important; /* Aligne les valeurs à droite */
    }

    /* Cache les cellules sans data-label dans le tfoot */
    .table-cards tfoot td:not([data-label]) {
        display: none;
    }

    /* Assure que seules les cellules avec data-label sont visibles */
    .table-cards tfoot td[data-label] {
        display: flex;
        margin: 0; /* Reset des marges */
    }
}

.dropdown-menu.dropdown-menu-end {
    z-index: 1050;
}

/* PRELOADER QUAND LA PAGE EST EN CHARGEMENT */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-in-out;
  }
  
  #preloader.hide {
    opacity: 0;
    pointer-events: none;
  }
  
  .spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
  }
  
  .dot1, .dot2, .dot3 {
    width: 16px;
    height: 16px;
    background-color: #4285f4;
    border-radius: 50%;
    margin: 0 6px;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
  }
  
  .dot1 {
    animation-delay: -0.32s;
    background-color: #f07d00;
  }
  
  .dot2 {
    animation-delay: -0.16s;
    background-color: #7e4100;
  }
  
  .dot3 {
    background-color: #030d05;
  }
  
  .loading-text {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    color: #555;
    margin-top: 10px;
  }
  
  @keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
  }
  
  /* Style supplémentaire pour l'animation de disparition */
  @keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
  }
  /* FIN PRELOADER */