@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #8b5cf6;
    --primary-dark: #6d28d9;
    --secondary: #3b82f6;
    --accent: #10b981;
    --background: #0f172a;
    --surface: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    background-image: 
        linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)),
        url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
    overflow-x: hidden;
}

.glass-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

input[type="url"] {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.btn-download {
    width: 100%;
    padding: 1.25rem;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
    filter: brightness(1.1);
}

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

.results-area {
    margin-top: 2rem;
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.video-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.preview-placeholder {
    position: absolute;
    z-index: 1;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    pointer-events: none;
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

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

.quality-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quality-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.quality-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.quality-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-message {
    display: none;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

.ad-preview-replacement {
    min-height: 250px;
    background: rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    border-style: solid;
}

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

footer {
    margin-top: auto;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Ad Slots */
.ad-slot {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.5rem 0;
}

.ad-slot img {
    max-width: 100%;
    height: auto;
}

.ad-top {
    min-height: 90px;
    margin-bottom: 2rem;
}

.ad-native {
    min-height: 120px;
    background: rgba(0, 0, 0, 0.2);
}

.ad-bottom {
    min-height: 100px;
    margin-top: 2rem;
}

/* SEO Content Section */
.seo-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.faq-item strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 640px) {
    .glass-card {
        padding: 2rem 1.5rem;
    }
    h1 {
        font-size: 2rem;
    }
    .seo-content h2 {
        font-size: 1.5rem;
    }
}
