﻿/* FxAttachment - grid layout matching NxImageUploader */

.fx-attachment-root {
    display: block;
    margin: 8px 0;
    grid-column: -1 / 1;
    background: var(--nx-tertiary-bg);
    border-radius: var(--nx-border-radius);
    padding: var(--nx-space);
}

.fx-attachment-header {
    padding-bottom: var(--nx-space-small);
}

/* status text */
.fx-attachment-status {
    color: var(--nx-muted-fg, #666);
    font-size: 0.9rem;
    display: block;
    text-align: center;
}

/* file button styling */
.nx-file-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--nx-hilight-bg);
    padding: var(--nx-space-small);
    border-radius: var(--nx-border-radius);
    cursor: pointer;
    border: none;
    box-shadow: var(--nx-box-shadow);
    position: relative;
    overflow: hidden;
}

    /* hide the native file input but keep it interactive */
    .nx-file-button input[type="file"] {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
        pointer-events: none;
    }

.fx-attachment-loading,
.fx-attachment-empty {
    font-size: 0.85rem;
    color: var(--nx-muted, #888);
    padding: 0.25rem 0;
}

/* horizontal flex row of items */
.fx-attachment-list {
    display: flex;
    gap: var(--nx-space-small);
    overflow-x: auto;
    padding: var(--nx-space-small);
    background: var(--nx-primary-bg);
    border-radius: var(--nx-border-radius);
}

.fx-attachment-item {
    border-radius: var(--nx-border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: var(--nx-box-shadow);
}

    .fx-attachment-item a {
        margin: 0px;
        box-shadow: none;
        padding: 0px;
    }

/* square thumbnail - same size for images and file cards */
.fx-attachment-thumb {
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin: 0px;
    border-radius: var(--nx-border-radius);
    display: flex;
}

/* file card - displayed as a square "thumb" for non-images */
.fx-attachment-file-card {
    background: var(--nx-secondary-bg, #f5f5f5);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s;
}

    .fx-attachment-file-card:hover {
        background: var(--nx-hover-bg, #e8e8e8);
    }

.fx-attachment-file-icon {
    font-size: 2.5rem;
    color: var(--nx-accent, #4a90e2);
}

.fx-attachment-file-name {
    font-size: 0.8rem;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.2;
}

.fx-attachment-file-size {
    font-size: 0.7rem;
    color: var(--nx-muted, #888);
}

/* overlay delete button - matches nx-imageuploader-delete */
.fx-attachment-delete {
    font-size: 0.85rem;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: var(--nx-primary-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--nx-negative-fg);
    margin: 0px;
    box-shadow: var(--nx-box-shadow);
    z-index: 2;
}

    .fx-attachment-delete:hover,
    .nx-file-button:hover {
        filter: brightness(0.95);
    }

.fx-attachment-file {
    display: none;
}
