#file-manager {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}
#file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 8px 10px;

    border-bottom: 1px solid var(--border-color);
}

.file-item.file-selected {
    background: rgba(95, 29, 67, 0.15);
}

.file-icon {
    width: 30px;
    flex-shrink: 0;
    text-align: left;
}

.file-name {
    flex: 1;
    min-width: 0;
}

.file-date {
    width: 90px;
    flex-shrink: 0;
    text-align: center;
}

.file-size {
    width: 100px;
    flex-shrink: 0;
    text-align: right;
}
/*стиль для корзины!*/
.file-delete {
    width: 32px;
    height: 32px;

    flex-shrink: 0;

    border: none;
    background: transparent;

    color: inherit;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0.65;

    transition:
        color 0.15s ease,
        opacity 0.15s ease,
        transform 0.15s ease;
}

.file-delete svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-delete:hover {
    color: #d32f2f;
    opacity: 1;
    transform: scale(1.15);
}


/*стиль для ссылки скачивания*/
.file-download {
    width: 32px;
    height: 32px;

    flex-shrink: 0;

    color: inherit;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0.65;

    text-decoration: none;

    transition:
        color 0.15s ease,
        opacity 0.15s ease,
        transform 0.15s ease;
}

.file-download svg {
    width: 19px;
    height: 19px;

    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-download:hover {
    color: #1976d2;
    opacity: 1;
    transform: scale(1.15);
}

/*для прогресс бар*/
.upload-progress-container {
    width: 100%;
}

.file-upload-progress {
    position: relative;
    width: 100%;
    height: 20px;
    margin-top: 5px;
    background: #ddd;
    overflow: hidden;
}

.file-upload-progress-bar {
    width: 0;
    height: 100%;
    background: #5f1d43;
    transition: width 0.1s linear;
}

.file-upload-progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 1;
}

.file-upload-name {
    margin-top: 4px;
    font-size: 13px;
}
/*Сам input прячем:*/

.btn-load input[type="file"] {
    display: none;
}

/*А иконку оформляем:*/
.file-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 36px;

    cursor: pointer;

    border-radius: 4px;
    background: #5f1d43;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.file-upload-button svg {
    width: 22px;
    height: 22px;

    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-upload-button:hover {
    background: #7a2857;
}

.file-upload-button:active {
    transform: scale(0.95);
}
/*А CSS для верхней панели:*/

.file-manager-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;

    padding: 5px 8px;

    background: #eeeeee;
    border-radius: 4px;

    box-sizing: border-box;
}


.file-manager-folder {
    text-align: right;
    color: #555;
}


/* Окно preview */

.file-preview-overlay {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.85);

    z-index: 9999;
}

.file-preview {
    position: relative;

    max-width: 90vw;
    max-height: 90vh;

    padding: 10px;
    box-sizing: border-box;

    background: #222;
    border-radius: 6px;

    overflow: hidden;
}
.file-preview img {
    display: block;

    max-width: 100%;
    max-height: 80vh;

    width: auto;
    height: auto;

    object-fit: contain;
}

.file-preview video {
    display: block;

    max-width: 100%;
    max-height: 80vh;

    width: auto;
    height: auto;

    object-fit: contain;
}
.file-preview-close {
    position: absolute;

    top: 5px;
    right: 8px;

    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    color: #fff;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;
}


/*для смартфона*/
@media (max-width: 600px) {

    .file-date,
    .file-size {
        display: none;
    }

    .file-item {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .file-icon {
        flex: 0 0 auto;
        margin-right: 8px;
    }
/*
min-width: 0; для flex-элемента очень важна.
Без неё .file-name иногда отказывается нормально сжиматься, и браузер начинает вытворять как раз такие вещи — переносить/ломать содержимое.
и
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
даст красивый вариант для длинного имени:
*/
    .file-name {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .file-download,
    .file-delete {
        flex: 0 0 auto;
        margin-left: 8px;
    }
}
