/* ========================================== */
/* КРАТКОЕ ОГЛАВЛЕНИЕ                         */
/* ========================================== */
/*
 * ФАЙЛ: edit-file-modal.css
 * НАЗНАЧЕНИЕ: Модальное окно редактирования файлов
 *
 * СОДЕРЖАНИЕ:
 * 1. .edit-file-modal - Модальное окно на весь экран карточки
 * 2. .edit-file-modal__content - Контейнер содержимого
 * 3. .edit-file-modal__close - Кнопка закрытия (крестик)
 * 4. .edit-file-modal__title - Заголовок
 * 5. .edit-file-form - Форма (CSS Grid, 2 колонки)
 * 6. Поля формы: input, file-upload, info, submit, delete
 *
 * ОСОБЕННОСТИ:
 * - Фон: #ffdd76 (желтый, как у всех модалок хранилища)
 * - Кнопка закрытия: position absolute на уровне модала
 * - Центрирование: flex column justify-content center
 * - Адаптивность: 2 брейкпоинта (880px и 490px)
 */
/* ========================================== */

/* 1. Модальное окно */
.edit-file-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffdd76;
    border-radius: 12px;
    z-index: 1000;
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
}

.edit-file-modal.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 2. Контейнер */
.edit-file-modal__content {
    position: relative;
    max-width: 800px;
    width: calc(100% - 60px);
    margin: 0 auto;
}

/* 3. Кнопка закрытия — на уровне модала */
.edit-file-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 32px;
    color: var(--text-dark);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
}

.edit-file-modal__close:hover {
    transform: scale(1.2);
}

/* 4. Заголовок */
.edit-file-modal__title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 20px 0;
    text-align: center;
}

/* 5. Форма — CSS Grid 2 колонки */
.edit-file-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* 6. Поля ввода */
.edit-file-form__input {
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #f0f0f0;
    color: var(--text-dark);
}

.edit-file-form__input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 107, 109, 0.2);
}

.edit-file-form__input::placeholder {
    color: #999;
}

/* Информация о файле — правая колонка строки 2 */
.edit-file-form__info {
    padding: 12px 15px;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 13px;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

/* Выбор иконки — правая колонка строки 1 */
.edit-file-form__icon-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 8px;
}

/* Обёртка превью */
.edit-file-form__icon-preview-box {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-file-form__file-btn {
    flex: 1;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

.edit-file-form__file-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.edit-file-form__preview-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.edit-file-form__preview-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Кнопка Сохранить */
.edit-file-form__submit {
    padding: 15px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-file-form__submit:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Кнопка Удалить */
.edit-file-form__delete {
    padding: 15px 20px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-file-form__delete:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* ========================================== */
/* RESPONSIVE - МОБИЛЬНАЯ АДАПТАЦИЯ           */
/* ========================================== */

/* Первый диапазон: от 880px до 490px */
@media (max-width: 880px) {
    .edit-file-modal {
        padding: 24px 18px;
        border-radius: 10px;
    }

    .edit-file-modal__content {
        width: calc(100% - 40px);
        max-width: 700px;
    }

    .edit-file-modal__close {
        width: 40px;
        height: 40px;
        font-size: 34px;
        top: 10px;
        right: 10px;
    }

    .edit-file-modal__title {
        font-size: 18px;
        margin-bottom: 18px;
    }

    .edit-file-form {
        gap: 12px;
    }

    .edit-file-form__input {
        padding: 13px 16px;
        font-size: 14px;
    }

    .edit-file-form__file-btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    .edit-file-form__submit,
    .edit-file-form__delete {
        padding: 13px 16px;
        font-size: 14px;
    }
}

/* Второй диапазон: от 490px и меньше */
@media (max-width: 490px) {
    .edit-file-modal {
        padding: 18px 12px;
        border-radius: 8px;
    }

    .edit-file-modal__content {
        width: calc(100% - 24px);
        padding-top: 15px;
    }

    .edit-file-modal__close {
        width: 38px;
        height: 38px;
        font-size: 32px;
        top: 8px;
        right: 8px;
    }

    .edit-file-modal__title {
        font-size: 16px;
        margin-bottom: 14px;
    }

    /* Одна колонка на узких экранах */
    .edit-file-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .edit-file-form__input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .edit-file-form__icon-selector {
        padding: 10px 12px;
    }

    .edit-file-form__preview-img,
    .edit-file-form__preview-placeholder {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .edit-file-form__icon-preview-box {
        width: 40px;
        height: 40px;
    }

    .edit-file-form__file-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .edit-file-form__submit,
    .edit-file-form__delete {
        padding: 14px;
        font-size: 15px;
    }
}
