:root {
    /* Sophisticated HSL Colors */
    --primary-pink: hsl(343, 85%, 52%);
    --primary-cyan: hsl(184, 60%, 62%);
    --primary-cyan-glow: hsla(184, 60%, 62%, 0.3);
    --primary-pink-glow: hsla(343, 85%, 52%, 0.3);

    --bg-dark: #f8fafc;
    --bg-dark-2: #f1f5f9;
    --text-white: #0f172a;
    --text-dim: #475569;

    /* Clean Flat Cards */
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glass-blur: 0px;

    --border-radius: 12px;
    --transition-speed: 0.4s;
    --container-max-width: 1200px;

    /* Animation Easing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Moving Background Blobs */
.blob {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.25;
    animation: moveBlob 40s infinite linear alternate;
}

.blob-1 {
    background: var(--primary-pink);
    top: -100px;
    left: -100px;
}

.blob-2 {
    background: var(--primary-cyan);
    bottom: -150px;
    right: -100px;
    animation-delay: -20s;
}

.blob-3 {
    background: #4f46e5;
    top: 30%;
    left: 40%;
    width: 400px;
    height: 400px;
    animation-duration: 30s;
}

@keyframes moveBlob {
    0% {
        transform: translate(0, 0) scale(1.1);
    }

    33% {
        transform: translate(100px, 50px) scale(0.9);
    }

    66% {
        transform: translate(-50px, 150px) scale(1.05);
    }

    100% {
        transform: translate(50px, -100px) scale(0.95);
    }
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.mini-container {
    max-width: 800px;
}

/* Typography & Modern Gradient Text */
h1 {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    color: var(--text-white);
}

h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 12px;
}

p {
    font-size: 1.15rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.accent-pink {
    color: var(--primary-pink);
    text-shadow: 0 0 30px var(--primary-pink-glow);
}

.accent-cyan {
    color: var(--primary-cyan);
    text-shadow: 0 0 30px var(--primary-cyan-glow);
}

.hidden {
    display: none !important;
}

/* Navbar: Clean Flat Style */
.navbar {
    position: sticky;
    top: 8px;
    z-index: 1000;
    margin: 8px 16px;
    border-radius: 16px;
    padding: 10px 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 10px var(--primary-pink-glow));
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

nav {
    display: flex;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    opacity: 0.7;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--primary-cyan);
}

/* Device Mode Toggle */
.device-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-left: 20px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.toggle-btn.active {
    background: var(--primary-pink);
    color: white;
    box-shadow: 0 4px 15px var(--primary-pink-glow);
}

/* Phone Mode Simulation */
body.phone-mode {
    max-width: 480px;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.1);
    position: relative;
    border-left: 1px solid var(--glass-border);
    border-right: 1px solid var(--glass-border);
}

body.phone-mode .navbar {
    margin: 0;
    border-radius: 0;
    top: 0;
}

body.phone-mode .nav-links {
    display: none;
}

body.phone-mode h1 {
    font-size: 2.2rem;
}

body.phone-mode #video-title {
    font-size: 1rem;
    font-weight: normal;
    word-break: break-all;
}

body.phone-mode .hero {
    padding: 20px 10px;
    min-height: auto;
}

body.phone-mode .input-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 24px !important;
    border-radius: 16px !important;
    background: #f8fafc !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    height: auto !important;
    max-width: 100% !important;
}

body.phone-mode .input-wrapper input {
    width: 100% !important;
    padding: 12px 10px !important;
    text-align: center !important;
    font-size: 1.1rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.phone-mode .btn-primary {
    width: 100% !important;
    padding: 18px !important;
    border-radius: 12px !important;
    font-size: 1.2rem !important;
}

body.phone-mode .video-preview {
    width: 100%;
    max-width: 200px;
}

/* Hero Section: Compact for less scrolling */
.hero {
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 30px 20px 20px;
    position: relative;
}

.hero-content {
    width: 100%;
    max-width: 950px;
    animation: contentReveal 1.2s var(--ease-out);
}

@keyframes contentReveal {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 16px;
    color: var(--text-dim);
}

/* Downloader Form: High Contrast & Interaction */
.downloader-form {
    margin-bottom: 24px;
    position: relative;
}

.input-wrapper {
    display: flex;
    flex-direction: row;
    gap: 12px;
    background: #ffffff;
    border: 2px solid var(--glass-border);
    padding: 10px;
    border-radius: 4px;
    max-width: 850px;
    margin: 0 auto 16px;
    transition: all 0.5s var(--ease-out);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.input-wrapper:focus-within {
    border-color: var(--primary-cyan);
    box-shadow: 0 8px 15px rgba(105, 201, 208, 0.15);
    background: #ffffff;
    transform: scale(1.01);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    padding: 0 32px;
    font-size: 1.25rem;
    font-weight: 500;
}

.input-wrapper input::placeholder {
    color: #9ca3af;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink), #ff5d8e);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 4px;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--primary-pink-glow), 0 0 0 8px rgba(238, 29, 82, 0.05);
    transition: all 0.5s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px var(--primary-pink-glow), 0 0 0 12px rgba(238, 29, 82, 0.1);
}

.url-hint {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

/* Ad Slot System: Fit to Content */
.ad-slot {
    margin: 10px auto;
    width: fit-content;
    max-width: 100%;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

.ad-label {
    display: none;
    /* Hide the text overlay to let the ad shine */
}

.ad-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.ad-top {
    margin-bottom: 24px;
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-bottom {
    margin-top: 8px;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* Trust Badges */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 80px;
    opacity: 0.6;
}

.badge-item {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Result Card Upgrade */
.result-container {
    margin-top: 24px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--glass-shadow);
    transition: all 0.6s var(--ease-out);
}

.result-card {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.result-header {
    display: flex;
    gap: 32px;
    text-align: left;
}

.video-preview {
    width: 140px;
    height: 200px;
    border-radius: 12px;
    background: #f1f5f9;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.play-icon {
    font-size: 2.5rem;
    color: white;
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--primary-pink);
    flex-shrink: 0;
}

#video-title {
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 700;
    margin: 0;
    color: var(--text-white);
}

#author-name {
    font-size: 1rem;
    color: var(--primary-cyan);
    font-weight: 600;
}

.video-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.stat {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 12px;
}

.download-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    width: 100%;
}

.btn-download {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 700;
    padding: 14px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-out);
    background: #f8fafc;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.btn-download:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.no-wm {
    background: linear-gradient(135deg, var(--primary-pink), #ff5d8e);
    color: white;
    box-shadow: 0 4px 10px var(--primary-pink-glow);
}

.wm {
    background: #f1f5f9;
}

.music {
    background: linear-gradient(135deg, #f79c42, #f57c00);
    box-shadow: 0 10px 20px rgba(245, 124, 0, 0.3);
}

.btn-secondary {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: underline;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.btn-secondary:hover {
    opacity: 1;
}

/* Sections: Less Padding */
.section {
    padding: 60px 0;
}

.section-title {
    margin-bottom: 40px;
    font-weight: 800;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.feature-card {
    text-align: left;
    padding: 48px;
    border: 1px solid var(--glass-border);
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 24px;
    display: block;
}

/* Steps Grid Premium Feel */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
}

.step-card {
    text-align: center;
}

.step-num {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-cyan), #3cb7bf);
    color: white;
    font-size: 2.2rem;
    font-weight: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 32px;
    box-shadow: 0 10px 30px var(--primary-cyan-glow);
}

/* FAQ Upgrade */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.faq-item {
    padding: 32px;
    border-radius: 20px;
}

.faq-item h4 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 700;
}

.footer {
    padding: 100px 0 60px;
    background: linear-gradient(to bottom, transparent, #f1f5f9);
    border-top: 1px solid var(--glass-border);
}

.footer-links {
    margin-top: 32px;
    gap: 40px;
}

.footer-links a {
    font-weight: 600;
}

/* Spinner and Progress */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 400px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-pink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px var(--primary-pink-glow);
}

.progress-info {
    width: 100%;
}

#loading-status {
    font-size: 0.95rem;
    color: var(--primary-cyan);
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-pink), var(--primary-cyan));
    transition: width 0.4s ease;
    box-shadow: 0 0 10px var(--primary-pink-glow);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Interstitial Ad Overlay */
.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: none !important;
    border-radius: 0 !important;
}

.ad-modal {
    width: 90%;
    max-width: 500px;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
}

.ad-timer {
    position: absolute;
    top: -25px;
    right: -25px;
    width: 60px;
    height: 60px;
    background: var(--primary-pink);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 0 30px var(--primary-pink-glow);
    border: 4px solid #ffffff;
}

.ad-label-modal {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.ad-placeholder-large {
    width: 100%;
    min-height: 250px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-dim);
}

/* Responsive Overrides */
@media (max-width: 992px) {
    .download-options {
        grid-template-columns: 1fr;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .result-container {
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    :root {
        --border-radius: 16px;
    }

    h1 {
        font-size: 2.2rem;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }

    .navbar {
        margin: 8px;
        padding: 8px 0;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo-icon {
        font-size: 1.4rem;
    }

    .hero {
        padding: 40px 10px;
    }

    /* Mobile Media Query Consolidation */
    @media (max-width: 650px) {
        .hero {
            padding: 40px 10px;
        }

        .input-wrapper {
            flex-direction: column !important;
            border-radius: 32px;
            padding: 24px;
            gap: 20px;
            height: auto !important;
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
            background: rgba(255, 255, 255, 0.08);
        }

        .input-wrapper input {
            padding: 15px 10px;
            text-align: center;
            width: 100%;
            font-size: 1.1rem;
            border-bottom: 2px solid rgba(255, 255, 255, 0.05);
            margin-bottom: 8px;
        }

        .btn-primary {
            width: 100%;
            padding: 18px;
            border-radius: 18px;
            font-size: 1.1rem;
            box-shadow: 0 10px 20px rgba(238, 29, 82, 0.2);
        }
    }

    .ad-slot {
        margin: 25px auto;
        width: 100%;
    }

    .trust-badges {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        margin-bottom: 50px;
    }

    .result-card {
        padding: 24px;
        gap: 25px;
    }

    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    #video-title {
        font-size: 1rem;
        font-weight: normal;
        word-break: break-all;
    }

    .video-preview {
        width: 100%;
        max-width: 260px;
        height: 380px;
    }

    .author-info {
        flex-direction: column;
        gap: 10px;
    }

    .video-stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .steps-grid {
        gap: 32px;
    }

    .blob {
        width: 300px;
        height: 300px;
        opacity: 0.15;
        /* Lighter on mobile for performance */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
    }

    .stat {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .btn-download {
        padding: 16px;
        font-size: 0.85rem;
    }
}