/* --- Root Theme Variables --- */
:root {
    /* Base Color Tokens */
    --bg-base: #060913;
    --bg-surface: rgba(13, 18, 33, 0.7);
    --bg-surface-hover: rgba(22, 30, 54, 0.8);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-hover: rgba(255, 255, 255, 0.12);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Default Brand Accent Colors (Default/Global Downloader) */
    --accent-glow: rgba(0, 242, 254, 0.15);
    --brand-primary: #00f2fe;
    --brand-secondary: #4facfe;
    --brand-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    
    /* Platform Accent Mappings */
    --color-youtube: #ff003c;
    --color-youtube-glow: rgba(255, 0, 60, 0.25);
    --gradient-youtube: linear-gradient(135deg, #ff003c 0%, #ff4b2b 100%);
    
    --color-instagram: #e1306c;
    --color-instagram-glow: rgba(225, 48, 108, 0.25);
    --gradient-instagram: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
    
    --color-tiktok: #fe2c55;
    --color-tiktok-glow: rgba(254, 44, 85, 0.25);
    --gradient-tiktok: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%);
    
    --color-facebook: #1877f2;
    --color-facebook-glow: rgba(24, 119, 242, 0.25);
    --gradient-facebook: linear-gradient(135deg, #1877f2 0%, #00c6ff 100%);
    
    --color-twitter: #1da1f2;
    --color-twitter-glow: rgba(29, 161, 242, 0.25);
    --gradient-twitter: linear-gradient(135deg, #1da1f2 0%, #00e5ff 100%);

    --color-vimeo: #1ab7ea;
    --color-vimeo-glow: rgba(26, 183, 234, 0.25);
    --gradient-vimeo: linear-gradient(135deg, #1ab7ea 0%, #0084b4 100%);

    --color-reddit: #ff4500;
    --color-reddit-glow: rgba(255, 69, 0, 0.25);
    --gradient-reddit: linear-gradient(135deg, #ff4500 0%, #ff8700 100%);

    --color-pinterest: #bd081c;
    --color-pinterest-glow: rgba(189, 8, 28, 0.25);
    --gradient-pinterest: linear-gradient(135deg, #bd081c 0%, #e60023 100%);

    --color-linkedin: #0077b5;
    --color-linkedin-glow: rgba(0, 119, 181, 0.25);
    --gradient-linkedin: linear-gradient(135deg, #0077b5 0%, #00a0dc 100%);
    --color-tumblr: #36465D;
    --color-tumblr-glow: rgba(54, 70, 93, 0.25);
    --gradient-tumblr: linear-gradient(135deg, #36465D 0%, #526B8F 100%);
    
    --color-dailymotion: #0050ff;
    --color-dailymotion-glow: rgba(0, 80, 255, 0.25);
    --gradient-dailymotion: linear-gradient(135deg, #0050ff 0%, #00d2ff 100%);
    
    --color-snapchat: #ffeb3b;
    --color-snapchat-glow: rgba(255, 235, 59, 0.25);
    --gradient-snapchat: linear-gradient(135deg, #ffeb3b 0%, #fbc02d 100%);
    
    /* Shadow Utilities */
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow: 0 0 20px var(--accent-glow);
    
    /* Spacing & Borders */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.75);
    --bg-surface-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-hover: rgba(15, 23, 42, 0.15);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-glow: rgba(79, 172, 254, 0.1);
}

/* --- Base Reset & Setup --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Move scroll-behavior to html only — applying to * forces recalc on every element */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    transition: var(--transition-smooth);
}

/* Glowing Mesh Orbs */
body::before, body::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
    transition: var(--transition-smooth);
}

body::before {
    top: 5%;
    left: -100px;
    background: var(--brand-primary);
}

body::after {
    top: 40%;
    right: -100px;
    background: var(--brand-secondary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* --- Layout Elements --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Frosted Glass Components --- */
.glass-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 18, 33, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}
[data-theme="light"] .glass-navbar {
    background: rgba(255, 255, 255, 0.75);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.4rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.nav-logo-icon {
    font-size: 1.8rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-logo-suffix {
    color: var(--brand-primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0.8;
    color: var(--text-primary);
}

.nav-link:hover {
    opacity: 1;
    color: var(--brand-primary);
}

.nav-link.active {
    opacity: 1;
    color: var(--brand-primary);
    font-weight: 600;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
}

.nav-theme-toggle {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.nav-theme-toggle:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--border-color-hover);
    transform: scale(1.05);
}

/* Mobile Hamburger Toggle */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.nav-mobile-toggle .bar {
    width: 100%;
    height: 2.5px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hamburger toggle active transformation state */
.nav-mobile-toggle.active .bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.nav-mobile-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Sliding Off-Canvas Drawer (Converted to Centered Overlay) */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: rgba(6, 9, 19, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .mobile-drawer {
    background: rgba(241, 245, 249, 0.95);
}

.mobile-drawer.open {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 40px;
}

.mobile-drawer-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.mobile-drawer-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.mobile-nav-link {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.8;
    padding: 12px 0;
    border-bottom: none;
    transition: var(--transition-smooth);
}

[data-theme="light"] .mobile-nav-link {
    border-bottom: none;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    opacity: 1;
    color: var(--brand-primary);
    transform: translateY(-2px);
}

.mobile-drawer-divider {
    display: none;
}

.mobile-drawer-footer {
    margin-top: auto;
    width: 100%;
    padding-top: 20px;
}

.mobile-theme-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

[data-theme="light"] .mobile-theme-btn {
    background: rgba(255, 255, 255, 0.8);
}

.mobile-theme-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
    transform: translateY(-1px);
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

/* --- Interactive Elements & Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    font-family: 'Outfit', sans-serif;
}

.btn-primary {
    background: var(--brand-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5), var(--shadow-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Premium format row download buttons */
.btn-premium-download {
    background: var(--brand-gradient);
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px var(--accent-glow);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.btn-premium-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
    transition: 0.5s;
}

.btn-premium-download:hover::before {
    left: 100%;
}

.btn-premium-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow), 0 0 12px var(--brand-primary);
    border-color: rgba(255, 255, 255, 0.35);
    filter: brightness(1.05);
}

.btn-premium-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* --- Hero Section & Custom Input Grid --- */
.hero-section {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(to right, #fff 20%, var(--brand-secondary) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-theme="light"] .hero-title {
    background: linear-gradient(to right, #0f172a 20%, var(--brand-secondary) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Intelligent Glowing Input Bar */
.downloader-container {
    max-width: 920px;
    margin: 0 auto;
}

.input-glow-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    padding: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.input-glow-wrapper:focus-within {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    background: rgba(255, 255, 255, 0.08);
}

.input-icon-left {
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: var(--transition-smooth);
}

.input-icon-left svg {
    width: 24px;
    height: 24px;
    display: block;
    transition: var(--transition-smooth);
}

.input-icon-left img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.downloader-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 16px 8px;
    font-size: 1.1rem;
    width: 100%;
}
[data-theme="light"] .downloader-input {
    color: #0f172a;
}

.downloader-input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    gap: 8px;
    padding-right: 8px;
}

.btn-paste {
    padding: 10px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-paste:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--brand-primary);
}

/* --- Interactive Skeleton Loader --- */
.loading-skeleton-container {
    display: none;
    margin-top: 32px;
}

.skeleton-pulse {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: loading-pulse-glow 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading-pulse-glow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
}

.skeleton-title {
    height: 28px;
    width: 70%;
    margin: 16px 0 12px;
}

.skeleton-meta {
    height: 16px;
    width: 40%;
    margin-bottom: 24px;
}

.skeleton-btn {
    height: 48px;
    width: 100%;
    margin-bottom: 12px;
}

/* --- Results Panel Styling --- */
.results-card {
    display: none;
    margin-top: 42px;
    text-align: left;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.results-card.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.media-preview-container {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    aspect-ratio: 16/9;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
}

.media-preview-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 60%);
    pointer-events: none;
}

.media-preview-container:hover {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}

.media-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-preview-container:hover .media-thumbnail {
    transform: scale(1.06);
}

.media-duration-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
    line-height: 1.3;
}

.media-platform-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 24px;
}

.platform-badge-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.platform-badge-icon-wrapper svg {
    width: 100%;
    height: 100%;
    display: block;
}

.platform-badge-icon-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: 2px;
}

/* Tabs for Download Options */
.download-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1px;
    margin-bottom: 24px;
}

.tab-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--brand-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

.tab-content-panel {
    display: none;
    animation: fade-in-panel 0.4s ease;
}

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

.tab-content-panel > .format-item {
    margin-bottom: 10px;
}

.tab-content-panel > .format-item:last-child {
    margin-bottom: 0;
}

@keyframes fade-in-panel {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glowing horizontal separator */
.results-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--brand-primary) 50%, transparent 100%);
    opacity: 0.25;
    margin: 16px 0 32px;
    width: 100%;
}

/* Dynamic Format Items Table/List */
.format-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.format-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
}

.format-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

@media (max-width: 576px) {
    .format-item {
        grid-template-columns: 1.5fr 1fr;
        gap: 12px;
    }
    .format-item-size, .format-item-ext {
        display: none;
    }
}

.format-item-quality {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-video {
    background: rgba(0, 242, 254, 0.1);
    color: var(--brand-primary);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.badge-audio {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.format-item-ext {
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.format-item-size {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Playlist Batch Download UI --- */
.playlist-results-card {
    display: none;
    margin-top: 42px;
    text-align: left;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.playlist-results-card.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.playlist-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.playlist-header-info {
    flex: 1;
    min-width: 240px;
}

.playlist-title {
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.playlist-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.playlist-batch-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.playlist-btn-download-all {
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.playlist-btn-download-all::before {
    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;
}

.playlist-btn-download-all:hover::before {
    left: 100%;
}

.playlist-btn-download-all:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Progress Bar */
.playlist-progress-container {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.playlist-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.playlist-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.playlist-progress-bar {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Playlist Video Grid */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

.playlist-grid::-webkit-scrollbar {
    width: 5px;
}

.playlist-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.playlist-grid::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

/* Playlist Item Card */
.playlist-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
}

.playlist-item-card:hover {
    border-color: var(--border-color-hover);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.playlist-item-card.downloaded {
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.playlist-item-card.downloading {
    border-color: var(--brand-primary);
    box-shadow: 0 0 12px var(--accent-glow);
}

.playlist-item-thumb-container {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
}

.playlist-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.playlist-item-card:hover .playlist-item-thumb {
    transform: scale(1.05);
}

.playlist-item-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 50%);
    pointer-events: none;
}

.playlist-item-index {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.playlist-item-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    border-radius: 4px;
}

.playlist-item-body {
    padding: 12px;
}

.playlist-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-item-actions {
    display: flex;
    gap: 8px;
}

.playlist-item-btn {
    flex: 1;
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.playlist-item-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.playlist-item-btn.btn-get-formats {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(0, 242, 254, 0.05);
}

.playlist-item-btn.btn-get-formats:hover {
    background: rgba(0, 242, 254, 0.12);
}

.playlist-item-btn.btn-quick-dl {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
}

.playlist-item-btn.btn-quick-dl:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Expanded Format Panel inside playlist item */
.playlist-item-formats {
    display: none;
    padding: 0 12px 12px;
    animation: fade-in-panel 0.3s ease;
}

.playlist-item-formats.active {
    display: block;
}

.playlist-item-formats .format-item {
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    padding: 8px 12px;
    font-size: 0.82rem;
}

.playlist-item-formats .btn-premium-download {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.playlist-item-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 2;
}

.playlist-item-status.status-done {
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
}

.playlist-item-status.status-loading {
    background: rgba(0, 0, 0, 0.7);
    color: var(--brand-primary);
    animation: spin-loader 1s linear infinite;
}

@keyframes spin-loader {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .playlist-header {
        flex-direction: column;
    }
    .playlist-grid {
        grid-template-columns: 1fr;
        max-height: 500px;
    }
}

/* --- Supported Platforms Grid --- */
.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 52px;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 60px 0;
}

.platform-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: var(--transition-smooth);
    cursor: pointer;
    position: relative; /* Ensure card is positioned to allow z-index layering */
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
    z-index: 10; /* Bring hovered card above all adjacent cards */
}

.platform-card.yt:hover { border-color: var(--color-youtube); box-shadow: 0 8px 30px var(--color-youtube-glow); }
.platform-card.ig:hover { border-color: var(--color-instagram); box-shadow: 0 8px 30px var(--color-instagram-glow); }
.platform-card.tk:hover { border-color: var(--color-tiktok); box-shadow: 0 8px 30px var(--color-tiktok-glow); }
.platform-card.fb:hover { border-color: var(--color-facebook); box-shadow: 0 8px 30px var(--color-facebook-glow); }
.platform-card.tw:hover { border-color: var(--color-twitter); box-shadow: 0 8px 30px var(--color-twitter-glow); }
.platform-card.vm:hover { border-color: var(--color-vimeo); box-shadow: 0 8px 30px var(--color-vimeo-glow); }
.platform-card.rd:hover { border-color: var(--color-reddit); box-shadow: 0 8px 30px var(--color-reddit-glow); }
.platform-card.pr:hover { border-color: var(--color-pinterest); box-shadow: 0 8px 30px var(--color-pinterest-glow); }
.platform-card.li:hover { border-color: var(--color-linkedin); box-shadow: 0 8px 30px var(--color-linkedin-glow); }
.platform-card.tu:hover { border-color: var(--color-tumblr); box-shadow: 0 8px 30px var(--color-tumblr-glow); }
.platform-card.dm:hover { border-color: var(--color-dailymotion); box-shadow: 0 8px 30px var(--color-dailymotion-glow); }
.platform-card.sc:hover { border-color: var(--color-snapchat); box-shadow: 0 8px 30px var(--color-snapchat-glow); }
.platform-card.global-detector:hover { border-color: var(--brand-primary); box-shadow: 0 8px 30px var(--accent-glow); }

.platform-card-icon {
    display: block;
    margin-bottom: 16px;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.platform-card-icon svg {
    width: 38px;
    height: 38px;
    margin: 0 auto;
    display: block;
    transition: var(--transition-smooth);
}

.platform-card.yt:hover .platform-card-icon { color: var(--color-youtube); }
.platform-card.ig:hover .platform-card-icon { color: var(--color-instagram); }
.platform-card.tk:hover .platform-card-icon { color: var(--color-tiktok); }
.platform-card.fb:hover .platform-card-icon { color: var(--color-facebook); }
.platform-card.tw:hover .platform-card-icon { color: var(--color-twitter); }
.platform-card.vm:hover .platform-card-icon { color: var(--color-vimeo); }
.platform-card.rd:hover .platform-card-icon { color: var(--color-reddit); }
.platform-card.pr:hover .platform-card-icon { color: var(--color-pinterest); }
.platform-card.li:hover .platform-card-icon { color: var(--color-linkedin); }
.platform-card.tu:hover .platform-card-icon { color: var(--color-tumblr); }
.platform-card.dm:hover .platform-card-icon { color: var(--color-dailymotion); }
.platform-card.sc:hover .platform-card-icon { color: var(--color-snapchat); }
.platform-card.global-detector:hover .platform-card-icon { color: var(--brand-primary); }

.platform-card h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.platform-card p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* --- FAQ Accordion Section --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

[data-theme="light"] .faq-item {
    background: rgba(255, 255, 255, 0.6);
}

.faq-item:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), var(--shadow-glow);
}

.faq-item.active {
    background: var(--bg-surface-hover);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    user-select: none;
}

.faq-question:hover {
    color: var(--brand-primary);
}

.faq-question-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.faq-badge {
    display: none;
}

[data-theme="light"] .faq-badge {
    display: none;
}

.faq-item:hover .faq-badge {
    display: none;
}

.faq-item.active .faq-badge {
    display: none;
}

.faq-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    transition: var(--transition-smooth);
    flex-shrink: 0;
    color: var(--text-secondary);
}

.faq-item.active .faq-icon {
    transform: rotate(-180deg);
    color: var(--brand-primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    padding-left: 0; /* Aligned beautifully after removing the badge */
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

@media (max-width: 576px) {
    .faq-item {
        padding: 16px;
    }
    .faq-answer {
        padding-left: 0;
    }
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding-top: 12px;
    transition: max-height 0.4s ease-in-out;
}

/* FAQ Dynamic Category Tabs Selector */
.faq-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 32px 0 40px;
}

.faq-category-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

[data-theme="light"] .faq-category-btn {
    background: rgba(255, 255, 255, 0.6);
}

.faq-category-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.faq-category-btn.active {
    background: var(--brand-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* --- AdSense Responsive Ad Grid Card --- */
.ad-slot-container {
    width: 100%;
    margin: 40px auto;
    text-align: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 768px) {
    .ad-placeholder {
        max-width: 320px;
        height: 100px;
    }
}

/* --- Live Toast Alerts System --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: rgba(13, 18, 33, 0.9);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast-success { border: 1px solid #10b981; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15), var(--shadow-soft); }
.toast-error { border: 1px solid #ef4444; box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15), var(--shadow-soft); }
.toast-info { border: 1px solid var(--brand-primary); box-shadow: 0 4px 15px var(--accent-glow), var(--shadow-soft); }

/* --- Dynamic Brand Classes Injection --- */
body.brand-youtube {
    --brand-primary: var(--color-youtube);
    --brand-secondary: #ff4b2b;
    --brand-gradient: var(--gradient-youtube);
    --accent-glow: var(--color-youtube-glow);
}
body.brand-instagram {
    --brand-primary: var(--color-instagram);
    --brand-secondary: #ff5858;
    --brand-gradient: var(--gradient-instagram);
    --accent-glow: var(--color-instagram-glow);
}
body.brand-tiktok {
    --brand-primary: var(--color-tiktok);
    --brand-secondary: #25f4ee;
    --brand-gradient: var(--gradient-tiktok);
    --accent-glow: var(--color-tiktok-glow);
}
body.brand-facebook {
    --brand-primary: var(--color-facebook);
    --brand-secondary: #00c6ff;
    --brand-gradient: var(--gradient-facebook);
    --accent-glow: var(--color-facebook-glow);
}
body.brand-twitter {
    --brand-primary: var(--color-twitter);
    --brand-secondary: #00e5ff;
    --brand-gradient: var(--gradient-twitter);
    --accent-glow: var(--color-twitter-glow);
}
body.brand-vimeo {
    --brand-primary: var(--color-vimeo);
    --brand-secondary: #0084b4;
    --brand-gradient: var(--gradient-vimeo);
    --accent-glow: var(--color-vimeo-glow);
}
body.brand-reddit {
    --brand-primary: var(--color-reddit);
    --brand-secondary: #ff8700;
    --brand-gradient: var(--gradient-reddit);
    --accent-glow: var(--color-reddit-glow);
}
body.brand-pinterest {
    --brand-primary: var(--color-pinterest);
    --brand-secondary: #e60023;
    --brand-gradient: var(--gradient-pinterest);
    --accent-glow: var(--color-pinterest-glow);
}
body.brand-linkedin {
    --brand-primary: var(--color-linkedin);
    --brand-secondary: #00a0dc;
    --brand-gradient: var(--gradient-linkedin);
    --accent-glow: var(--color-linkedin-glow);
}

body.brand-tumblr {
    --brand-primary: var(--color-tumblr);
    --brand-gradient: var(--gradient-tumblr);
    --accent-glow: var(--color-tumblr-glow);
}

body.brand-dailymotion {
    --brand-primary: var(--color-dailymotion);
    --brand-secondary: #00d2ff;
    --brand-gradient: var(--gradient-dailymotion);
    --accent-glow: var(--color-dailymotion-glow);
}

body.brand-youtube::before { background: var(--color-youtube); }
body.brand-youtube .input-glow-wrapper:focus-within { border-color: var(--color-youtube); box-shadow: 0 0 20px var(--color-youtube-glow); }
body.brand-youtube .btn-primary { background: var(--gradient-youtube); box-shadow: 0 4px 15px rgba(255, 0, 60, 0.3); }
body.brand-youtube .tab-btn.active { color: var(--color-youtube); }
body.brand-youtube .tab-btn.active::after { background: var(--gradient-youtube); }

body.brand-instagram::before { background: var(--color-instagram); }
body.brand-instagram .input-glow-wrapper:focus-within { border-color: var(--color-instagram); box-shadow: 0 0 20px var(--color-instagram-glow); }
body.brand-instagram .btn-primary { background: var(--gradient-instagram); box-shadow: 0 4px 15px rgba(225, 48, 108, 0.3); }
body.brand-instagram .tab-btn.active { color: var(--color-instagram); }
body.brand-instagram .tab-btn.active::after { background: var(--gradient-instagram); }

body.brand-tiktok::before { background: var(--color-tiktok); }
body.brand-tiktok .input-glow-wrapper:focus-within { border-color: var(--color-tiktok); box-shadow: 0 0 20px var(--color-tiktok-glow); }
body.brand-tiktok .btn-primary { background: var(--gradient-tiktok); box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3); }
body.brand-tiktok .tab-btn.active { color: var(--color-tiktok); }
body.brand-tiktok .tab-btn.active::after { background: var(--gradient-tiktok); }

body.brand-vimeo::before { background: var(--color-vimeo); }
body.brand-vimeo .input-glow-wrapper:focus-within { border-color: var(--color-vimeo); box-shadow: 0 0 20px var(--color-vimeo-glow); }
body.brand-vimeo .btn-primary { background: var(--gradient-vimeo); box-shadow: 0 4px 15px rgba(26, 183, 234, 0.3); }
body.brand-vimeo .tab-btn.active { color: var(--color-vimeo); }
body.brand-vimeo .tab-btn.active::after { background: var(--gradient-vimeo); }

body.brand-reddit::before { background: var(--color-reddit); }
body.brand-reddit .input-glow-wrapper:focus-within { border-color: var(--color-reddit); box-shadow: 0 0 20px var(--color-reddit-glow); }
body.brand-reddit .btn-primary { background: var(--gradient-reddit); box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3); }
body.brand-reddit .tab-btn.active { color: var(--color-reddit); }
body.brand-reddit .tab-btn.active::after { background: var(--gradient-reddit); }

body.brand-pinterest::before { background: var(--color-pinterest); }
body.brand-pinterest .input-glow-wrapper:focus-within { border-color: var(--color-pinterest); box-shadow: 0 0 20px var(--color-pinterest-glow); }
body.brand-pinterest .btn-primary { background: var(--gradient-pinterest); box-shadow: 0 4px 15px rgba(189, 8, 28, 0.3); }
body.brand-pinterest .tab-btn.active { color: var(--color-pinterest); }
body.brand-pinterest .tab-btn.active::after { background: var(--gradient-pinterest); }

body.brand-linkedin::before { background: var(--color-linkedin); }
body.brand-linkedin .input-glow-wrapper:focus-within { border-color: var(--color-linkedin); box-shadow: 0 0 20px var(--color-linkedin-glow); }
body.brand-linkedin .btn-primary { background: var(--gradient-linkedin); box-shadow: 0 4px 15px rgba(0, 119, 181, 0.3); }
body.brand-linkedin .tab-btn.active { color: var(--color-linkedin); }
body.brand-linkedin .tab-btn.active::after { background: var(--gradient-linkedin); }

body.brand-tumblr::before { background: var(--color-tumblr); }
body.brand-tumblr .input-glow-wrapper:focus-within { border-color: var(--color-tumblr); box-shadow: 0 0 20px var(--color-tumblr-glow); }
body.brand-tumblr .btn-primary { background: var(--gradient-tumblr); box-shadow: 0 4px 15px rgba(54, 70, 93, 0.3); }
body.brand-tumblr .tab-btn.active { color: var(--color-tumblr); }
body.brand-tumblr .tab-btn.active::after { background: var(--gradient-tumblr); }

body.brand-dailymotion::before { background: var(--color-dailymotion); }
body.brand-dailymotion .input-glow-wrapper:focus-within { border-color: var(--color-dailymotion); box-shadow: 0 0 20px var(--color-dailymotion-glow); }
body.brand-dailymotion .btn-primary { background: var(--gradient-dailymotion); box-shadow: 0 4px 15px rgba(0, 80, 255, 0.3); }
body.brand-dailymotion .tab-btn.active { color: var(--color-dailymotion); }
body.brand-dailymotion .tab-btn.active::after { background: var(--gradient-dailymotion); }

body.brand-snapchat::before { background: var(--color-snapchat); }
body.brand-snapchat .input-glow-wrapper:focus-within { border-color: var(--color-snapchat); box-shadow: 0 0 20px var(--color-snapchat-glow); }
body.brand-snapchat .btn-primary { background: var(--gradient-snapchat); color: #000; box-shadow: 0 4px 15px rgba(255, 235, 59, 0.3); }
body.brand-snapchat .tab-btn.active { color: var(--color-snapchat); }
body.brand-snapchat .tab-btn.active::after { background: var(--gradient-snapchat); }

/* --- Subpages Layout Styling --- */
.subpage-hero {
    padding: 60px 0 40px;
    text-align: center;
}
.subpage-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 12px;
}
.subpage-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.rich-content {
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 1.05rem;
}
.rich-content h2, .rich-content h3 {
    color: var(--text-primary);
    margin: 32px 0 16px;
}
.rich-content p {
    margin-bottom: 20px;
}
.rich-content ul, .rich-content ol {
    margin-bottom: 24px;
    padding-left: 24px;
}
.rich-content li {
    margin-bottom: 8px;
}

/* Contact Page Grid Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.8fr;
    gap: 40px;
    margin-bottom: 60px;
}
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
}
.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: #fff;
    font-family: inherit;
    outline: none;
    transition: var(--transition-smooth);
}
[data-theme="light"] .form-control {
    color: #0f172a;
}
.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-glow);
}
textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

/* --- High Responsive & Mobile-First Media Queries --- */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.6rem;
    }
}

@media (max-width: 768px) {
    /* Navbar Mobile Visibility */
    .nav-menu {
        display: none;
    }
    
    .nav-mobile-toggle {
        display: flex;
    }

    /* Hero Typographic Scaling */
    .hero-section {
        padding: 60px 0 40px;
    }
    
    .hero-title {
        font-size: 2.1rem;
        line-height: 1.25;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 28px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        margin-bottom: 36px;
    }

    /* Subpage Layout Scaling */
    .subpage-hero {
        padding: 40px 0 24px;
    }
    
    .subpage-hero h1 {
        font-size: 2.1rem;
    }
}

@media (max-width: 576px) {
    /* Responsive Downloader Console */
    .input-glow-wrapper {
        flex-direction: column;
        padding: 12px;
        align-items: stretch;
        gap: 12px;
        border-radius: var(--radius-lg);
    }
    
    .input-icon-left {
        display: none; /* Hide left icon in stacked mode to conserve spacing */
    }
    
    .downloader-input {
        padding: 8px 4px;
        text-align: center;
        font-size: 1rem;
    }
    
    .input-actions {
        padding-right: 0;
        width: 100%;
        gap: 10px;
    }
    
    .input-actions button, .input-actions .btn {
        flex: 1;
        padding: 14px 10px !important;
        font-size: 0.95rem;
        justify-content: center;
        height: auto;
    }

    /* FAQ accordion styling adjustment */
    .faq-question-text {
        font-size: 0.95rem;
    }
    
    .faq-badge {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}

/* --- Below-the-Fold Paint Optimisation (LCP / FCP Boost) --- */
/* Tells the browser it can skip layout & paint for these sections
   until they are about to enter the viewport. Supported in all
   modern browsers; safely ignored in older ones.              */
/* Disabled content-visibility to prevent containment (contain: paint) clipping the hover transform & shadows */
.platforms-grid {
    content-visibility: visible;
}

.faq-container {
    content-visibility: auto;
    contain-intrinsic-size: 0 600px;
}

footer {
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
}

/* ==========================================================================
   DOWNLOAD PROGRESS MODAL OVERLAY STYLES (GLASSMORPHISM & BRAND-AWARE)
   ========================================================================== */

.download-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(4, 6, 15, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.download-progress-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.progress-modal-card {
    background: rgba(13, 18, 33, 0.75);
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px var(--accent-glow);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    padding: 32px;
    position: relative;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.download-progress-overlay.active .progress-modal-card {
    transform: translateY(0) scale(1);
}

/* Glassmorphism subtle inner glow border */
.progress-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-gradient);
    box-shadow: 0 0 10px var(--brand-primary);
}

.progress-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.progress-modal-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Glassmorphic Media Context Info Card */
.progress-media-context {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    gap: 16px;
    align-items: center;
    text-align: left;
    margin-bottom: 24px;
}

.progress-media-thumb {
    width: 80px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-media-details {
    flex: 1;
    min-width: 0;
}

.progress-media-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.progress-media-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

.progress-media-badge {
    background: var(--brand-gradient);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Pulsing SVG Dual-Ring Spinner */
.progress-spinner-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: rotate-clockwise 2s linear infinite;
}

.progress-spinner-ring.outer {
    border-top-color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.progress-spinner-ring.inner {
    width: 76%;
    height: 76%;
    border-left-color: var(--brand-secondary);
    border-right-color: var(--brand-secondary);
    animation: rotate-counter-clockwise 1.5s linear infinite;
    opacity: 0.8;
}

.progress-spinner-icon {
    font-size: 2rem;
    animation: pulse-scale 2s ease-in-out infinite;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* Linear Progress Bar */
.progress-bar-container {
    width: 100%;
    margin-bottom: 24px;
}

.progress-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--brand-gradient);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.3s ease-out;
}

/* Checklist Steps */
.progress-steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    margin-bottom: 28px;
    padding: 0 4px;
}

.progress-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.progress-step-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.progress-step-item.completed {
    color: var(--text-secondary);
}

.progress-step-bullet {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    position: relative;
    background: transparent;
    transition: var(--transition-smooth);
}

.progress-step-item.active .progress-step-bullet {
    border-color: var(--brand-primary);
    box-shadow: 0 0 8px var(--accent-glow);
}

.progress-step-item.active .progress-step-bullet::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--brand-primary);
    border-radius: 50%;
    animation: pulse-scale 1.2s infinite;
}

.progress-step-item.completed .progress-step-bullet {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* Premium Footers and Background dismissal link */
.progress-modal-footer {
    display: flex;
    justify-content: center;
}

.btn-run-background {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-run-background:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-primary);
    color: var(--text-primary);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: translateY(-1px);
}

/* Animations */
@keyframes rotate-clockwise {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate-counter-clockwise {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

@keyframes pulse-scale {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

[data-theme="light"] .progress-modal-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.15), 0 0 30px var(--accent-glow);
}

[data-theme="light"] .progress-media-context {
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .btn-run-background {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .btn-run-background:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--brand-primary);
    color: var(--text-primary);
}

/* --- Advanced Private Video Settings Panel --- */
.downloader-advanced-settings {
    margin-top: 18px;
    text-align: left;
    width: 100%;
}

.btn-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-settings-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

[data-theme="light"] .btn-settings-toggle {
    background: rgba(0, 0, 0, 0.03);
    color: #475569;
}

[data-theme="light"] .btn-settings-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-settings-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-settings-toggle:hover svg {
    transform: rotate(60deg);
}

.btn-settings-toggle.active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-settings-toggle.active svg {
    transform: rotate(90deg);
}

.settings-content-wrapper {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: scaleY(0.95);
    transform-origin: top;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-content-wrapper.active {
    max-height: 600px;
    opacity: 1;
    transform: scaleY(1);
}

.settings-content-card {
    margin-top: 10px;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .settings-content-card {
    background: rgba(255, 255, 255, 0.4);
}

.settings-content-card::before {
    display: none;
}

.settings-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    display: block;
    letter-spacing: 0.02em;
}

.settings-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(13, 18, 33, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

[data-theme="light"] .settings-select {
    background-color: #fff;
    color: #0f172a;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
}

.settings-select:hover {
    border-color: var(--border-color-hover);
    background-color: rgba(13, 18, 33, 0.95);
}

[data-theme="light"] .settings-select:hover {
    background-color: #f8fafc;
}

.settings-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.settings-helper-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.5;
}

/* --- Draggable Bookmarklet & Trust Badges UI Enhancements --- */
.btn-bookmarklet {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: grab;
    transition: var(--transition-smooth);
    font-family: 'Outfit', sans-serif;
    gap: 8px;
    background: rgba(0, 242, 254, 0.08);
    color: var(--brand-primary);
    border: 1.5px dashed var(--brand-primary);
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.04);
    user-select: none;
    -webkit-user-drag: element;
    text-shadow: 0 0 5px rgba(0, 242, 254, 0.3);
}

.btn-bookmarklet:hover {
    background: rgba(0, 242, 254, 0.16);
    border-style: solid;
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.btn-bookmarklet:active {
    cursor: grabbing;
}

.bookmarklet-tip {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.downloader-trust-badges {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.trust-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    justify-content: center;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition-smooth);
}

.trust-badge:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.trust-badge-icon {
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.trust-badge:hover .trust-badge-icon {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}

.trust-badge-info h4 {
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.trust-badge-info p {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.trust-badge-centered {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.trust-badge-centered .trust-badge {
    max-width: 280px;
    width: 100%;
}

/* Custom platform hover states for Hudl & Patreon */
.platform-card.hd:hover { border-color: #ff5a00; box-shadow: 0 8px 30px rgba(255, 90, 0, 0.2); }
.platform-card.pt:hover { border-color: #ff424d; box-shadow: 0 8px 30px rgba(255, 66, 77, 0.2); }

.platform-card.hd:hover .platform-card-icon { color: #ff5a00; }
.platform-card.pt:hover .platform-card-icon { color: #ff424d; }

/* ==========================================================================
   DOWNLOADER TRUST BADGES OUTSIDE LAYOUT (PREMIUM GRID & GLASSMORPHISM)
   ========================================================================== */

.downloader-trust-badges-outside {
    margin: 32px auto 0;
    max-width: 1200px;
    width: 100%;
    padding: 0;
}

.trust-badges-grid-four {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    justify-content: center;
}

.downloader-trust-badges-outside .trust-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding: 16px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.downloader-trust-badges-outside .trust-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0, 242, 254, 0.12);
}

.downloader-trust-badges-outside .trust-badge-icon {
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.downloader-trust-badges-outside .trust-badge:hover .trust-badge-icon {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.08);
}

.downloader-trust-badges-outside .trust-badge-info h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    white-space: nowrap;
}

.downloader-trust-badges-outside .trust-badge-info p {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Light Theme Overrides for Trust Badges Outside */
[data-theme="light"] .downloader-trust-badges-outside .trust-badge {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .downloader-trust-badges-outside .trust-badge:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .downloader-trust-badges-outside .trust-badge-icon {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .downloader-trust-badges-outside .trust-badge:hover .trust-badge-icon {
    background: rgba(15, 23, 42, 0.04);
}

/* Responsive Grid Adjustments */
@media (max-width: 992px) {
    .trust-badges-grid-four {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .downloader-trust-badges-outside {
        margin-top: 24px;
    }
    
    .trust-badges-grid-four {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .downloader-trust-badges-outside .trust-badge {
        padding: 14px 18px;
    }
}

/* ==========================================================================
   FOOTER RESOURCES AND PLATFORMS NAVIGATION LINK
   ========================================================================== */

.footer-resources-link-wrapper {
    margin-top: 18px;
    padding-top: 6px;
}

.footer-resources-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-primary) !important;
    transition: var(--transition-smooth);
    font-family: 'Outfit', sans-serif;
}

.footer-resources-link:hover {
    color: var(--text-primary) !important;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.footer-resources-link svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-resources-link:hover svg {
    transform: translate(3px, -3px);
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE OVERHAUL  +  CPL / CORE WEB VITALS BOOST
   ========================================================================== */

/* --------------------------------------------------------------------------
   PERFORMANCE: will-change hints for GPU-composited layers
   -------------------------------------------------------------------------- */
.download-progress-overlay { will-change: opacity; }
.progress-modal-card { will-change: transform; }
.progress-spinner-ring { will-change: transform; }
.mobile-drawer { will-change: transform; }
.results-card, .playlist-results-card { will-change: transform, opacity; }

/* --------------------------------------------------------------------------
   PERFORMANCE: Reduce backdrop-filter cost on mobile/touch devices
   -------------------------------------------------------------------------- */
@media (max-width: 768px) and (pointer: coarse) {
    .glass-navbar {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .mobile-drawer {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }
    .glass-card {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(13, 18, 33, 0.92);
    }
    /* Shrink GPU-heavy glow orbs on mobile */
    body::before, body::after {
        filter: blur(70px);
        width: 180px;
        height: 180px;
        opacity: 0.2;
    }
}

/* --------------------------------------------------------------------------
   PERFORMANCE: content-visibility for below-fold sections
   -------------------------------------------------------------------------- */
.platforms-grid {
    content-visibility: auto;
    contain-intrinsic-size: 0 480px;
}

/* --------------------------------------------------------------------------
   CPL: Font rendering optimisations for faster LCP text paint
   -------------------------------------------------------------------------- */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}
h1, h2, h3 { text-rendering: optimizeLegibility; }

/* --------------------------------------------------------------------------
   CPL: Reduce motion for users who prefer-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .progress-bar-fill { transition: width 0.1ms linear !important; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE: 992px — Tablet landscape
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .container { padding: 0 20px; }
    .hero-section { padding: 60px 0 44px; }
    .hero-title { font-size: 2.45rem; }
    .downloader-container { max-width: 100%; }
    .results-grid { grid-template-columns: 1fr 1.6fr; gap: 24px; }
    .trust-badges-grid-four { grid-template-columns: repeat(2, 1fr); }
    .section-title { font-size: 2rem; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE: 768px — Tablet portrait
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Navbar */
    .nav-container { height: 60px; }
    .nav-brand { font-size: 1.2rem; }

    /* Hero */
    .hero-section { padding: 44px 0 32px; }
    .hero-title { font-size: 1.95rem; line-height: 1.22; overflow-wrap: break-word; }
    .hero-subtitle { font-size: 0.97rem; margin-bottom: 22px; padding: 0 8px; }

    /* Cards */
    .glass-card { padding: 22px 18px; }

    /* Results grid — single column */
    .results-grid { grid-template-columns: 1fr; gap: 20px; }
    .media-title { font-size: 1.15rem; }

    /* Section headings */
    .section-title { font-size: 1.75rem; }
    .section-subtitle { font-size: 0.95rem; margin-bottom: 28px; padding: 0 8px; }

    /* Subpage */
    .subpage-hero { padding: 36px 0 20px; }
    .subpage-hero h1 { font-size: 1.9rem; }

    /* Playlist */
    .playlist-header { flex-direction: column; gap: 14px; }
    .playlist-batch-actions { width: 100%; justify-content: stretch; }
    .playlist-batch-actions .btn { flex: 1; }
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        max-height: 480px;
    }

    /* Toast — bottom-center on mobile */
    .toast-container { bottom: 16px; right: 10px; left: 10px; align-items: center; }
    .toast { width: 100%; max-width: 420px; padding: 13px 18px; font-size: 0.9rem; }

    /* Progress modal */
    .progress-modal-card { padding: 24px 18px; width: 95%; }
    .progress-modal-title { font-size: 1.25rem; }
    .progress-spinner-container { width: 70px; height: 70px; margin-bottom: 18px; }

    /* Format table: hide size column */
    .format-item {
        grid-template-columns: 2fr 0.75fr 1.4fr;
        gap: 8px;
        padding: 11px 14px;
    }
    .format-item-size { display: none; }

    /* Platforms grid */
    .platforms-grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
        gap: 12px;
        margin: 36px 0;
    }
    .platform-card { padding: 16px 12px; }
    .platform-card-icon svg { width: 30px; height: 30px; }
    .platform-card h3 { font-size: 0.95rem; }

    /* Trust badges: 2-col on tablet */
    .trust-badges-grid-four { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* Ad slot */
    .ad-slot-container { margin: 24px auto; }
    .ad-placeholder { max-width: 100%; height: auto; min-height: 60px; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE: 576px — Mobile landscape / large phones
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
    .container { padding: 0 14px; }

    /* Hero */
    .hero-section { padding: 32px 0 24px; }
    .hero-title { font-size: 1.7rem; line-height: 1.2; }
    .hero-subtitle { font-size: 0.9rem; margin-bottom: 18px; }

    /* Downloader input bar: vertical stack */
    .input-glow-wrapper {
        flex-direction: column;
        padding: 10px;
        align-items: stretch;
        gap: 8px;
        border-radius: 14px;
    }
    .input-icon-left { display: none; }
    .downloader-input {
        padding: 10px 6px;
        font-size: 0.97rem;
        text-align: left;
    }
    .input-actions {
        padding-right: 0;
        width: 100%;
        gap: 8px;
        display: grid;
        grid-template-columns: auto 1fr 1fr;
    }
    .btn-paste { padding: 12px 13px; flex-shrink: 0; }
    .input-actions .btn {
        padding: 13px 8px !important;
        font-size: 0.88rem;
        justify-content: center;
        white-space: nowrap;
        min-height: 44px;
    }

    /* Glass card */
    .glass-card { padding: 16px 12px; border-radius: var(--radius-md); }

    /* Results */
    .media-title { font-size: 1rem; }
    .media-platform-tag { font-size: 0.78rem; padding: 4px 10px; margin-bottom: 14px; }

    /* Tabs: scrollable horizontal strip */
    .download-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 4px;
        margin-bottom: 16px;
        padding-bottom: 2px;
    }
    .download-tabs::-webkit-scrollbar { display: none; }
    .tab-btn { padding: 8px 10px; font-size: 0.83rem; }

    /* Format rows: 2-column on phone */
    .format-item {
        grid-template-columns: 1fr auto;
        gap: 6px;
        padding: 10px 10px;
    }
    .format-item-ext, .format-item-size { display: none; }
    .format-item-quality { font-size: 0.83rem; gap: 5px; flex-wrap: wrap; }
    .btn-premium-download { padding: 8px 12px; font-size: 0.8rem; min-height: 36px; }

    /* Playlist */
    .playlist-grid { grid-template-columns: 1fr; max-height: 420px; gap: 10px; }
    .playlist-title { font-size: 1.2rem; }
    .playlist-item-btn { min-height: 36px; font-size: 0.74rem; }
    .playlist-header-info { min-width: 0; width: 100%; }
    .playlist-count-badge { font-size: 0.73rem; padding: 3px 10px; }

    /* Section */
    .section-title { font-size: 1.5rem; }

    /* Platforms grid */
    .platforms-grid {
        grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
        gap: 9px;
        margin: 24px 0;
    }
    .platform-card { padding: 14px 10px; }
    .platform-card-icon svg { width: 26px; height: 26px; }
    .platform-card h3 { font-size: 0.88rem; }

    /* Trust badges: single column */
    .trust-badges-grid-four { grid-template-columns: 1fr; gap: 9px; }
    .downloader-trust-badges-outside .trust-badge { padding: 11px 13px; }
    .downloader-trust-badges-outside .trust-badge-info h4 { white-space: normal; font-size: 0.85rem; }
    .downloader-trust-badges-outside .trust-badge-info p { font-size: 0.72rem; }

    /* FAQ */
    .faq-item { padding: 13px 14px; }
    .faq-question { font-size: 0.92rem; }
    .faq-answer { font-size: 0.88rem; }
    .faq-categories { gap: 7px; margin: 18px 0 24px; }
    .faq-category-btn { padding: 7px 13px; font-size: 0.83rem; }

    /* Toast: full-width */
    .toast-container { bottom: 10px; right: 6px; left: 6px; }
    .toast { max-width: 100%; padding: 11px 14px; font-size: 0.86rem; gap: 9px; }

    /* Progress modal */
    .progress-modal-card { padding: 18px 14px; }
    .progress-modal-title { font-size: 1.05rem; margin-bottom: 5px; }
    .progress-modal-subtitle { font-size: 0.8rem; margin-bottom: 16px; }
    .progress-media-context { gap: 9px; padding: 9px; margin-bottom: 16px; }
    .progress-media-thumb { width: 60px; height: 36px; }
    .progress-media-title { font-size: 0.8rem; }
    .progress-media-meta { font-size: 0.7rem; gap: 5px; }
    .progress-spinner-container { width: 58px; height: 58px; margin-bottom: 14px; }
    .progress-steps-list { gap: 7px; margin-bottom: 18px; }
    .progress-step-item { font-size: 0.8rem; gap: 7px; }
    .btn-run-background { padding: 10px 16px; font-size: 0.83rem; width: 100%; justify-content: center; }

    /* Settings */
    .settings-content-card { padding: 13px; }
    .settings-content-wrapper.active { max-height: 1000px; }

    /* Restricted fallback box */
    #restricted-fallback-box { padding: 14px; border-radius: var(--radius-md); }

    /* Extension modal */
    #extension-modal > div {
        width: 95% !important;
        padding: 22px 16px !important;
        border-radius: var(--radius-md) !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Subpage */
    .subpage-hero h1 { font-size: 1.55rem; }
    .subpage-hero p { font-size: 0.93rem; }
    .rich-content { font-size: 0.93rem; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE: 480px — Small phones (iPhone SE, compact Androids)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .hero-title { font-size: 1.5rem; }

    /* 2-col input actions on very small screens */
    .input-actions { grid-template-columns: auto 1fr; }

    /* Hide brand text suffix */
    .nav-brand > span:not(.nav-logo-icon) { display: none; }
    .nav-brand { gap: 5px; }
    .nav-logo-icon { font-size: 1.5rem; }

    /* Batch cards */
    .playlist-item-body { padding: 9px; }
    .playlist-item-title { font-size: 0.8rem; }
    .playlist-batch-actions { flex-direction: column; gap: 7px; }
    .playlist-batch-actions .btn { width: 100%; justify-content: center; }

    /* Section */
    .section-title { font-size: 1.35rem; }

    /* Force 2-column platform grid on very small screens */
    .platforms-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    /* Subpage */
    .subpage-hero h1 { font-size: 1.4rem; }
}

/* --------------------------------------------------------------------------
   TOUCH: Ensure all tap targets meet 44×44 WCAG criterion
   -------------------------------------------------------------------------- */
@media (pointer: coarse) {
    .btn,
    .btn-paste,
    .tab-btn,
    .faq-question,
    .playlist-item-btn,
    .btn-settings-toggle,
    .nav-theme-toggle,
    .btn-premium-download,
    .btn-run-background,
    .faq-category-btn,
    .mobile-nav-link {
        min-height: 44px;
    }
    /* Smooth scrolling containers */
    .playlist-grid {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .download-tabs {
        -webkit-overflow-scrolling: touch;
    }
    /* Disable hover transforms on touch to avoid stuck states */
    .platform-card:hover,
    .faq-item:hover,
    .trust-badge:hover,
    .downloader-trust-badges-outside .trust-badge:hover,
    .btn-premium-download:hover,
    .btn:hover,
    .btn-secondary:hover,
    .format-item:hover {
        transform: none;
        box-shadow: none;
    }
    /* Keep brand-specific button shadows but no lift */
    .btn-primary:hover {
        box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
    }
}

/* ==========================================================================
   MOBILE UX REDESIGN - APP-LIKE RESPONSIVENESS
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    user-select: none;
    white-space: nowrap;
}

.bottom-nav-item svg {
    margin-bottom: 4px;
    transition: var(--transition-smooth);
}

.bottom-nav-item:hover, .bottom-nav-item:active {
    color: var(--text-secondary);
}

.bottom-nav-item.active {
    color: var(--brand-primary);
}

.bottom-nav-item.active svg {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 4px var(--brand-primary-glow));
}

@media (max-width: 768px) {
    /* Enable Bottom Nav */
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* Add padding to body to prevent footer content overlapping */
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    /* Swipeable Trust Badges */
    .trust-badges-grid-four {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding-bottom: 16px; /* Space for scrollbar */
        -webkit-overflow-scrolling: touch;
        scroll-padding: 0 20px;
    }
    
    /* Hide scrollbar for a cleaner look */
    .trust-badges-grid-four::-webkit-scrollbar {
        display: none;
    }
    
    .trust-badge {
        flex: 0 0 85%;
        scroll-snap-align: center;
        margin: 0;
    }

    /* Hero Padding Optimization */
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    .hero-subtitle {
        font-size: 0.95rem !important;
    }
    
    /* Touch target improvements */
    .btn {
        touch-action: manipulation;
        user-select: none;
    }
}

@media (max-width: 576px) {
    /* Input layout full-width for smaller screens */
    .input-glow-wrapper {
        flex-direction: column;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0;
    }
    
    .input-glow-wrapper .downloader-input {
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        width: 100%;
        margin-bottom: 12px;
        font-size: 16px !important; /* Prevent iOS zoom */
        padding-left: 48px;
    }
    
    .input-icon-left {
        top: 28px;
    }
    
    .input-glow-wrapper .input-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .input-glow-wrapper .input-actions .btn-settings-toggle {
        flex: 1;
        justify-content: center;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-color);
        padding: 12px;
    }
    
    .input-glow-wrapper .input-actions .btn-primary {
        flex: 1 1 100%;
        justify-content: center;
        padding: 14px 22px !important;
        font-size: 1.1rem;
        border-radius: 12px;
    }
}
