.file-grid {
    width: fit-content;
    background-color: var(--primary-inverse-color);
    font-size: var(--grid-font-size);
    display: block;
}

    .file-grid table {
        width: auto;
        min-width: 50%;
        font-size: inherit;
        table-layout: fixed;
        border: 1px solid #ddd;
        border-collapse: collapse;
    }

    .file-grid th,
    .file-grid td {
        height: var(--line-height);
        line-height: var(--line-content-height);
        padding: 0 var(--horizontal-padding);
        box-sizing: border-box;
        vertical-align: middle;
        overflow: hidden; /* Prevent content overflow */
        text-overflow: ellipsis; /* Add ellipsis for long content */
        white-space: nowrap; /* Prevent text wrapping */
    }

    .file-grid th,
    .file-grid td,
    .file-grid tr {
        font-size: inherit;
        font-family: var(--bs-body-font-family);
    }

    .file-grid th {
        background-color: var(--primary-color);
        color: var(--primary-inverse-color);
        position: sticky;
        top: 0;
    }

    .file-grid tr:nth-child(even) {
        background-color: #f2f2f2;
    }

    .file-grid tr:hover {
        background-color: #e9e9e9;
    }

@-moz-document url-prefix() {
    .file-grid table {
        border-spacing: 0;
    }

    .file-grid th,
    .file-grid td {
        border-right: 1px solid #ddd;
    }

        .file-grid th:last-child,
        .file-grid td:last-child {
            border-right: none;
        }
}

.column-filename, .cell-filename {
    text-align: left;
    width: 50%;
}

.column-date, .cell-date {
    text-align: left;
    width: 30%;
}

.column-size, .cell-size {
    text-align: left;
    width: 15%;
}

.column-action, .cell-action {
    text-align: center;
    width: 10%;
    padding: 0 !important; /* Remove padding in action column */
}

/* CSS for horizontal layout */
.form-row {
    display: flex;
    gap: var(--form-spacing);
    margin-bottom: var(--form-spacing);
    align-items: flex-start;
    width: 100%;
}

.form-column {
    flex: 1;
    min-width: 0;
}

.form-row .file-grid,
.form-row .file-grid table {
    width: auto;
    border-spacing: 0;
    table-layout: fixed;
}

.form-column textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 200px;
}
