/**
 * Стили для системы управления файлами E2BY
 * Современный дизайн с анимациями и градиентами
 */

/* Основной контейнер */
.file-management-ui {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #ffffff;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}


/* Заголовок */
.ui-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    padding: 0;
    text-align: center;
    color: #94a3b8;
    position: relative;
    z-index: 1;
}

/* Область загрузки */
.upload-area {
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 6px;
    padding: 6px 8px;
    text-align: center;
    margin: 2px 0;
    background: rgba(100, 116, 139, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-size: 12px;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(50, 60, 82, 0.1), transparent);
    transition: left 0.6s;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: rgba(100, 116, 139, 0.5);
    background: rgba(100, 116, 139, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: #94a3b8;
}

.upload-subtitle {
    color: #94a3b8;
    margin: 0 0 4px 0;
    font-size: 0.7rem;
}

.upload-btn {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
}

.upload-btn:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.upload-btn:active {
    transform: translateY(0);
}

/* Вкладки */
.tabs {
    display: flex;
    border-bottom: none;
    margin: 0px -24px 4px -24px;
    padding: 4px 24px 0px 24px;
    gap: 4px;
}

.tab {
    padding: 6px 12px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #9ca3af;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #6b7280;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.tab:hover {
    background: transparent;
    color: #d1d5db;
}

.tab.active {
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    border: none;
}

.tab.active::before {
    transform: translateY(0);
    background: #ffffff;
}

/* Список файлов */
.file-list {
    margin: 4px 0;
    min-height: 0;
    flex: 1;
    overflow-y: visible;
    max-height: none;
}

.empty-message {
    text-align: center;
    color: #a0a9c1;
    font-style: italic;
    margin: 40px 0;
    font-size: 1.1rem;
}

/* Элементы файлов */
.file-item {
    background: rgba(100, 116, 139, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 40px;
}

.file-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #94a3b8;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.file-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(100, 116, 139, 0.4);
    background: rgba(100, 116, 139, 0.15);
}

.file-item:hover::before {
    transform: scaleY(1);
}

.file-item.cancelled {
    opacity: 0.6;
    position: relative;
}

.file-item.cancelled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    z-index: 1;
}

/* Информация о файле */
.file-info {
    flex: 1;
}

.file-name {
    font-size: 0.8rem;
    font-weight: 400;
    margin: 0 0 2px 0;
    color: #94a3b8;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-details p {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
    font-weight: 400;
}

.detail-label {
    font-weight: 400;
    color: #94a3b8;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-reserved {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.status-cancelled {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.cancelled-info {
    color: #dc3545 !important;
    font-weight: 500;
}

/* Действия файла */
.file-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn-primary {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-btn-primary:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.action-btn-secondary {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-btn-secondary:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.action-btn-success {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-btn-success:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.action-btn-danger {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-btn-danger:hover {
    background: rgba(100, 116, 139, 0.3);
    color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Drag & Drop эффекты */
.file-item[draggable="true"] {
    cursor: grab;
}

.file-item[draggable="true"]:active {
    cursor: grabbing;
}

.file-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(0.95);
    z-index: 1000;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.file-item {
    animation: fadeIn 0.5s ease-out;
}

.file-item:nth-child(1) { animation-delay: 0.1s; }
.file-item:nth-child(2) { animation-delay: 0.2s; }
.file-item:nth-child(3) { animation-delay: 0.3s; }
.file-item:nth-child(4) { animation-delay: 0.4s; }
.file-item:nth-child(5) { animation-delay: 0.5s; }

/* Адаптивность */
@media (max-width: 768px) {
    .file-management-ui {
        padding: 16px;
    }
    
    .ui-title {
        font-size: 1.3rem;
        margin: -16px -16px 12px -16px;
        padding: 12px 16px 8px 16px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .upload-area {
        padding: 8px 12px;
    }
    
    .file-details {
        font-size: 0.8rem;
    }
    
    .action-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Скроллбар для файлового менеджера */
.file-management-ui::-webkit-scrollbar,
#fileManagementContainer::-webkit-scrollbar,
.section-content::-webkit-scrollbar {
    width: 8px;
}

.file-management-ui::-webkit-scrollbar-track,
#fileManagementContainer::-webkit-scrollbar-track,
.section-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.file-management-ui::-webkit-scrollbar-thumb,
#fileManagementContainer::-webkit-scrollbar-thumb,
.section-content::-webkit-scrollbar-thumb {
    background: #4facfe;
    border-radius: 4px;
}

.file-management-ui::-webkit-scrollbar-thumb:hover,
#fileManagementContainer::-webkit-scrollbar-thumb:hover,
.section-content::-webkit-scrollbar-thumb:hover {
    background: #00f2fe;
}

/* Дополнительные эффекты */
.upload-area.processing {
    animation: pulse 2s infinite;
}

.file-item.loading {
    pointer-events: none;
    opacity: 0.7;
}

.file-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(79, 172, 254, 0.1), transparent);
    animation: slideIn 1.5s infinite;
}
