/* Progress Container Styles */
.progress-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 9999;
    transform: translateX(calc(100% + 20px));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

.progress-container.visible {
    transform: translateX(0);
    opacity: 1;
}

.progress-container.minimized .progress-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Progress Header */
.progress-header {
    padding: 16px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
}

.progress-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.minimize-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Progress Content */
.progress-content {
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 0;
}

.progress-content::-webkit-scrollbar {
    width: 4px;
}

.progress-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.no-downloads {
    padding: 24px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* Progress Item */
.progress-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
    position: relative;
}

.progress-item:last-child {
    border-bottom: none;
}

.progress-item.status-completed {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.05) 0%, rgba(40, 167, 69, 0.02) 100%);
}

.progress-item.status-failed {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.05) 0%, rgba(220, 53, 69, 0.02) 100%);
}

.progress-item.completed {
    animation: completedPulse 0.6s ease-out;
}

@keyframes completedPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); background-color: rgba(40, 167, 69, 0.1); }
    100% { transform: scale(1); }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Progress Item Header */
.progress-header-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.progress-info {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.progress-thumbnail {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    background: #f0f0f0;
    flex-shrink: 0;
}

.progress-details {
    flex: 1;
    min-width: 0;
}

.progress-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.progress-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.platform-badge, .format-badge, .quality-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.platform-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.platform-youtube { background: #ffebee; color: #d32f2f; }
.platform-tiktok { background: #fce4ec; color: #c2185b; }
.platform-instagram { background: #f3e5f5; color: #7b1fa2; }
.platform-facebook { background: #e8f5e8; color: #388e3c; }
.platform-twitter { background: #e1f5fe; color: #0277bd; }

.format-badge {
    background: #fff3e0;
    color: #f57c00;
}

.quality-badge {
    background: #f1f8e9;
    color: #558b2f;
}

/* Progress Controls */
.progress-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.cancel-btn, .retry-btn, .download-btn, .remove-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 12px;
    text-decoration: none;
}

.cancel-btn {
    color: #dc3545;
}

.cancel-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.05);
}

.retry-btn {
    color: #ffc107;
}

.retry-btn:hover {
    background: rgba(255, 193, 7, 0.1);
    transform: scale(1.05);
}

.download-btn {
    color: #28a745;
}

.download-btn:hover {
    background: rgba(40, 167, 69, 0.1);
    transform: scale(1.05);
}

.remove-btn {
    color: #6c757d;
}

.remove-btn:hover {
    background: rgba(108, 117, 125, 0.1);
    transform: scale(1.05);
}

/* Progress Bar */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 12px 12px;
    animation: progress-stripe 1s linear infinite;
}

@keyframes progress-stripe {
    0% { background-position: 0 0; }
    100% { background-position: 12px 0; }
}

.progress-text {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    min-width: 35px;
    text-align: right;
}

/* Progress Stats */
.progress-stats {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 8px;
    font-size: 11px;
    color: #666;
}

.progress-status {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-speed, .progress-eta, .progress-size {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .progress-container {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        max-width: 360px;
    }
    
    .progress-info {
        gap: 8px;
    }
    
    .progress-thumbnail {
        width: 40px;
        height: 30px;
    }
    
    .progress-title {
        font-size: 13px;
    }
    
    .progress-stats {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .progress-speed, .progress-eta, .progress-size {
        text-align: left;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .progress-container {
        background: rgba(30, 30, 30, 0.95);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    
    .progress-header {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .progress-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .progress-title {
        color: #e0e0e0;
    }
    
    .progress-stats {
        color: #b0b0b0;
    }
    
    .no-downloads {
        color: #999;
    }
    
    .progress-bar {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Completion Animations */
.progress-container.download-completed {
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.2), 0 0 0 2px rgba(34, 197, 94, 0.3);
    animation: completionPulse 0.8s ease-out;
}

.progress-item.completed {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.2);
    animation: completionSlideIn 0.5s ease-out;
}

.progress-item.completed .progress-fill {
    background: linear-gradient(90deg, #22c55e, #16a34a) !important;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.progress-item.completed .progress-status {
    color: #16a34a;
    font-weight: 600;
}

@keyframes completionPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes completionSlideIn {
    0% { 
        transform: translateX(10px); 
        opacity: 0.8; 
    }
    100% { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* Download button styles */
.download-btn {
    background: #22c55e;
    color: white !important;
    border: none;
    border-radius: 6px;
    padding: 6px 8px;
    margin-right: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background: #16a34a;
    transform: translateY(-1px);
}