.w-60 {
    width: 60% !important;
}


@media (max-width:768px) {
    .w-60 {
        width: 100% !important;
    }
}

div#conversation_body::-webkit-scrollbar {
    display: none;
}

div#conversation_messages_list::-webkit-scrollbar {
    display: none;
}

.delMsgBtn {
    height: 25px;
}

@media (min-width: 992px) {
    div#conversation_body {
        scrollbar-width: none;
    }

    div#conversation_messages_list {
        scrollbar-width: none;
    }
}

div#conversation_messages_list {
    height: auto !important;
}

.discussionHeader {
    min-height: 75.75px !important;
}

/*Affichage des fichiers dans les messages*/
.file-card {
    display: flex;
    gap: 12px;
    align-items: center;
    /*width: calc(100% - 38.46px);*/
    width: 100%;
}

.file-icon {
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: color-mix(in lab, #4f46e5 12%, var(--bs-card-bg));
    border: 1px dashed color-mix(in lab, #4f46e5 30%, var(--bs-card-bg))
}

.file-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.file-card>* {
    height: 100%;
}

/*.file-name {
}*/

.file-meta {
    font-size: 12px;
    color: var(--muted)
}

.file-actions {
    margin-left: auto;
    display: flex;
    gap: 8px
}

.file-actions .btn {
    appearance: none;
    border: 1px solid var(--bs-card-bg) !important;
    background: transparent;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.file-actions .btn.mobile {
    padding: 12px 16px !important;
}

.file-actions .btn:hover {
    border-color: color-mix(in lab, #4f46e5 40%, var(--bs-card-bg)) !important;
    background: #babac715;
}

@media (min-width:1201px) {
    .file-actions .btn {
        display: flex !important;
        flex-direction: column;
    }

    .file-actions .btn.mobile {
        display: none !important;
    }
}

@media (min-width:1500px) {
    .file-actions .btn {
        flex-direction: row;
    }
}

@media (max-width:1200px) {
    .file-actions .btn {
        display: none;
    }

    .file-actions .btn.mobile {
        display: flex !important;
    }
}

@media (max-width:1060px) {
    .file-name {
        display: none;
    }
}

/*Affichage des images dans les messages*/

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .88);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: grid;
    place-items: center;
    z-index: 60;
    transition:
        opacity 0.35s ease-in-out,
        visibility 0s linear 0.35s,
        backdrop-filter 0.35s ease-in-out;
    backdrop-filter: blur(0px);
}

.lightbox:target {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 0.35s ease-in-out,
        backdrop-filter 0.35s ease-in-out;
    backdrop-filter: blur(6px);
}

.lightbox img {
    max-width: min(96vw, 1440px);
    max-height: 86vh;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
    transform: scale(0.98);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.lightbox:target img {
    transform: scale(1);
    opacity: 1;
}

/* === Loader animé dans la lightbox === */
.lightbox .loader {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--bs-primary, #4f46e5);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    z-index: 61;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Par défaut : loader visible, image invisible */
.lightbox img {
    opacity: 0;
    transform: scale(0.98);
    transition: transform 0.4s ease, opacity 0.4s ease;
}

/* Quand chargée → loader masqué, image visible */
.lightbox img.loaded {
    opacity: 1;
    transform: scale(1);
}

.lightbox img.loaded~.loader {
    display: none;
    animation: none;
}


.lightbox a.close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bs-card-bg);
    color: var(--bs-text-gray-800) !important;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--bs-card-border);
}

/* Affichage du bouton au survol */
.image-card:hover .download-btn {
  opacity: 1;
  transform: translateY(0);
}

/* Hover sur le bouton */
.image-card .download-btn:hover {
  background: rgba(78, 70, 229, 0.5); /* couleur primaire Keen */
}

.image-card img {
    width: 100%;
}

.download-btn svg {
    padding: 5px;
    width: 100%;
    height: 100%;
}

.download-btn {
  position: absolute;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: white;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 2;
}

img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img.lazy.loaded {
    opacity: 1;
}