/* ============================================================
   SyncArti Chat — composant _chat.html.twig
   ============================================================ */

/* --- Variables --- */
.sc-chat-wrapper {
    --sc-amber: #BA7517;
    --sc-amber-light: #FAEEDA;
    --sc-amber-dark: #412402;
    --sc-send-bg: #BA7517;
    font-family: system-ui, sans-serif;
}

/* --- Wrapper global --- */
.sc-chat-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Header --- */
.sc-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    border-radius: 12px 12px 0 0;
}
.sc-chat-header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #639922;
    flex-shrink: 0;
}
.sc-chat-header-title {
    font-size: 14px;
    font-weight: 500;
}
.sc-chat-header-count {
    margin-left: auto;
    font-size: 12px;
    color: #888;
}

/* --- Liste des messages --- */
.sc-chat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f5f5f3;
    min-height: 400px;
    overflow-y: auto;
    max-height: 60vh;
}

/* --- Pills système --- */
.sc-pill {
    align-self: center;
    font-size: 11px;
    border-radius: 20px;
    padding: 3px 10px;
    border: 0.5px solid;
    max-width: 90%;
    text-align: center;
}
.sc-pill--gray {
    background: #f0efe8;
    border-color: #d3d1c7;
    color: #5f5e5a;
}
.sc-pill--green {
    background: #eaf3de;
    border-color: #c0dd97;
    color: #3b6d11;
}
.sc-pill--red {
    background: #fcebeb;
    border-color: #f7c1c1;
    color: #a32d2d;
}
.sc-pill--blue {
    background: #e6f1fb;
    border-color: #b5d4f4;
    color: #185fa5;
}

/* --- Messages --- */
.sc-msg {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sc-msg--own {
    align-items: flex-end;
}
.sc-msg--other {
    align-items: flex-start;
}

.sc-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 80%;
}

.sc-msg-meta {
    font-size: 11px;
    color: #aaa;
}
.sc-msg-meta--own {
    text-align: right;
}
.sc-msg-meta--other {
    text-align: left;
}

/* --- Avatars --- */
.sc-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--av-bg, #eee);
    border: 1.5px solid var(--av-border, #ccc);
    color: var(--av-color, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
}

/* --- Bulles --- */
.sc-bubble {
    padding: 9px 13px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 100%;
    word-break: break-word;
}
.sc-bubble--own {
    background: #FAEEDA;
    color: #412402;
    border-radius: 16px 16px 4px 16px;
}
.sc-bubble--other {
    background: #fff;
    color: #1a1a1a;
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px 16px 16px 4px;
}
.sc-bubble img.sc-thumb {
    max-width: 120px;
    max-height: 120px;
    border-radius: 8px;
    display: block;
    margin-top: 6px;
    cursor: pointer;
    object-fit: cover;
}
.sc-photo-full {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    display: block;
}
.sc-bubble audio {
    display: block;
    margin-top: 4px;
    max-width: 220px;
}
.sc-bubble .sc-doc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #185fa5;
    text-decoration: none;
    margin-top: 4px;
}

/* --- Boutons edit/delete dans meta --- */
.sc-action-inline {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #aaa;
    padding: 0 2px;
}
.sc-action-inline:hover {
    color: #555;
}
.sc-action-inline--danger:hover {
    color: #a32d2d;
}

/* --- Zone enregistrement audio --- */
.sc-recording {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fcebeb;
    border-top: 0.5px solid #f7c1c1;
    font-size: 13px;
}
.sc-recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e24b4a;
    animation: sc-blink 1s infinite;
}
@keyframes sc-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}
.sc-recording-timer {
    font-weight: 500;
    color: #a32d2d;
    min-width: 32px;
}
.sc-rec-btn {
    border-radius: 6px;
    border: 0.5px solid;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-left: auto;
}
.sc-rec-btn--cancel {
    background: #fff;
    border-color: #ddd;
    color: #555;
}
.sc-rec-btn--stop {
    background: #a32d2d;
    border-color: #a32d2d;
    color: #fff;
    margin-left: 6px;
}

/* --- Barre de saisie --- */
.sc-chat-input-bar {
    padding: 10px 12px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    background: #fff;
    border-radius: 0 0 12px 12px;
}
.sc-actions {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.sc-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0.5px solid rgba(0, 0, 0, 0.12);
    background: #f5f5f3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.sc-input-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sc-textarea {
    flex: 1;
    border: 0.5px solid rgba(0, 0, 0, 0.15);
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 14px;
    background: #f5f5f3;
    resize: none;
    line-height: 1.4;
    outline: none;
    min-height: 36px;
    max-height: 100px;
    overflow-y: auto;
}
.sc-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #BA7517;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
