/* Enhanced Media Results UI - Professional Card Layout */

.enhanced-result-container {
    max-width: 1000px;
    margin: 2rem auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* Result Header */
.result-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.video-info {
    flex: 1;
}

.video-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    word-break: break-word;
}

.video-duration {
    display: inline-block;
    background: #3182ce;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.video-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.source-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-youtube { background: #ff0000; color: white; }
.source-tiktok { background: #1ad1f3; color: white; }
.source-instagram { background: #E4405F; color: white; }
.source-facebook { background: #1877f2; color: white; }
.source-vimeo { background: #00adef; color: white; }
.source-twitter { background: #1da1f2; color: white; }
.source-reddit { background: #ff7700; color: white; }
.source-twitch { background: #6441a5; color: white; }

.media-count {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Thumbnail Section */
.thumbnail-section {
    position: relative;
}

.thumbnail-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnail-container:hover {
    transform: scale(1.02);
}

.main-thumbnail {
    width: 200px;
    height: 120px;
    object-fit: cover;
    display: block;
}

.thumbnail-placeholder {
    width: 200px;
    height: 120px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 2rem;
    border-radius: 12px;
}

.thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.thumbnail-container:hover .thumbnail-overlay {
    opacity: 1;
}

.preview-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Media Sections */
.media-sections {
    padding: 2rem;
}

.media-section {
    margin-bottom: 2.5rem;
}

.media-section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-title i {
    color: #3182ce;
}

.media-count {
    background: #3182ce;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: auto;
}

/* Media Grid - Responsive Cards */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1rem;
}

/* Individual Media Cards */
.media-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.media-card:hover {
    border-color: #3182ce;
    box-shadow: 0 8px 25px -10px rgba(49, 130, 206, 0.25);
    transform: translateY(-2px);
}

.media-card.recommended {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}

.media-card.recommended:hover {
    border-color: #059669;
    box-shadow: 0 8px 25px -10px rgba(16, 185, 129, 0.25);
}

.recommended-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Media Card Content Structure */
.media-info {
    margin-bottom: 1.25rem;
}

.quality-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.quality-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.2;
}

.media-type {
    background: #3182ce;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.media-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.size-info {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.quality-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
}

/* Media Actions */
.media-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.download-btn {
    flex: 1;
    background: linear-gradient(135deg, #3182ce 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 44px;
}

.download-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.preview-btn.secondary-btn {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font-size: 0.813rem;
    font-weight: 500;
}

.preview-btn.secondary-btn:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

/* Quality Features */
.quality-features {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.media-card.recommended .feature-tag {
    background: #d1fae5;
    color: #065f46;
}

/* Quick Actions Section */
.quick-actions-section {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
}

.quick-actions-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 1rem 0;
}

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

.action-btn {
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Error Display */
.error-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    margin: 2rem;
}

.error-icon {
    color: #dc2626;
    font-size: 2rem;
}

.error-message h3 {
    color: #dc2626;
    margin: 0 0 0.5rem 0;
}

.error-message p {
    color: #991b1b;
    margin: 0;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-left: 4px solid #64748b;
}

.toast-success .toast-content {
    border-left-color: #10b981;
    color: #065f46;
}

.toast-error .toast-content {
    border-left-color: #dc2626;
    color: #991b1b;
}

.toast-info .toast-content {
    border-left-color: #3182ce;
    color: #1e3a8a;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
    .enhanced-result-container {
        margin: 1rem;
        border-radius: 16px;
    }
    
    .result-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
        text-align: center;
    }
    
    .video-title {
        font-size: 1.25rem;
    }
    
    .thumbnail-container {
        margin: 0 auto;
    }
    
    .media-sections {
        padding: 1.5rem;
    }
    
    .media-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .media-card {
        padding: 1.25rem;
    }
    
    .media-actions {
        flex-direction: column;
    }
    
    .download-btn {
        order: 1;
    }
    
    .preview-btn.secondary-btn {
        order: 2;
    }
    
    .quick-actions-section {
        padding: 1.25rem 1.5rem;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .action-btn {
        font-size: 0.8rem;
        padding: 0.625rem 0.75rem;
    }
    
    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .video-meta {
        justify-content: center;
    }
    
    .quality-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .enhanced-result-container {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568;
    }
    
    .result-header {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-color: #4a5568;
    }
    
    .video-title {
        color: #f7fafc;
    }
    
    .section-title {
        color: #f7fafc;
        border-color: #4a5568;
    }
    
    .media-card {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .media-card:hover {
        border-color: #63b3ed;
        box-shadow: 0 8px 25px -10px rgba(99, 179, 237, 0.25);
    }
    
    .quality-text {
        color: #f7fafc;
    }
    
    .quick-actions-section {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .action-btn {
        background: #1a202c;
        color: #cbd5e0;
        border-color: #4a5568;
    }
    
    .action-btn:hover {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #718096;
    }
}