/**
 * Modern Download Section Styles
 * Uses theme's primary color via CSS variable
 * Designed to work within theme's .sbox container
 */

/* Files count badge - positioned at top right */
.download-files-count {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 16px;
}

/* Files List */
.download-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* File Item */
.download-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.download-file-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--dl-primary-color, #8b5cf6);
}

/* Left side - file info */
.download-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.download-file-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.download-file-icon i {
    font-size: 16px;
    color: #666;
}

.download-file-details {
    flex: 1;
    min-width: 0;
}

.download-file-name {
    color: #ddd;
    font-size: 0.85rem;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    margin-bottom: 5px;
}

.download-file-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.download-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Resolution badges */
.badge-4k {
    background: #eab308;
    color: #000;
}

.badge-1080p {
    background: var(--dl-primary-color, #3b82f6);
    color: #fff;
}

.badge-720p {
    background: #22c55e;
    color: #fff;
}

.badge-480p {
    background: #6b7280;
    color: #fff;
}

.badge-codec {
    background: rgba(255, 255, 255, 0.1);
    color: #999;
}

.download-file-size {
    color: #777;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Right side - buttons */
.download-file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 16px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.download-btn-watch {
    color: #fff;
    background: var(--dl-primary-color, #8b5cf6);
}

.download-btn-watch:hover {
    filter: brightness(1.15);
    color: #fff;
}

.download-btn-download {
    color: #ccc;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.download-btn-download:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Loading State */
.download-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: #777;
    gap: 10px;
}

.download-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--dl-primary-color, #8b5cf6);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* No Files Message */
.download-no-files {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #777;
}

.download-no-files i {
    font-size: 20px;
    color: #555;
}

/* Error State */
.download-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #fca5a5;
}

/* Responsive */
@media (max-width: 768px) {
    .download-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px;
    }

    .download-file-info {
        width: 100%;
    }

    .download-file-name {
        white-space: normal;
        word-break: break-word;
    }

    .download-file-actions {
        width: 100%;
        margin-left: 0;
    }

    .download-btn {
        flex: 1;
        justify-content: center;
    }
}