:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-white: #f8fafc;
    --text-dim: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #2dd4bf;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Background Animation */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
    animation: float 20s infinite alternate;
}

@keyframes float {
    from { transform: translate(0, 0); }
    to { transform: translate(20%, 20%); }
}

header {
    width: 100%;
    padding: 2rem 1rem;
    text-align: center;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.container {
    max-width: 900px;
    width: 95%;
    margin-top: 4rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.nav-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-tab.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary-hover);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

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

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

/* Search Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.hero p {
    color: var(--text-dim);
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

.search-box {
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 1.5rem;
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    display: flex;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.25rem 1.5rem;
    color: var(--text-white);
    font-size: 1.1rem;
    outline: none;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--primary-hover);
}

/* Results Area */
.results-container {
    margin-top: 3rem;
    display: none; /* Shown via JS */
}

.card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2rem;
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .card { grid-template-columns: 1fr; gap: 1rem; padding: 1.25rem; text-align: center; }
    .hero h1 { font-size: 2.2rem; }
    .nav-tabs { flex-wrap: wrap; }
    .nav-tab { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
    .info { flex-direction: column; gap: 1rem; }

    /* Responsive Thumbnail */
    .thumbnail {
        width: 140px;
        margin: 0 auto 1rem auto;
        display: block;
    }

    /* Titles and Buttons */
    .info h2 { font-size: 1.1rem; margin-bottom: 1.7rem; text-align: left; } 
    .download-options {
        flex-direction: column;
        width: 100%;
        align-items: center;
        margin-top: 1.5rem;
    }
    .dl-btn { 
        flex-direction: row; 
        justify-content: center;
        gap: 0.5rem; 
        text-align: center; 
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        font-weight: 600;
        width: max-content;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 0.95rem; }
    
    .search-box {
        flex-direction: column;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        gap: 0.75rem;
    }
    
    .search-box input {
        background: var(--card-bg);
        border: 1px solid var(--glass-border);
        border-radius: 1rem;
        padding: 1rem;
        width: 100%;
    }
    
    .search-box button {
        width: 100%;
        padding: 1rem;
        border-radius: 1rem;
    }
    
    .nav-tabs {
        flex-direction: row;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav-tab {
        text-align: center;
        flex: 1;
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }
}

.thumbnail {
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    border-radius: 1rem;
    object-fit: cover;
}

.info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}

.info h2 {
    font-size: 1.35rem;
    margin-bottom: 0;
    line-height: 1.4;
    font-weight: 500;
}

.download-options {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.7rem;
    background: var(--primary);
    border-radius: 0.5rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    transition: background 0.2s;
    width: max-content;
}

.dl-btn:hover {
    background: var(--primary-hover);
}

/* Ads Placeholder */
.ad-unit {
    margin: 3rem 0;
    width: 100%;
    min-height: 100px;
    background: rgba(0,0,0,0.2);
    border: 1px dashed var(--glass-border);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Loading State */
.loader {
    display: none;
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin: 2rem auto;
}

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

@media (prefers-color-scheme: light) {
    :root {
        --bg-dark: #f8fafc;
        --card-bg: rgba(255, 255, 255, 0.85);
        --text-white: #0f172a;
        --text-dim: #475569;
        --glass-border: rgba(0, 0, 0, 0.1);
        --shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.05);
    }

    body {
        background: radial-gradient(circle at top right, #eef2ff, #f8fafc);
    }
    
    body::before {
        background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    }

    .nav-tab {
        background: rgba(0, 0, 0, 0.03);
    }
    
    .nav-tab:hover {
        background: rgba(0, 0, 0, 0.08);
        color: var(--text-white);
    }

    .dl-btn {
        color: #ffffff;
    }
    .ad-unit {
        background: rgba(0, 0, 0, 0.03);
    }
    
    .ad-side {
        background: rgba(0, 0, 0, 0.03);
    }
}

/* Sidebar Ads (Desktop Only) */
.ad-side {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    background: rgba(0,0,0,0.2);
    border: 1px dashed var(--glass-border);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 1rem;
    z-index: 10;
}

.ad-left { left: max(2%, calc((100vw - 1250px) / 2)); }
.ad-right { right: max(2%, calc((100vw - 1250px) / 2)); }

@media (max-width: 1250px) {
    .ad-side { display: none; }
}
