/* Professional VideoDownloader CSS */

/* Container and Layout */
.professional-videodownloader-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.header-icon {
    padding: 1rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.header-icon svg {
    width: 3rem;
    height: 3rem;
    color: white;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.platform-badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.platform-badge {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
}

.platform-badge-info {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Main Interface */
.main-interface {
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* URL Input Section */
.url-section {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.input-group {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.url-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.url-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Auto-analysis indicator */
.auto-analysis-indicator {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    color: #0369a1;
    font-weight: 500;
    min-width: 140px;
    justify-content: center;
}

.auto-analysis-indicator.success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #bbf7d0;
    color: #166534;
}

.auto-analysis-indicator.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
    color: #dc2626;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.analyze-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.analyze-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Video Results Section */
.video-results {
    padding: 2rem;
}

/* Video Preview Card */
.video-preview-card {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.video-thumbnail-container {
    position: relative;
    flex-shrink: 0;
}

.video-thumbnail {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-overlay {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.duration-badge, .platform-badge-overlay {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-info {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.separator {
    color: #d1d5db;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 2rem;
    gap: 0.25rem;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #64748b;
}

.tab-btn.active {
    background: white;
    color: #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.tab-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Professional Options */
.professional-options {
    padding: 1.5rem;
    background: #fafbfc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.options-header {
    margin-bottom: 2rem;
    text-align: center;
}

.options-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.options-description {
    color: #64748b;
    font-size: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for simplified layout */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.option-group {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.option-group-full {
    grid-column: 1 / -1; /* Full width */
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.option-icon {
    width: 1rem;
    height: 1rem;
    fill: #3b82f6;
}

.professional-select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
}

.professional-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Advanced Options */
.advanced-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
}

.advanced-toggle:hover {
    background: #f1f5f9;
}

.chevron-icon {
    width: 1rem;
    height: 1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.3s ease;
}

.advanced-toggle.expanded .chevron-icon {
    transform: rotate(180deg);
}

.advanced-panel {
    margin-top: 1rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: none;
}

.advanced-panel.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Download Section */
.download-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.download-preview {
    flex: 1;
}

.preview-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.preview-text {
    font-size: 1rem;
    color: #374151;
    font-weight: 500;
}

.professional-download-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.professional-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.download-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Simple Options (for Video Only and Audio Only tabs) */
.simple-options {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.simple-options h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.simple-options p {
    color: #64748b;
    margin-bottom: 2rem;
}

.simple-select {
    display: block;
    margin: 0 auto 2rem;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    min-width: 250px;
}

.simple-download-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.simple-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Progress Section */
.progress-section {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    animation: fadeInUp 0.3s ease-out; /* Animación de entrada */
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.progress-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.progress-status {
    font-size: 0.875rem;
    color: #64748b;
}

/* REMOVED: Old inline progress bar styles (replaced by floating circular widget)
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 10px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.progress-fill.initializing {
    background: linear-gradient(90deg,
        #10b981 0%,
        #34d399 50%,
        #10b981 100%
    );
    background-size: 200% 100%;
    animation: shimmer-green 1.5s infinite;
}

@keyframes shimmer-green {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pulse animation para cambios de estado */
.progress-status.updating {
    animation: pulse-status 0.5s ease-in-out;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.progress-percent {
    font-weight: 600;
    color: #374151;
    min-width: 3rem;
    text-align: right;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-item {
    display: flex;
    gap: 0.5rem;
}

.detail-label {
    color: #64748b;
    font-size: 0.875rem;
}

.detail-value {
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Success Section */
.success-section {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 16px;
    border: 1px solid #a7f3d0;
    margin-top: 2rem;
}

.success-icon-container {
    margin-bottom: 1.5rem;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    fill: #10b981;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 0.5rem;
}

.success-message {
    color: #047857;
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-link-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.download-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.secondary-btn {
    padding: 1rem 2rem;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Error Section */
.error-section {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-radius: 16px;
    border: 1px solid #fca5a5;
    margin-top: 2rem;
}

.error-icon-container {
    margin-bottom: 1.5rem;
}

.error-icon {
    width: 4rem;
    height: 4rem;
    fill: #dc2626;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.error-message {
    color: #b91c1c;
    margin-bottom: 2rem;
}

.retry-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .professional-videodownloader-container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .main-title {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .video-preview-card {
        flex-direction: column;
    }

    .video-thumbnail {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .download-section {
        flex-direction: column;
        text-align: center;
    }

    .tab-navigation {
        flex-direction: column;
    }

    .success-actions {
        flex-direction: column;
    }

    .progress-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .platform-badges {
        justify-content: center;
    }

    .platform-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Loading States */
.analyze-btn.loading .btn-text::after {
    content: '';
    width: 1rem;
    height: 1rem;
    margin-left: 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    display: inline-block;
    animation: spin 1s linear infinite;
}

.professional-download-btn:disabled,
.simple-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Focus States */
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* File Manager Widget Styles */
.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.file-name {
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.download-file-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.download-file-btn:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

.no-files, .error-files {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.error-files {
    color: #dc2626;
}

/* ==================== REAL-TIME STATUS INDICATOR ==================== */

.realtime-status {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.connection-status {
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.connection-status.bg-green-500 {
    background-color: #10b981 !important;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.connection-status.bg-red-500 {
    background-color: #ef4444 !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.connection-status.bg-yellow-500 {
    background-color: #f59e0b !important;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.connection-text {
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* ==================== REAL-TIME NOTIFICATIONS ==================== */

#realtime-notifications {
    z-index: 1000;
}

#realtime-notifications > div {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#realtime-notifications .bg-green-50 {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

#realtime-notifications .bg-red-50 {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

#realtime-notifications .bg-blue-50 {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

#realtime-notifications .bg-yellow-50 {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* Real-time file counter animations */
.file-counter {
    transition: transform 0.2s ease;
}

.file-counter.updated {
    transform: scale(1.1);
    color: #10b981;
    font-weight: 600;
}

/* Enhanced Real-time Connection Status */
.realtime-status-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.realtime-connection {
    text-align: right;
}

.connection-status {
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 currentColor;
}

.connection-status.animate-pulse {
    animation: pulse-ring 2s infinite;
}

.realtime-activity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeInScale 0.3s ease-out;
}

.activity-indicator {
    position: relative;
    width: 12px;
    height: 12px;
}

.pulse-ring {
    position: absolute;
    border: 2px solid #3b82f6;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: pulse-ring 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

.pulse-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-dot 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

/* Real-time Progress Overlay */
#realtime-progress-overlay {
    transition: all 0.3s ease;
}

#realtime-progress-overlay.show {
    display: flex !important;
}

.realtime-spinner {
    animation: float 3s ease-in-out infinite;
}

.realtime-progress-details > div {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.realtime-progress-details > div:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
}

/* Real-time Notifications */
#realtime-notifications {
    pointer-events: none;
}

#realtime-notifications > div {
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

/* Enhanced Connection Status Colors */
.connection-status.connected {
    background: #10b981 !important;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.connection-status.connecting {
    background: #f59e0b !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.connection-status.disconnected {
    background: #ef4444 !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* Keyframe Animations */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes pulse-dot {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments for real-time elements */
@media (max-width: 768px) {
    .realtime-status-panel {
        padding: 0.75rem;
        align-items: center;
    }

    .realtime-connection {
        text-align: center;
    }

    .connection-text {
        font-size: 0.6875rem;
    }

    #realtime-notifications {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    #realtime-progress-overlay .bg-white {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* ============================================
   PROGRESS BAR ENHANCEMENTS
   ============================================ */

/* Pulse animation for status updates */
.progress-status.pulse {
    animation: pulseAnimation 0.3s ease;
}

@keyframes pulseAnimation {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* REMOVED: Loading shimmer effect for old progress bar
.progress-bar-container.loading {
    position: relative;
    overflow: hidden;
}

.progress-bar-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}
*/

/* Enhanced progress title with icons */
.progress-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Progress details enhancements */
.progress-details {
    animation: fadeIn 0.5s ease-in 0.3s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Success and error section animations */
.success-section,
.error-section {
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   FLOATING CIRCULAR PROGRESS WIDGET
   ============================================ */

.floating-progress-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 120px;
    height: 120px;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.3));
}

.floating-progress-widget:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.4));
}

/* SVG Progress Ring */
.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: rgba(255, 255, 255, 0.95);
    stroke: #e5e7eb;
    stroke-width: 8;
}

.progress-ring-circle {
    fill: none;
    stroke: #3b82f6;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress Content (centered in circle) */
.progress-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.progress-percentage {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 4px;
}

.progress-status-text {
    font-size: 10px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Complete Icon (shows at 100%) */
.complete-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    fill: #10b981;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Widget states - Complete transforms to success message */
.floating-progress-widget.complete {
    width: 300px;
    height: 100px;
    border-radius: 16px;
    background: linear-gradient(135deg, #10b981, #059669);
    animation: transformToComplete 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    transition: all 0.3s ease;
}

@keyframes transformToComplete {
    0% {
        width: 120px;
        height: 120px;
        border-radius: 50%;
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        width: 300px;
        height: 100px;
        border-radius: 16px;
        transform: scale(1);
    }
}

.floating-progress-widget.complete:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}

.floating-progress-widget.complete .progress-ring {
    display: none;
}

.floating-progress-widget.complete .progress-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Complete State Content */
.complete-state {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    width: 100%;
}

.success-checkmark {
    flex-shrink: 0;
    animation: checkmarkPop 0.5s ease;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.complete-text {
    flex: 1;
    text-align: left;
}

.complete-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.complete-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
}

/* Hover effect for complete widget */
.floating-progress-widget.complete::after {
    content: '→';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
}

.floating-progress-widget.complete:hover::after {
    opacity: 1;
    right: 16px;
}

/* Error state */
.floating-progress-widget.error .progress-ring-circle {
    stroke: #ef4444;
}

.floating-progress-widget.error .progress-ring-bg {
    fill: rgba(239, 68, 68, 0.1);
    stroke: #ef4444;
}

/* Pulsing animation for active download */
.floating-progress-widget.active {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        filter: drop-shadow(0 10px 25px rgba(59, 130, 246, 0.3));
    }
    50% {
        filter: drop-shadow(0 10px 35px rgba(59, 130, 246, 0.5));
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .floating-progress-widget {
        width: 100px;
        height: 100px;
        bottom: 16px;
        right: 16px;
    }

    .floating-progress-widget.complete {
        width: 240px;
        height: 70px;
        border-radius: 35px;
    }

    .widget-btn {
        padding: 10px 12px;
        font-size: 10px;
    }

    .widget-btn svg {
        width: 20px;
        height: 20px;
    }

    .widget-btn span {
        font-size: 9px;
    }

    .progress-percentage {
        font-size: 20px;
    }

    .progress-status-text {
        font-size: 8px;
    }

    .complete-icon {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   NOTIFICATION ANIMATIONS
   ============================================ */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}
