.file-item-container {
    margin: 4px;
}

.files-container {
    margin-top: 5px;
}

.files-description {
    display: block;
    color: #807d7d;
    margin-top: 4px;
}

.file-list-editor {
}

.file-no-items {
    text-align: center;
    display: block;
    font-size: 16px;
    font-style: italic;
    padding: 15px;
}

.files-empty-info {
    font-style: italic;
}

.files-image-collection {
}

    .files-image-collection .file-item-container {
        display: inline-block;
        position: relative;
    }

    .files-image-collection img {
        height: 120px;
        min-width: 80px;
    }

    .files-image-collection .file-description-info {
        display: none;
    }

    .files-image-collection .file-remove-btn {
        position: absolute;
        top: 2px;
        right: 2px;
        color: #ffffff;
        cursor: pointer;
        padding: 5px;
        background: rgba(0, 0, 0, 0.35);
        border-radius: 2px;
    }

    .files-image-collection .file-size-info {
        position: absolute;
        bottom: 2px;
        right: 2px;
        font-size: 11px;
        padding: 2px;
    }

.files-dropzone {
    position: relative;
    min-height: 200px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

    .files-dropzone:not(.readonly):hover {
        border-color: #4299e1;
        background: #ebf8ff;
    }

    .files-dropzone.drag-over {
        border-color: #3182ce;
        background: #bee3f8;
        border-width: 3px;
    }

    .files-dropzone.readonly {
        cursor: default;
        background: white;
        border-style: solid;
    }

/* Empty state */
.empty-state-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.empty-state-content {
    text-align: center;
    padding: 2rem;
}

.upload-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.upload-icon {
    font-size: 4rem;
    color: #a0aec0;
    transition: all 0.3s;
}

.files-dropzone:hover .upload-icon {
    color: #4299e1;
}

.files-dropzone.drag-over .upload-icon {
    color: #3182ce;
    animation: pulse 0.6s infinite;
}

.upload-icon-plus {
    position: absolute;
    bottom: -5px;
    right: -5px;
    font-size: 1.5rem;
    color: #4299e1;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s;
}

.files-dropzone:hover .upload-icon-plus,
.files-dropzone.drag-over .upload-icon-plus {
    opacity: 1;
}

.upload-text-primary {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
    transition: color 0.3s;
}

.files-dropzone:hover .upload-text-primary {
    color: #2b6cb0;
}

.upload-text-secondary {
    font-size: 0.9rem;
    color: #718096;
}

.upload-hint {
    font-size: 0.75rem;
    color: #a0aec0;
    margin-top: 0.5rem;
}

/* File items */
.files-list {
    position: relative;
    z-index: 1;
    padding: 1rem;
}

.file-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

    .file-item:hover {
        border-color: #cbd5e0;
    }

.file-item-content {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.file-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.75rem;
    transition: all 0.2s ease;
}

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

.file-name {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

    .file-name:hover {
        color: #3182ce;
    }

.file-external-icon {
    opacity: 0;
    font-size: 0.85rem;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-external-icon {
    opacity: 0.6;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.25rem;
}

.file-meta-separator {
    opacity: 0.5;
}

.file-size {
    font-weight: 500;
}

.file-description {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Кнопка удаления (не readonly) */
.file-remove-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #a0aec0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

    .file-remove-btn:hover {
        background: #fed7d7;
        color: #c53030;
    }

.file-download-hint {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 1.25rem;
    opacity: 0;
    transition: all 0.2s ease;
}

.file-item-readonly:hover .file-download-hint {
    opacity: 1;
    animation: bounce 0.6s ease;
}

/* Readonly стили */
.file-item-readonly {
    cursor: pointer;
}

    .file-item-readonly:hover {
        background: linear-gradient(to right, #f7fafc, #edf2f7);
    }

/* Image collection */
.images-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.image-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-link {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
}

    .image-link img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

/* Overlay для readonly изображений */
.image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .image-overlay i {
        color: white;
        font-size: 2.5rem;
        transition: transform 0.3s ease;
    }

.image-item-readonly:hover .image-overlay {
    opacity: 1;
}

/* Кнопка удаления изображения */
.image-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 2;
    font-size: 1.1rem;
}

.image-item:hover .image-remove-btn {
    opacity: 1;
}

.image-remove-btn:hover {
    background: #c53030;
}

.image-info {
    padding: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.image-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.image-size {
    display: block;
    font-size: 0.7rem;
    color: #a0aec0;
}

.image-description {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.25rem;
}

/* Анимации */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

/* Readonly dropzone (без drag&drop функционала) */
.files-dropzone.readonly {
    cursor: default;
    background: transparent;
    padding: 0;
    min-height: auto;
}

    .files-dropzone.readonly .files-container {
        padding: 0;
    }

    /* Пустое состояние для readonly */
    .files-dropzone.readonly .empty-state-overlay {
        position: static;
    }

    .files-dropzone.readonly .empty-state-content {
        padding: 2rem;
        text-align: center;
        color: #a0aec0;
    }

/* Add More Card - общие стили */
.add-more-card {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Для файлов */
.files-list .add-more-card {
    background: transparent;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 0;
}

    .files-list .add-more-card .file-item-content {
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 16px;
    }

.add-more-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 10px;
    transition: all 0.2s ease;
}

    .add-more-icon-wrapper i {
        font-size: 24px;
        color: #94a3b8;
        transition: all 0.2s ease;
    }

.add-more-info {
    flex: 1;
}

.add-more-title {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 2px;
    transition: color 0.2s ease;
}

.add-more-hint {
    font-size: 13px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

/* Hover для файлов */
.files-list .add-more-card:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
}

    .files-list .add-more-card:hover .add-more-icon-wrapper {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        transform: scale(1.05);
    }

        .files-list .add-more-card:hover .add-more-icon-wrapper i {
            color: white;
        }

    .files-list .add-more-card:hover .add-more-title {
        color: #667eea;
    }

    .files-list .add-more-card:hover .add-more-hint {
        color: #667eea;
    }

/* Для изображений */
.images-grid .add-more-card {
    background: transparent;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-more-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.images-grid .add-more-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border-radius: 50%;
    transition: all 0.2s ease;
}

    .images-grid .add-more-icon i {
        font-size: 24px;
        color: #94a3b8;
        transition: all 0.2s ease;
    }

.add-more-text {
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.2s ease;
}

/* Hover для изображений */
.images-grid .add-more-card:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
}

    .images-grid .add-more-card:hover .add-more-icon {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        transform: scale(1.1);
    }

        .images-grid .add-more-card:hover .add-more-icon i {
            color: white;
            transform: rotate(90deg);
        }

    .images-grid .add-more-card:hover .add-more-text {
        color: #667eea;
    }

/* Active state */
.add-more-card:active {
    transform: scale(0.98);
}

/* Subtle animation для привлечения внимания */
@keyframes gentle-pulse {
    0%, 100% {
        border-color: #e2e8f0;
    }

    50% {
        border-color: #cbd5e1;
    }
}

.add-more-card {
    animation: gentle-pulse 3s ease-in-out infinite;
}

    .add-more-card:hover {
        animation: none;
    }
