/* YouTube Thumbnail Downloader Styles */
.youtube-thumbnail-downloader {
    max-width: 1000px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.downloader-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

/* Header Section */
.downloader-header {
    background: linear-gradient(135deg, #FF0000, #CC0000, #990000);
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.downloader-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 2;
}

.header-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.header-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 400;
    max-width: 500px;
    margin: 0 auto;
}

/* Input Section */
.input-section {
    padding: 40px;
    background: #f8f9fa;
}

.input-group {
    max-width: 700px;
    margin: 0 auto;
}

.input-container {
    display: flex;
    background: white;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-container:focus-within {
    border-color: #FF0000;
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 0, 0, 0.15);
}

.input-icon {
    padding: 15px 20px;
    color: #FF0000;
    font-size: 1.2rem;
}

.youtube-url-input {
    flex: 1;
    border: none;
    padding: 15px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    background: transparent;
    outline: none;
}

.youtube-url-input::placeholder {
    color: #bdc3c7;
}

.fetch-btn {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.fetch-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
    justify-content: center;
}

.input-hint i {
    color: #FF0000;
}

/* Loading State */
.loading-state {
    padding: 60px 40px;
    text-align: center;
    background: #f8f9fa;
}

.loading-content h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.loading-spinner {
    font-size: 3rem;
    color: #FF0000;
    margin-bottom: 20px;
}

.loading-state p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Results Section */
.results-section {
    padding: 0;
}

.results-header {
    background: white;
    padding: 30px 40px;
    border-bottom: 1px solid #e1e5e9;
}

.results-header h3 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.video-id {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.video-title {
    color: #7f8c8d;
    font-weight: 500;
}

/* Thumbnail Preview Section */
.thumbnail-preview-section {
    padding: 40px;
    background: #f8f9fa;
}

.preview-container {
    max-width: 600px;
    margin: 0 auto;
}

.preview-image {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    background: #2c3e50;
    aspect-ratio: 16 / 9;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.preview-image:hover img {
    transform: scale(1.02);
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.8), rgba(204, 0, 0, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-image:hover .preview-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
}

.overlay-content i {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.overlay-content span {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Qualities Section */
.qualities-section {
    padding: 40px;
    background: white;
    border-bottom: 1px solid #e1e5e9;
}

.qualities-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.qualities-title i {
    color: #FF0000;
}

.qualities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quality-card {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quality-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.quality-card:hover::before {
    left: 100%;
}

.quality-card:hover {
    border-color: #FF0000;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.15);
}

.quality-card.selected {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    border-color: #FF0000;
    color: white;
}

.quality-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    transition: all 0.3s ease;
}

.quality-card.selected .quality-icon {
    background: rgba(255, 255, 255, 0.2);
}

.quality-icon i {
    font-size: 1.5rem;
    color: #FF0000;
    transition: all 0.3s ease;
}

.quality-card.selected .quality-icon i {
    color: white;
}

.quality-label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    display: block;
}

.quality-resolution {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 600;
}

.quality-card.selected .quality-resolution {
    opacity: 0.9;
}

.quality-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Download Section */
.download-section {
    padding: 40px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.download-actions {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.download-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    text-decoration: none;
}

.download-btn.primary {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
}

.download-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.download-btn.secondary {
    background: #2c3e50;
    color: white;
}

.download-btn.secondary:hover {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.3);
}

.download-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.info-item i {
    color: #FF0000;
}

.info-item strong {
    color: #2c3e50;
}

/* Instructions Section */
.instructions-section {
    padding: 40px;
    background: white;
}

.instructions-section h4 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: center;
    justify-content: center;
}

.instructions-section h4 i {
    color: #FF0000;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 800px;
    margin: 0 auto;
}

.instruction-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #FF0000;
    transition: all 0.3s ease;
    text-align: center;
}

.instruction-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.instruction-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FF0000, #CC0000);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 15px;
}

.instruction-content h5 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.instruction-content p {
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0;
    font-size: 0.9rem;
}

/* New Search Section */
.new-search-section {
    padding: 30px 40px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e1e5e9;
}

.new-search-btn {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.new-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

/* Error State */
.error-state {
    padding: 60px 40px;
    text-align: center;
    background: #f8f9fa;
}

.error-content h3 {
    font-size: 1.8rem;
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-icon {
    font-size: 4rem;
    color: #e74c3c;
    margin-bottom: 20px;
}

.error-content p {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-suggestions {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin: 25px auto;
    max-width: 500px;
    text-align: left;
    border-left: 4px solid #e74c3c;
}

.error-suggestions p {
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: 600;
}

.error-suggestions ul {
    color: #7f8c8d;
    padding-left: 20px;
    margin: 0;
}

.error-suggestions li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.retry-btn {
    background: #FF0000;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.retry-btn:hover {
    background: #CC0000;
    transform: translateY(-2px);
}

/* Notification */
.thumbnail-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.thumbnail-notification.show {
    transform: translateX(0);
}

.thumbnail-notification.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Responsive Design */
@media (max-width: 768px) {
    .downloader-container {
        margin: 20px;
    }
    
    .downloader-header {
        padding: 40px 20px;
    }
    
    .header-title {
        font-size: 2rem;
    }
    
    .input-section {
        padding: 30px 20px;
    }
    
    .input-container {
        flex-direction: column;
        gap: 10px;
        padding: 20px;
    }
    
    .input-icon {
        display: none;
    }
    
    .thumbnail-preview-section {
        padding: 30px 20px;
    }
    
    .qualities-section {
        padding: 30px 20px;
    }
    
    .qualities-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .download-section {
        padding: 30px 20px;
    }
    
    .download-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .download-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .instructions-section {
        padding: 30px 20px;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.6rem;
    }
    
    .results-header {
        padding: 20px;
    }
    
    .video-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .qualities-grid {
        grid-template-columns: 1fr;
    }
    
    .download-info {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
}

/* Animation for quality cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quality-card {
    animation: fadeInUp 0.3s ease forwards;
}

/* YouTube Branding */
.youtube-brand {
    color: #FF0000;
}

.quality-card.hd .quality-badge {
    background: #27ae60;
}

.quality-card.hq .quality-badge {
    background: #f39c12;
}

.quality-card.sq .quality-badge {
    background: #3498db;
}