/**
 * Enhanced Media Results CSS
 * Modern, responsive design for video downloader results
 */

/* Main Result Container */
.enhanced-result-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 100%;
    overflow: hidden;
}

/* Header Section */
.result-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .result-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.video-info {
    flex: 1;
}

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

.video-duration {
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 1rem;
}

.video-meta {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.source-badge {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-youtube { background: linear-gradient(135deg, #ff0000, #cc0000); }
.source-instagram { background: linear-gradient(135deg, #e1306c, #c13584); }
.source-tiktok { background: linear-gradient(135deg, #000000, #262626); }
.source-facebook { background: linear-gradient(135deg, #1877f2, #0e5fcc); }
.source-twitter { background: linear-gradient(135deg, #1da1f2, #1a91da); }
.source-vimeo { background: linear-gradient(135deg, #00adef, #0097d7); }

.media-count {
    background: #f8f9fa;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

.thumbnail-container {
    position: relative;
    width: 280px;
    height: 157px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .thumbnail-container {
        width: 100%;
        max-width: 400px;
        height: 225px;
    }
}

.main-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.main-thumbnail:hover {
    transform: scale(1.05);
}

.main-thumbnail.fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 9999;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.3) 100%);
    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;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.preview-btn i {
    color: #007bff;
    font-size: 1.5rem;
}

.thumbnail-placeholder {
    width: 280px;
    height: 157px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 3rem;
}

@media (max-width: 768px) {
    .thumbnail-placeholder {
        width: 100%;
        max-width: 400px;
        height: 225px;
    }
}

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

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

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
}

.section-title i {
    color: #007bff;
}

.section-title .media-count {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

@media (max-width: 768px) {
    .media-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Media Cards */
.media-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.media-card.recommended {
    border-color: #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f8fff8 100%);
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: 15px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Media Info */
.media-info {
    margin-bottom: 1.5rem;
}

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

.quality-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

.media-type {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.media-details {
    margin-bottom: 1rem;
}

.size-info {
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.quality-desc {
    color: #495057;
    font-size: 0.875rem;
    font-style: italic;
}

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

.feature-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.media-card.recommended .feature-tag {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

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

.download-btn,
.preview-btn.secondary-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.download-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.preview-btn.secondary-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.preview-btn.secondary-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* Quick Actions */
.quick-actions-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.quick-actions-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

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

.action-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #495057;
}

.action-btn:hover {
    background: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.action-btn i {
    font-size: 1.25rem;
}

/* Error Container */
.error-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 12px;
    padding: 2rem;
    color: #c53030;
}

.error-icon {
    font-size: 3rem;
    color: #e53e3e;
}

.error-message h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.5rem;
    z-index: 10000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 350px;
}

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

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-info {
    border-left: 4px solid #007bff;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-success i { color: #28a745; }
.toast-error i { color: #dc3545; }
.toast-info i { color: #007bff; }

/* Loading States */
.loading .media-card {
    opacity: 0.6;
    pointer-events: none;
}

.loading .media-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading .media-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

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

/* Responsive Improvements */
@media (max-width: 480px) {
    .enhanced-result-container {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .video-title {
        font-size: 1.25rem;
    }
    
    .media-card {
        padding: 1rem;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark Mode Support */
.dark-mode .enhanced-result-container,
body.dark-mode .enhanced-result-container,
@media (prefers-color-scheme: dark) .enhanced-result-container {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-color: #495057;
    color: #ecf0f1;
}

.dark-mode .video-title,
body.dark-mode .video-title,
@media (prefers-color-scheme: dark) .video-title {
    color: #ecf0f1;
}

.dark-mode .media-card,
body.dark-mode .media-card,
@media (prefers-color-scheme: dark) .media-card {
    background: #34495e;
    border-color: #495057;
    color: #ecf0f1;
}

.dark-mode .media-info,
body.dark-mode .media-info,
@media (prefers-color-scheme: dark) .media-info {
    color: #ecf0f1;
}

.dark-mode .quality-text,
body.dark-mode .quality-text,
@media (prefers-color-scheme: dark) .quality-text {
    color: #ecf0f1;
}

.dark-mode .size-info,
body.dark-mode .size-info,
@media (prefers-color-scheme: dark) .size-info {
    color: #b8c5d1;
}

.dark-mode .quality-desc,
body.dark-mode .quality-desc,
@media (prefers-color-scheme: dark) .quality-desc {
    color: #b8c5d1;
}

.dark-mode .section-title,
body.dark-mode .section-title,
@media (prefers-color-scheme: dark) .section-title {
    color: #ecf0f1;
}

.dark-mode .quick-actions-section,
body.dark-mode .quick-actions-section,
@media (prefers-color-scheme: dark) .quick-actions-section {
    background: #34495e;
    border-color: #495057;
}

.dark-mode .quick-actions-section h3,
body.dark-mode .quick-actions-section h3,
@media (prefers-color-scheme: dark) .quick-actions-section h3 {
    color: #ecf0f1;
}

.dark-mode .action-btn,
body.dark-mode .action-btn,
@media (prefers-color-scheme: dark) .action-btn {
    background: #495057;
    border-color: #6c757d;
    color: #ecf0f1;
}

.dark-mode .action-btn:hover,
body.dark-mode .action-btn:hover,
@media (prefers-color-scheme: dark) .action-btn:hover {
    background: #6c757d;
    border-color: #adb5bd;
    color: #ecf0f1;
}

.dark-mode .feature-tag,
body.dark-mode .feature-tag,
@media (prefers-color-scheme: dark) .feature-tag {
    background: rgba(108, 117, 125, 0.3);
    color: #dee2e6;
}

.dark-mode .media-card.recommended .feature-tag,
body.dark-mode .media-card.recommended .feature-tag,
@media (prefers-color-scheme: dark) .media-card.recommended .feature-tag {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}