/* Tableau Kanban d'administration (demandes & recettes) + fil de commentaires.
   Chargé globalement via assets/app.js (import './feature-request.css'). */

#kanban-board {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}

/* --- Colonnes ---------------------------------------------------- */
.kanban-column {
    width: 300px;
    min-width: 300px;
    border: none;
    border-radius: 0.75rem;
    background-color: #f5f7fb;
    box-shadow: 0 1px 2px rgba(43, 45, 80, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.kanban-column:hover {
    box-shadow: 0 4px 12px rgba(43, 45, 80, 0.1);
}
.kanban-column > .card-header {
    border-bottom: none;
    border-top: 3px solid var(--falcon-primary, #2c7be5);
    background-color: #fff !important;
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
}
.kanban-column > .card-body.kanban-cards {
    background-color: #f5f7fb;
}
.kanban-column > .card-footer {
    background-color: #f5f7fb !important;
}

.kanban-cards {
    min-height: 60px;
}

/* --- Compteur ---------------------------------------------------- */
.kanban-column [data-kanban-count] {
    background-color: rgba(44, 123, 229, 0.12) !important;
    color: var(--falcon-primary, #2c7be5);
    font-weight: 600;
}

/* --- Cartes ------------------------------------------------------ */
.kanban-card {
    cursor: pointer;
    border: 1px solid rgba(43, 45, 80, 0.08);
    border-radius: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(43, 45, 80, 0.12);
    border-color: rgba(44, 123, 229, 0.4);
}
.kanban-card .kanban-card-actions .btn {
    cursor: pointer;
}
.kanban-card-meta {
    font-size: 0.72rem;
}

/* Petite icône d'action (crayon / corbeille) sur cartes, colonnes, commentaires. */
.kanban-icon-sm {
    font-size: 0.7rem;
}

/* Poignée de déplacement d'une colonne. */
.kanban-column-drag-handle {
    cursor: grab;
}

/* --- Drag & drop ------------------------------------------------- */
.kanban-card.sortable-ghost {
    opacity: 0.4;
    outline: 2px dashed var(--falcon-primary, #2c7be5);
    outline-offset: -2px;
}
.kanban-card.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 10px 24px rgba(43, 45, 80, 0.2);
}

/* --- Affordance "Ajouter une carte" ----------------------------- */
.kanban-column > .card-footer .btn {
    border: 1px dashed rgba(44, 123, 229, 0.5);
    background-color: transparent;
    color: var(--falcon-primary, #2c7be5);
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.kanban-column > .card-footer .btn:hover {
    background-color: rgba(44, 123, 229, 0.08);
    border-color: var(--falcon-primary, #2c7be5);
    border-style: solid;
}

.kanban-add-column {
    width: 300px;
    min-width: 300px;
}

/* --- Pièces jointes : chips / vignettes -------------------------- */
.kanban-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(43, 45, 80, 0.12);
    border-radius: 0.5rem;
    background-color: #fff;
    font-size: 0.78rem;
}
.kanban-attachment-chip img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 0.25rem;
}
.kanban-attachment-chip .kanban-attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}
.kanban-attachment-chip .kanban-attachment-remove {
    border: none;
    background: transparent;
    color: var(--falcon-danger, #e63757);
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

/* --- Modale de détail ------------------------------------------- */
#featureRequestDetailModal [data-kanban-target="detailDescription"] img,
#featureRequestDetailModal [data-kanban-target="detailAttachments"] img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Intitulés de section (PIÈCES JOINTES, COMMENTAIRES). */
.kanban-section-title {
    font-size: 0.72rem;
}

/* --- Fil de commentaires ---------------------------------------- */
.kanban-comment-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
    /* Couleur déterministe par utilisateur, fournie en variable (user_avatar_color). */
    background-color: var(--kanban-avatar-bg, #6c757d);
}

.kanban-comments-list .kanban-comment {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(43, 45, 80, 0.06);
}
.kanban-comments-list .kanban-comment:last-child {
    border-bottom: none;
}

.kanban-comment-meta {
    font-size: 0.78rem;
}

.kanban-comment-text {
    font-size: 0.875rem;
    line-height: 1.45;
    color: #4d5969;
    word-break: break-word;
    white-space: normal;
    margin-top: 0.1rem;
}

/* Actions (modifier / supprimer) discrètes, révélées au survol. */
.kanban-comment-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.kanban-comment:hover .kanban-comment-actions,
.kanban-comment-actions:focus-within {
    opacity: 1;
}
.kanban-comment-delete:hover {
    color: var(--falcon-danger, #e63757) !important;
}

/* --- Composer de commentaire ------------------------------------ */
.kanban-comment-composer .flex-grow-1 {
    position: relative;
}

/* Calque de surbrillance des mentions, calé derrière le textarea : mêmes
   métriques de boîte que .form-control pour que les glyphes s'alignent. */
.kanban-comment-input-wrap {
    position: relative;
}
.kanban-comment-input-wrap .kanban-comment-input {
    position: relative;
    background-color: transparent;
}
.kanban-comment-highlighter {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0.375rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    overflow: hidden;
    pointer-events: none;
    color: transparent;
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}
.kanban-comment-highlighter .kanban-mention {
    color: transparent;
}

.kanban-comment-input {
    resize: vertical;
    min-height: 42px;
}

/* --- Pièces jointes d'un commentaire ---------------------------- */
.kanban-comment-attachment-img img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid rgba(43, 45, 80, 0.12);
}

/* --- Entrée d'activité (système) -------------------------------- */
.kanban-activity {
    padding: 0.3rem 0;
}
.kanban-activity-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #eef1f7;
    color: #8a94a6;
    font-size: 0.62rem;
}

/* --- Réactions emoji -------------------------------------------- */
.kanban-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.05rem 0.45rem;
    border: 1px solid rgba(43, 45, 80, 0.14);
    border-radius: 1rem;
    background-color: #fff;
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.kanban-reaction-pill:hover {
    background-color: #f5f7fb;
}
.kanban-reaction-pill.is-mine {
    background-color: rgba(44, 123, 229, 0.12);
    border-color: rgba(44, 123, 229, 0.55);
}
.kanban-reaction-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5e6e82;
}

.kanban-reaction-add {
    position: relative;
    display: inline-flex;
}
.kanban-reaction-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.05rem;
    padding: 0.05rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 1rem;
    background-color: transparent;
    color: #8a94a6;
    font-size: 0.78rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}
.kanban-comment:hover .kanban-reaction-add-btn,
.kanban-comment-reactions:focus-within .kanban-reaction-add-btn,
.kanban-reaction-pill ~ .kanban-reaction-add .kanban-reaction-add-btn {
    opacity: 1;
}
.kanban-reaction-add-btn:hover {
    background-color: #f5f7fb;
}
.kanban-reaction-plus {
    font-weight: 700;
}

.kanban-reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    z-index: 5;
    display: flex;
    gap: 0.15rem;
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid rgba(43, 45, 80, 0.14);
    border-radius: 0.6rem;
    box-shadow: 0 6px 18px rgba(43, 45, 80, 0.16);
}
.kanban-reaction-choice {
    border: none;
    background: transparent;
    border-radius: 0.4rem;
    padding: 0.15rem 0.3rem;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, transform 0.12s ease;
}
.kanban-reaction-choice:hover {
    background-color: #f0f3f9;
    transform: scale(1.15);
}

/* --- Mentions (@) ----------------------------------------------- */
.kanban-mention {
    color: var(--falcon-primary, #2c7be5);
    background-color: rgba(44, 123, 229, 0.1);
    border-radius: 0.3rem;
    padding: 0 0.2rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Menu d'autocomplétion sous le textarea. */
.kanban-mention-menu {
    position: absolute;
    z-index: 1056; /* au-dessus du contenu de la modale */
    min-width: 220px;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem;
    background-color: #fff;
    border: 1px solid rgba(43, 45, 80, 0.14);
    border-radius: 0.6rem;
    box-shadow: 0 6px 18px rgba(43, 45, 80, 0.16);
}
.kanban-mention-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 0.4rem;
    text-align: left;
    font-size: 0.85rem;
    color: #4d5969;
    cursor: pointer;
}
.kanban-mention-option:hover,
.kanban-mention-option.is-active {
    background-color: #f0f3f9;
}
.kanban-mention-option .kanban-comment-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.6rem;
}
