/* ── Attachments Section ───────────────────────────────── */

.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.attachment-item {
    position: relative;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary, #f9fafb);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.attachment-item:hover {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.attachment-item.is-image {
    width: 80px;
    height: 80px;
}

.attachment-item.is-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.attachment-item.is-doc {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    min-width: 180px;
    max-width: 260px;
}

.attachment-doc-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.attachment-doc-info {
    overflow: hidden;
}

.attachment-doc-name {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary, #111827);
}

.attachment-doc-size {
    font-size: 11px;
    color: var(--text-secondary, #6b7280);
}

.attachment-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    padding: 0;
    display: none;
    z-index: 1;
}

.attachment-item:hover .attachment-delete {
    display: block;
}

.attach-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    background: none;
    border: 1px dashed var(--border-color, #d1d5db);
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.attach-file-btn:hover {
    color: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
}

#attachment-file-input {
    display: none;
}

/* ── Drag-and-Drop Overlay ──────────────────────────────── */

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.12);
    border: 2px dashed #2563eb;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.drop-overlay.active {
    display: flex;
}

.drop-overlay-label {
    font-size: 16px;
    font-weight: 600;
    color: #2563eb;
    background: rgba(255,255,255,0.9);
    padding: 12px 24px;
    border-radius: 6px;
}

/* ── Lightbox ───────────────────────────────────────────── */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

/* ── Upload toast ───────────────────────────────────────── */

.upload-toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
