/* ========================================
   DOWNLOADS - INTERFACE DE LISTA/PASTAS
   ======================================== */

/* Container principal */
.downloads-container {
    width: 100%;
    min-height: 200px;
}

.downloads-folders-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   CARDS DE PASTAS
   ======================================== */

.folder-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.folder-card:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.folder-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    background: var(--bg);
}

.folder-card.disabled .folder-icon {
    opacity: 0.5;
    filter: grayscale(50%);
}

.folder-card.disabled .folder-arrow {
    opacity: 0.2;
}

.folder-card.disabled .folder-count {
    color: var(--text-secondary);
    opacity: 0.6;
}

.folder-icon {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    transition: all 0.3s ease;
}

.folder-card:hover .folder-icon {
    transform: scale(1.1);
}

.folder-info {
    flex: 1;
}

.folder-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.folder-count {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.folder-size {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.folder-arrow {
    font-size: 2rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.folder-card:hover .folder-arrow {
    transform: translateX(5px);
    color: var(--primary);
}

/* ========================================
   LISTA DE ARQUIVOS
   ======================================== */

.files-list-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ========================================
   ITEM DE ARQUIVO
   ======================================== */

.file-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-item:first-child {
    border-radius: 12px 12px 0 0;
}

.file-item:last-child {
    border-radius: 0 0 12px 12px;
    border-bottom: 1px solid var(--border);
}

.file-item:only-child {
    border-radius: 12px;
    border-bottom: 1px solid var(--border);
}

.file-item:hover {
    background: var(--hover);
    transform: translateX(4px);
}

/* ========================================
   PREVIEW/ÍCONE DO ARQUIVO
   ======================================== */

.file-preview {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 2px solid var(--border);
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon,
.file-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.file-icon i,
.file-icon-fallback i {
    font-size: 1.8rem;
}

.file-ext {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   DETALHES DO ARQUIVO
   ======================================== */

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-size {
    font-weight: 600;
}

.file-date::before {
    content: "•";
    margin-right: 1rem;
}

/* ========================================
   AÇÕES DO ARQUIVO
   ======================================== */

.file-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-action-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--card);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.file-action-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.file-action-btn.delete:hover {
    border-color: #ef4444;
    background: #ef4444;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .folder-card {
        padding: 1rem;
        gap: 1rem;
    }
    
    .folder-icon {
        width: 60px;
        height: 60px;
        min-width: 60px;
        font-size: 2rem;
    }
    
    .folder-name {
        font-size: 1.1rem;
    }
    
    .folder-arrow {
        font-size: 1.5rem;
    }
    
    .file-item {
        padding: 1rem;
        gap: 1rem;
    }
    
    .file-preview {
        width: 50px;
        height: 50px;
        min-width: 50px;
    }
    
    .file-icon i,
    .file-icon-fallback i {
        font-size: 1.5rem;
    }
    
    .file-name {
        font-size: 0.9rem;
    }
    
    .file-meta {
        font-size: 0.8rem;
    }
    
    .file-actions {
        opacity: 1; /* Sempre visível no mobile */
    }
    
    .file-action-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .folder-card {
        flex-wrap: wrap;
    }
    
    .folder-info {
        flex: 1 1 100%;
        order: 3;
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .file-item {
        flex-wrap: wrap;
    }
    
    .file-details {
        flex: 1 1 100%;
        order: 3;
    }
    
    .file-actions {
        order: 4;
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }
}

/* ========================================
   ESTADO VAZIO
   ======================================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    opacity: 0.8;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.folder-card {
    animation: slideIn 0.3s ease-out;
}

.file-item {
    animation: slideIn 0.2s ease-out;
}

.file-item:nth-child(1) { animation-delay: 0.05s; }
.file-item:nth-child(2) { animation-delay: 0.1s; }
.file-item:nth-child(3) { animation-delay: 0.15s; }
.file-item:nth-child(4) { animation-delay: 0.2s; }
.file-item:nth-child(5) { animation-delay: 0.25s; }

/* ========================================
   DARK MODE
   ======================================== */

.dark .folder-card {
    background: var(--card);
    border-color: var(--border);
}

.dark .folder-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.dark .file-item {
    background: var(--card);
    border-color: var(--border);
}

.dark .file-item:hover {
    background: var(--hover);
}

.dark .file-preview {
    background: var(--bg);
    border-color: var(--border);
}

.dark .file-action-btn {
    background: var(--card);
    border-color: var(--border);
}

