/* Стили для загрузчика файлов */
.file-uploader-wrapper {
    margin: 30px 0;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
}

.file-uploader-wrapper h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* Область загрузки */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #007cba;
    background: #f0f7ff;
}

.upload-area.dragover {
    border-color: #007cba;
    background: #e0f0ff;
}

.upload-area.max-files {
    border-color: #ff6b6b;
    background: #fff0f0;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-button {
    background: #2e60a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.upload-button:hover {
    background: #005a87;
}

.upload-button.primary {
    background: #007cba;
}

.upload-button.secondary {
    background: #6c757d;
}

.upload-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.upload-hint {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.max-warning {
    color: #ff6b6b;
    font-weight: bold;
}

/* Прогресс загрузки */
.upload-progress {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}

/* Список файлов */
.uploaded-files h4 {
    margin-bottom: 15px;
    color: #333;
}

.files-list {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s;
}

.file-item.uploading {
    border-left: 4px solid #ffa726;
}

.file-item.uploaded {
    border-left: 4px solid #4caf50;
}

.file-item.error {
    border-left: 4px solid #ff6b6b;
}

.file-handle {
    cursor: move;
    margin-right: 10px;
    color: #999;
}

.file-status {
    margin-right: 12px;
    font-size: 16px;
}

.file-info {
    flex-grow: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.error-msg {
    color: #ff6b6b;
    font-size: 12px;
}

.file-size {
    font-size: 12px;
    color: #666;
	margin-top:2px;
}

.file-progress-container {
    width: 100px;
    margin-right: 15px;
}

.file-progress {
    height: 4px;
    background: #4caf50;
    width: 0%;
    border-radius: 2px;
}

.file-progress-container .progress-text {
    font-size: 11px;
    margin-top: 2px;
    text-align: center;
}

.file-actions {
    display: flex;
    gap: 5px;
}

.file-actions button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 14px;
color:#333;
}

.replace-file:hover {
    background: none;
    border-color: #2e60a6;
}

.remove-file:hover {
    background: #ffebee;
    border-color: #f44336;
}

.upload-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Уведомления */
.upload-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 10000;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.upload-notification.success {
    background: #4caf50;
}

.upload-notification.error {
    background: #f44336;
}

/* Стили для отображения файлов пользователям */
.attached-files-grid,
.attached-files-list {
    margin: 0px 0;
}

.attached-files-grid h3,
.attached-files-list h3 {
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Сетка файлов */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.file-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
    height: 100%;
}

.file-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.file-preview {
    text-align: center;
    margin-bottom: 15px;
}

.file-preview .file-icon {
    border-radius: 5px;
}

.file-details {
    flex-grow: 1;
}

.file-title {
    margin: 0 0 10px 0;
}

.file-title a {
    color: #333;
    text-decoration: none;
}

.file-title a:hover {
    color: #007cba;
}

.file-meta {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.file-actions {
    margin-top: 15px;
}

.download-button {
    display: block;
    text-align: center;
    background: #007cba;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.download-button:hover {
    background: #005a87;
    color: white;
}

/* Список файлов */
.files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s;
}

.file-item:hover {
    background: #f5f5f5;
}

.file-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.file-info .file-icon {
    margin-right: 10px;
width:16px;
}

.file-link {
    color: #2e60a6;
    text-decoration: none;
    font-weight: 500;
}

.file-link:hover {
    color: #007cba;
}

.file-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.file-action {
    margin-left: 15px;
}

.download-link {
    font-size: 18px;
    text-decoration: none;
}

.no-files {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .file-uploader-wrapper {
        padding: 15px;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .file-item {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .file-meta {
        margin-top: 5px;
    }
    
    .file-action {
        align-self: flex-end;
        margin-top: 10px;
    }
}


/* Стили для перетаскивания файлов */
.file-item.ui-sortable-helper {
    transform: rotate(5deg);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    z-index: 1000;
    border: 2px solid #007cba !important;
    background: #e3f2fd !important;
}

.file-item.ui-sortable-placeholder {
    background: #f0f7ff;
    border: 2px dashed #007cba;
    visibility: visible !important;
    height: 60px !important;
    margin: 10px 0;
}

.file-item.ui-sortable-placeholder::before {
    content: "Отпустите здесь";
    color: #007cba;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Анимация при перетаскивании */
.file-item.sortable-dragging {
    cursor: grabbing !important;
}

/* Улучшенные стили для handle перетаскивания */
.file-handle {
    cursor: grab;
    margin-right: 10px;
    color: #999;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.2s;
}

.file-handle:hover {
    background: #f0f0f0;
    color: #007cba;
}

.file-handle:active {
    cursor: grabbing;
    background: #e0e0e0;
}

/* Состояние при перетаскивании всего списка */
.files-list.ui-sortable {
    position: relative;
}

.files-list.sortable-active .file-item {
    transition: transform 0.2s;
}

/* Подсветка области при перетаскивании */
.files-list.sortable-active {
    background: #f8fdff;
    border-radius: 8px;
    padding: 10px;
    transition: background 0.3s;
}

/* Улучшенные стили для загруженных файлов */
.file-item.uploaded {
    border-left: 4px solid #4caf50;
    transition: all 0.3s ease;
    position: relative;
}

.file-item.uploaded:hover {
    background: #f8fff8;
    border-color: #45a049;
    transform: translateX(5px);
}

/* Анимация появления файлов */
.file-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Эффект при наведении на элементы управления */
.file-actions button {
    transition: all 0.2s ease;
    opacity: 0.7;
}

.file-item:hover .file-actions button {
    opacity: 1;
    transform: scale(1.1);
}

/* Улучшенный визуальный feedback при действиях */
.file-item.moving {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #2196f3;
    box-shadow: 0 3px 15px rgba(33, 150, 243, 0.2);
}

/* Стили для мобильного перетаскивания */
@media (max-width: 768px) {
    .file-item.ui-sortable-helper {
        transform: rotate(3deg);
        box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    }
    
    .file-handle {
        padding: 8px;
        font-size: 18px;
    }
}

/* Стили для информации о странице */
.page-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.page-info p {
    margin: 5px 0;
}

.page-id {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.page-info a {
    color: #007cba;
    text-decoration: none;
}

.page-info a:hover {
    text-decoration: underline;
}


/* Стили для редактирования названия */
.title-input {
    border: 1px solid #007cba;
    border-radius: 3px;
    padding: 5px;
    font-size: 14px;
    width: 100%;
}

.title-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.title-actions button {
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 12px;
}

.title-actions button:hover {
    background: #f0f0f0;
}

/* Стили для кнопок действий файлов */
.file-actions {
    display: flex;
    gap: 5px;
}

.file-actions button {
  
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.file-actions button:hover {
    transform: scale(1.1);
}

.edit-title:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}



/* Стили для кнопок просмотра/скачивания */
.view-button, .download-button {
    display: block;
    text-align: center;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
    font-size: 14px;
}

.view-button {
    background: #4caf50;
    color: white;
}

.view-button:hover {
    background: #45a049;
    color: white;
}

.download-button {
    background: #2196f3;
    color: white;
}

.download-button:hover {
    background: #1976d2;
    color: white;
}

.view-link, .download-link {
    font-size: 18px;
    text-decoration: none;
    padding: 5px;
    border-radius: 3px;
}

.view-link:hover {
    background: #e8f5e8;
}

.download-link:hover {
    background: #e3f2fd;
}