/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0a0a0a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.main-content {
    width: 100%;
}

/* Folder Header */
.folder-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #1a1a1a;
}

.folder-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.folder-meta {
    font-size: 0.875rem;
    color: #666;
}

.separator {
    margin: 0 0.5rem;
    color: #333;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #0f0f0f;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: none;
    border: 1px solid #2a2a2a;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    color: #e0e0e0;
    border-color: #444;
}

.filter-btn.active {
    color: #fff;
    background-color: #1a1a1a;
    border-color: #333;
}

.sort-select {
    background-color: #000;
    border: 1px solid #2a2a2a;
    color: #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.sort-select:hover {
    border-color: #444;
}

/* Files Section */
.files-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #1a1a1a;
}

.file-count {
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.page-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.page-link:hover {
    color: #e0e0e0;
}

.page-info {
    color: #666;
}

/* Files List */
.files-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.875rem;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-item:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: #2a2a2a;
}

/* File Preview/Extension */
.file-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 0.75rem;
    background-color: #1a1a1a;
    flex-shrink: 0;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-extension {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    background-color: #1a1a1a;
    color: #666;
    font-size: 0.65rem;
    font-weight: 500;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    flex-shrink: 0;
}

/* File Info */
.file-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-name {
    font-size: 0.9375rem;
    color: #e0e0e0;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.file-meta {
    font-size: 0.8125rem;
    color: #666;
}

.download-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 1.25rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
}

.download-btn:hover {
    color: #e0e0e0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-message {
    font-size: 1.125rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.empty-submessage {
    font-size: 0.875rem;
    color: #444;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .files-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .folder-header {
        margin-bottom: 2rem;
        padding-bottom: 1rem;
    }
    
    .folder-title {
        font-size: 1.5rem;
    }
    
    .filters-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-btn {
        flex: 1;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .files-list {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .file-item {
        padding: 0.75rem;
    }
    
    .file-preview,
    .file-extension {
        width: 40px;
        height: 40px;
    }
    
    .file-name {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .folder-meta {
        font-size: 0.8125rem;
    }
    
    .separator {
        margin: 0 0.25rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8125rem;
    }
    
    .file-preview,
    .file-extension {
        width: 36px;
        height: 36px;
        margin-right: 0.75rem;
    }
    
    .download-btn {
        font-size: 1rem;
    }
}

/* Dark Mode Polish */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #000;
    }
    
    .file-item {
        background-color: #000;
    }
    
    .file-item:hover {
        background-color: #0a0a0a;
    }
}

.folder-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.download-folder-btn {
    padding: 0.6rem 1.2rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 0.4rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
    white-space: nowrap;
}

.download-folder-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

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

.download-folder-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem;
}

.progress-container {
    width: 100%;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background-color: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

@media (max-width: 768px) {
    .folder-header-top {
        flex-direction: column;
    }

    .download-folder-btn {
        width: 100%;
    }
}
