p, div, span, h1, h2, h3, h4, h5, h6 {
    caret-color: transparent;
}
input, textarea {
    caret-color: currentColor !important;
}

/* Override Flowbite primary colors with green */
:root {
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #22c55e;
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #14532d;
}

/* Force override Flowbite focus ring colors */
.focus\:ring-primary-600:focus {
    --tw-ring-color: rgb(22 163 74) !important;
}

.focus\:border-primary-600:focus {
    border-color: rgb(22 163 74) !important;
}

.focus\:ring-primary-500:focus {
    --tw-ring-color: rgb(34 197 94) !important;
}

.focus\:border-primary-500:focus {
    border-color: rgb(34 197 94) !important;
}

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
            }
    .fade-in {
        animation: fadeIn 1s ease-in-out;
    }
    .fade-in-events {
    animation: fadeInEvents 0.5s;
    }

    @keyframes fadeInEvents {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .hidden {
        display: none;
    }

    .document-grid {
        max-height: 70vh;
        overflow-y: auto;
    }

    .truncate-3-lines {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .modal-blur {
        backdrop-filter: blur(5px);
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 100;
    }
    
    /* Modales globales - doivent recouvrir tout l'écran */
    .modal-global {
        z-index: 100 !important;
    }
    
    /* Modales contextuelles - restent dans leur contexte */
    .modal-contextual {
        z-index: 60 !important;
    }
    
    /* Notifications - doivent toujours être au-dessus de tout */
    #notification-container {
        z-index: 9999 !important;
    }
    
    /* Overlay de chargement - doit être en dessous des modales */
    .z-40 {
        z-index: 40 !important;
    }
    
    .z-50 {
        z-index: 50 !important;
    }
    
    .modal-content {
      background-color: white;
        border-radius: 0.5rem;
        padding: 1.5rem;
        max-width: 500px;
        width: 100%;
        margin: 2rem auto;
    }

    .modal-container {
        width: 90%;
        max-width: 600px;
        max-height: 80vh;
    }

    .artefact-list {
        height: calc(80vh - 40px);
        overflow-y: auto;
    }

    .action-result-content-text ul {
        list-style-type: disc;
        list-style-position: inside;
        margin-left: 1rem;
    }
    .action-result-content-text li {
        margin-bottom: 0.5rem;
    }

    .action-result-content-text ol {
        list-style-type: decimal;
        list-style-position: inside;
        margin-left: 1rem;
      }
      .action-result-content-text h2 {
        color: #374151; /* text-gray-700 */
        font-size: 1.25rem; /* Approx text-xl */
        font-weight: 500; /* font-medium */
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .action-result-content-text h3 {
        color: #6b7280; /* text-gray-500 */
        font-size: 1.125rem; /* Approx text-lg */
        font-weight: 500; /* font-medium */
        margin-top: 1.25rem;
        margin-bottom: 0.5rem; /* mb-2 */
    }
      
    .action-result-content-text h4 {
        color: #1f2937; /* text-gray-800 */
        font-size: 1rem; /* text-base */
        font-weight: 600; /* font-semibold */
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }

    .action-result-content-text h5 {
        color: #374151; /* text-gray-700 */
        font-size: 0.875rem; /* text-sm */
        font-weight: 600; /* font-semibold */
        margin-top: 1rem;
        margin-bottom: 0.25rem;
    }

    .action-result-content-text h6 {
        color: #6b7280; /* text-gray-500 */
        font-size: 0.875rem; /* text-sm */
        font-weight: 500; /* font-medium */
        margin-top: 1rem;
        margin-bottom: 0.25rem;
    }

    .custom-text-content ul {
        list-style-type: disc;
        list-style-position: inside;
        margin-left: 1rem;
    }
    .custom-text-content li {
        margin-bottom: 0.5rem;
    }

    .custom-text-content ol {
        list-style-type: decimal;
        list-style-position: inside;
        margin-left: 1rem;
    }

    .custom-text-content h2 {
        color: #2c3e50;
        font-size: 1.3em;
        font-weight: 600;
        margin-top: 1.5em;
        margin-bottom: 0.75em;
    }

    .custom-text-content h3 {
        color: #2c3e50;
        font-size: 1.1em;
        font-weight: 600;
        margin-top: 1.25em;
        margin-bottom: 0.5em;
    }


    /* Styles pour les messages utilisateur (maintenant avec bulles bleues) */
    .user-message-content p {
        color: #ffffff;
    }
    .user-message-content ul {
        list-style-type: disc;
        list-style-position: inside;
        margin-left: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    .user-message-content li {
        color: #ffffff;
        margin-bottom: 0.5rem;
    }
    .user-message-content ol {
        color: #ffffff;
        list-style-type: decimal;
        list-style-position: inside;
        margin-left: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    .user-message-content h2 {
        color: #ffffff;
        font-size: 1.3em;
        font-weight: 600;
        margin-top: 1.5em;
        margin-bottom: 0.75em;
    }
    .user-message-content h3 {
        color: #ffffff;
        font-size: 1.1em;
        font-weight: 600;
        margin-top: 1.25em;
        margin-bottom: 0.5em;
    }

    /* Styles pour les anciens messages bot (legacy) */
    .bot-message-content p {
        color: #ffffff;
    }
    .bot-message-content ul {
        list-style-type: disc;
        list-style-position: inside;
        margin-left: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    .bot-message-content li {
        color: #ffffff;
        margin-bottom: 0.5rem;
    }
    .bot-message-content ol {
        color: #ffffff;
        list-style-type: decimal;
        list-style-position: inside;
        margin-left: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    .bot-message-content h2 {
        color: #ffffff;
        font-size: 1.3em;
        font-weight: 600;
        margin-top: 1.5em;
        margin-bottom: 0.75em;
    }
    .bot-message-content h3 {
        color: #ffffff;
        font-size: 1.1em;
        font-weight: 600;
        margin-top: 1.25em;
        margin-bottom: 0.5em;
    }

    /* Styles pour les nouveaux messages bot (style simple) */
    .bot-message-simple p {
        color: #374151;
    }
    .bot-message-simple ul {
        list-style-type: disc;
        list-style-position: inside;
        margin-left: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    .bot-message-simple li {
        color: #374151;
        margin-bottom: 0.5rem;
    }
    .bot-message-simple ol {
        color: #374151;
        list-style-type: decimal;
        list-style-position: inside;
        margin-left: 0.5rem;
        margin-bottom: 1rem;
        margin-top: 1rem;
    }
    .bot-message-simple h2 {
        color: #374151;
        font-size: 1.3em;
        font-weight: 600;
        margin-top: 1.5em;
        margin-bottom: 0.75em;
    }
    .bot-message-simple h3 {
        color: #374151;
        font-size: 1.1em;
        font-weight: 600;
        margin-top: 1.25em;
        margin-bottom: 0.5em;
    }



    .project-info-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
    }


.project-info-content.expanded {
        max-height: 500px;
    }

.console-cursor {
    animation: cursor-blink 1s step-end infinite;
    }
    @keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
    }
html, body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}

body {
display: flex;
flex-direction: column;
}


nav {
flex-shrink: 0;
}


.main-container {
display: flex;
flex: 1;
overflow: hidden;
}


#logo-sidebar {
width: 256px; /* w-64 */
overflow-y: auto;
display: flex;
flex-direction: column;
}

#logo-sidebar > div {
flex: 1;
display: flex;
flex-direction: column;
}

#logo-sidebar ul {
margin-top: 0;
padding-top: 1rem;
}


#app {
flex: 1;
overflow-y: auto;
position: relative;
z-index: 10;
}

@media (max-width: 640px) {
.main-container {
flex-direction: column;
}

#logo-sidebar {
width: 100%;
height: auto;
}
}
.modal-artefact-content {
font-family: Arial, sans-serif;
line-height: 1.6;
color: #333;
}
.modal-artefact-content h1 {
color: #2c3e50;
font-size: 1.5em;
font-weight: bold;
margin-top: 1em;
margin-bottom: 0.5em;
}
.modal-artefact-content h2, .modal-artefact-content h3 {
color: #2c3e50;
margin-top: 1em;
font-size: 1.2em;
font-weight: bold;
margin-bottom: 0.5em;
}
.modal-artefact-content h3 {
color: #2c3e50;
margin-top: 1em;
margin-bottom: 0.5em;
}

.modal-artefact-content p {
margin-bottom: 1em;
}
.modal-artefact-content ul, .modal-artefact-content ol {
margin-left: 1.5em;
margin-bottom: 1em;
}
.modal-artefact-content a {
color: #16a34a;
text-decoration: none;
}
.modal-artefact-content a:hover {
text-decoration: underline;
}

.card-image-bg {
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border:1px solid #ffffff;
    z-index: 20;
  }
  
  .card-image-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to right,
      rgba(255,255,255,1) 0%,  
      rgba(255,255,255,1) 40%, 
      rgba(255,255,255,0) 100%  
    );
    z-index: 0;
  }
  
  .card-image-bg > * {
    position: relative;
    z-index: 1;
  }

@media (max-width: 768px) {
    .card-image-bg::before {
        backdrop-filter: blur(4px);
        mask-image: linear-gradient(to right, rgba(255,255,255,0.9), rgba(255,255,255,0.2));
    }
}

@media (max-width: 480px) {
    .card-image-bg {
        background-position: center right;
    }

    .card-image-bg::before {
        backdrop-filter: blur(2px);
        mask-image: linear-gradient(to right, rgba(255,255,255,0.8), rgba(255,255,255,0.1));
    }
}

/* Styles personnalisés pour les input range avec couleur jaune */
input[type="range"].yellow-range {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    outline: none;
}

input[type="range"].yellow-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #F59E0B; /* yellow-500 */
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"].yellow-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #F59E0B; /* yellow-500 */
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input[type="range"].yellow-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

input[type="range"].yellow-range::-moz-range-track {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

/* Style personnalisé pour la partie colorée du slider */
.range-wrapper {
    position: relative;
}

.range-progress {
    position: absolute;
    height: 8px;
    background-color: #F59E0B;
    border-radius: 4px 0 0 4px;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
}

/* Styles personnalisés pour les input checkbox avec couleur jaune */
.yellow-checkbox {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db; /* gray-300 */
    border-radius: 4px;
    background-color: #f9fafb; /* gray-50 */
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
}

.yellow-checkbox:checked {
    background-color: #F59E0B; /* yellow-500 */
    border-color: #F59E0B; /* yellow-500 */
}

.yellow-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3); /* yellow-500 with opacity */
}

.yellow-checkbox:checked::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Styles spécifiques pour Firefox */
@-moz-document url-prefix() {
    .yellow-checkbox:checked::before {
        left: 3px;
        top: 0px;
    }
}

.no-scrollbar::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE 10+ */
    scrollbar-width: none; 
}

.tooltip-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
  }
  
  .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    width: 250px;
    background-color: #1f2937;
    color: white;
    text-align: left;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: opacity 0.3s;
    pointer-events: none;
  }
  
  .tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
  }


  /* Chat Zone */
  .console-cursor {
    animation: cursor-blink 1s step-end infinite;
  }
  @keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
  }
  
  /* Blinking Animation for Thinking Text */
  @keyframes blinking-text {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
  }
  
  /* Thinking Message Style */
  .thinking-message {
    font-style: italic;
    color: #16a34a; /* green-600 */
    padding: 4px 0; /* Add some minimal padding */
    min-height: 1.5em; /* Ensure it takes up some space even when empty */
    transition: opacity 0.3s ease-out;
    /* Apply animation when the element is not empty */
    animation: none; /* Default: no animation */
  }
  .thinking-message:not(:empty) {
    animation: blinking-text 1.5s infinite ease-in-out;
  }
  
  .thinking-message:empty {
      opacity: 0;
  }

/* Target direct children of the container for animation */
#project-chat-container > div {
    transition: opacity 300ms ease-out;
    }
    /* Start transparent when added by HTMX */
    #project-chat-container > .htmx-added {
    opacity: 0;
    }

.avatar-shadow {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.avatar-shadow:hover {
    transform: translateY(-2px);
}

.login-section-bg {
    /* background-image: url('/static/images/background.opti.webp'); */
    background-color: #f5f2f0;
    background-size: cover;
    background-position: center;
  }

.aside-bg {
    background-color: #f5f2f0 !important;
}

.aside-dropdown-bg {
    background-color: #f5f2f0 !important;
}

.aside-button-bg {
    background-color: #f5f2f0 !important;
}

.aside-button-bg:hover {
    background-color: #f0ede8 !important;
}

/* Chat zone backgrounds */
.chat-container-bg {
    background-color: rgba(245, 242, 240, 0.7) !important;
}

.chat-messages-bg {
    background-color: #f5f2f0 !important;
}

.chat-input-bg {
    background-color: #f5f2f0 !important;
}

.chat-card-bg {
    background-color: #f5f2f0 !important;
}

.chat-card-bg:hover {
    background-color: #f0ede8 !important;
}

.chat-nav-button-bg {
    background-color: #f5f2f0 !important;
}

/* Preserve user message colors */
.user-message-content {
    background-color: #047857 !important; /* emerald-700 */
}

.bg-emerald-700 {
    background-color: #047857 !important; /* Ensure user messages stay green */
}

  @media (max-width: 768px) {
    .login-section-bg {
      /* background-image: url('/static/images/background-mobile.opti.webp'); */
      background-color: #f5f2f0;
    }
  }

/* Ensure spin animation is defined */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.animate-spin {
  animation: spin 1s linear infinite !important;
}

@keyframes spin-slow {
    to { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin-slow 2s linear infinite;
}

.htmx-indicator {
    display: none;
  }
  .htmx-request .htmx-indicator {
    display: inline-flex;
  }
  .htmx-request .htmx-indicator-hide {
    display: none;
  }

.loading-border {
    border-width: 6px;
    border-style: solid;
    border-color: #FFFFFFCC transparent #FFFFFFCC transparent;
}

/* Animation for Bot Working Avatar */
@keyframes pulseAvatarAnimation {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.animate-pulse-avatar {
  animation: pulseAvatarAnimation 1.5s infinite ease-in-out;
}

.slide h1 {
  color: #1f2937;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

/* --- Avatar --- */
.avatar-shadow {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.avatar-shadow:hover {
    transform: translateY(-2px);
}

.avatar-transition {
    transition: opacity 0.3s ease-in-out;
}

.avatar-overlay-container {
    position: relative;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-video, .avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 500ms ease-in-out, transform 300ms ease-out;
    transform: scale(0.95);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.avatar-image-visible {
    opacity: 1;
    transform: scale(1);
}

.avatar-overlay-container:hover .avatar-image.avatar-image-visible {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}