/* YouTube Thumbnail Downloader - Premium Version */
.yt-downloader-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, #ffffff 0%, #f5f7ff 100%);
    border-radius: 40px;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

/* Subtle animated background pattern */
.yt-downloader-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 0, 0, 0.03) 0%, transparent 30%),
                radial-gradient(circle at 70% 60%, rgba(0, 0, 255, 0.03) 0%, transparent 30%);
    animation: yt-bg-shift 20s infinite alternate;
    z-index: 0;
}

@keyframes yt-bg-shift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, 2%) rotate(1deg); }
}

.yt-downloader-container > * {
    position: relative;
    z-index: 1;
}

.yt-downloader-container h2 {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.yt-subtitle {
    text-align: center;
    color: #475569;
    font-size: 1.25rem;
    margin-bottom: 3rem;
    font-weight: 400;
}

.yt-input-group {
    display: flex;
    gap: 16px;
    max-width: 800px;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 80px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15),
                inset 0 1px 2px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

#yt-url {
    flex: 1;
    padding: 20px 32px;
    border: none;
    border-radius: 60px;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
    color: #1e293b;
    transition: all 0.3s;
}

#yt-url::placeholder {
    color: #94a3b8;
    font-weight: 300;
    letter-spacing: 0.3px;
}

#yt-url:focus {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

#yt-fetch-btn {
    background: linear-gradient(145deg, #ff4d4d, #cc0000);
    color: white;
    border: none;
    border-radius: 60px;
    padding: 0 48px;
    font-weight: 600;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 10px 20px -8px rgba(255, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#yt-fetch-btn:hover {
    background: linear-gradient(145deg, #e63939, #b30000);
    transform: scale(1.02) translateY(-2px);
    box-shadow: 0 20px 30px -10px rgba(255, 0, 0, 0.5);
}

#yt-fetch-btn:active {
    transform: scale(0.98);
}

/* Loading spinner */
.yt-loading {
    text-align: center;
    margin: 50px 0;
}

.yt-spinner {
    display: inline-block;
    width: 56px;
    height: 56px;
    border: 5px solid rgba(0, 0, 0, 0.08);
    border-left-color: #ff0000;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    filter: drop-shadow(0 4px 6px rgba(255,0,0,0.2));
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error message */
.yt-error {
    background: rgba(254, 202, 202, 0.9);
    backdrop-filter: blur(4px);
    color: #991b1b;
    padding: 18px 28px;
    border-radius: 60px;
    margin: 30px auto;
    max-width: 700px;
    text-align: center;
    font-weight: 500;
    border-left: 6px solid #b91c1c;
    box-shadow: 0 10px 20px -10px rgba(185, 28, 28, 0.3);
    font-size: 1.1rem;
}

/* Results grid */
.yt-results {
    margin-top: 60px;
}

.yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.yt-card {
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
}

.yt-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 35px 50px -18px rgba(0, 0, 0, 0.3);
}

.yt-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #e2e8f0;
    display: block;
    transition: transform 0.5s ease;
}

.yt-card:hover img {
    transform: scale(1.05);
}

.yt-card-content {
    padding: 20px 18px 24px;
    text-align: center;
    background: linear-gradient(180deg, white 0%, #fafcff 100%);
}

.yt-card h3 {
    margin: 0 0 8px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.yt-quality {
    display: inline-block;
    background: linear-gradient(145deg, #e0e7ff, #cbd5e1);
    color: #1e293b;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 40px;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.7), 0 4px 6px -4px #0000001a;
}

.yt-download-btn {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 10px 15px -8px #0f172a80;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.yt-download-btn:hover {
    background: linear-gradient(145deg, #2d3b4f, #1a2533);
    transform: scale(1.03);
    box-shadow: 0 16px 20px -10px #0f172a;
}

.yt-download-btn:active {
    transform: scale(0.98);
}

/* Responsive adjustments for full-width container */
@media (max-width: 768px) {
    .yt-downloader-container {
        padding: 2rem 1.5rem;
        border-radius: 28px;
    }
    
    .yt-downloader-container h2 {
        font-size: 2.2rem;
    }
    
    .yt-input-group {
        flex-direction: column;
        border-radius: 40px;
        background: rgba(255, 255, 255, 0.95);
        padding: 12px;
        gap: 12px;
    }
    
    #yt-url {
        padding: 16px 24px;
        background: #f8fafc;
        border-radius: 40px;
    }
    
    #yt-fetch-btn {
        padding: 16px 24px;
        width: 100%;
    }
    
    .yt-grid {
        grid-template-columns: 1fr;
    }
}

/* Optional: smooth font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');