/* ==========================================================================
   DownloadHere - Multi-Platform Video Downloader Styles
   Aesthetic: Cyber Dark Glassmorphism with Vibrant Brand Accents
   ========================================================================== */

:root {
    --bg-dark: #090D16;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(28, 36, 56, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.4);
    
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --accent: #06B6D4;
    --accent-pink: #EC4899;
    
    --text-main: #F8FAFC;
    --text-muted: #CBD5E1;
    --text-dim: #94A3B8;

    /* Platform Brand Colors */
    --c-youtube: #FF0000;
    --c-instagram: #E1306C;
    --c-facebook: #1877F2;
    --c-linkedin: #0A66C2;
    --c-reddit: #FF4500;
    --c-pinterest: #BD081C;
    --c-tiktok: #00F2FE;
    --c-twitter: #1DA1F2;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}

@font-face {
    font-family: 'Plus Jakarta Sans Fallback';
    src: local('Arial'), local('Helvetica');
    ascent-override: 95%;
    descent-override: 25%;
    line-gap-override: 0%;
    size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4, .logo-title {
    font-family: 'Outfit', 'Plus Jakarta Sans Fallback', sans-serif;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Background Ambient Glows */
.glow-bg {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.35;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.glow-1 {
    top: -100px;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.6), transparent 70%);
}
.glow-2 {
    top: 300px;
    right: 10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.5), transparent 70%);
}
.glow-3 {
    top: 800px;
    left: 15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 70%);
}

@media (max-width: 768px) {
    .glow-bg {
        filter: blur(50px);
        opacity: 0.22;
    }
    .glow-1 { width: 280px; height: 280px; }
    .glow-2 { width: 240px; height: 240px; }
    .glow-3 { width: 300px; height: 300px; }
}

/* Header Navbar */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    background: rgba(9, 13, 22, 0.7);
    border-bottom: 1px solid var(--border-color);
    height: 80px;
    contain: layout style;
}
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}
.logo-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}
.brand-text {
    display: flex;
    flex-direction: column;
}
.logo-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}
.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
    color: var(--text-main);
}

.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.theme-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
    contain: layout style;
}
.visitor-counter-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-main);
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 170px;
    justify-content: center;
    flex-shrink: 0;
}
.visitor-counter-badge svg {
    color: var(--primary);
    flex-shrink: 0;
}
.visitor-counter-badge strong {
    color: var(--accent);
}
#todayVisitorCount {
    display: inline-block;
    min-width: 20px;
    text-align: center;
}
.hero-badges-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-pill.visitor-pill {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #10B981;
}
.badge-pill.visitor-pill strong {
    color: #34D399;
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10B981;
    box-shadow: 0 0 10px #10B981;
    flex-shrink: 0;
}
.hero-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.hero-highlight {
    background: linear-gradient(135deg, #FFF, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 36px;
}

/* Platform Filter Chips */
.platform-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    min-height: 44px;
    contain: layout style;
}
.platform-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 8px 18px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    height: 40px;
    flex-shrink: 0;
}
.platform-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}
.platform-chip.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-glow);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}
.p-logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Downloader Input Card */
.downloader-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    max-width: 860px;
    margin: 0 auto 40px;
    transition: var(--transition);
    contain: layout style;
}
.downloader-card:focus-within {
    border-color: var(--border-glow);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.25);
}

.input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 14, 24, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    min-height: 58px;
}
.platform-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    min-width: 125px;
    justify-content: center;
    flex-shrink: 0;
}
.badge-icon {
    width: 16px;
    height: 16px;
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 1.05rem;
    font-family: inherit;
    padding: 8px 4px;
}
.input-group input::placeholder {
    color: var(--text-dim);
}

.clear-btn, .paste-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}
.clear-btn:hover, .paste-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.fetch-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    white-space: nowrap;
}
.fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}
.fetch-btn:active {
    transform: translateY(0);
}

/* Spinner Animation */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.input-hints {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-dim);
    text-align: left;
    padding-left: 8px;
}

/* Skeleton Loading State */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 860px;
    margin: 0 auto 40px;
    display: flex;
    gap: 24px;
}
.skeleton-thumb {
    width: 260px;
    height: 160px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, #182234 25%, #243048 50%, #182234 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.skeleton-line {
    height: 20px;
    border-radius: 6px;
    background: linear-gradient(90deg, #182234 25%, #243048 50%, #182234 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.skeleton-line.long { width: 90%; height: 28px; }
.skeleton-line.short { width: 50%; }
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}
.skeleton-box {
    height: 50px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, #182234 25%, #243048 50%, #182234 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Result Card */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 28px;
    backdrop-filter: blur(20px);
    max-width: 860px;
    margin: 0 auto 40px;
    text-align: left;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    contain: layout style;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    gap: 24px;
}
.result-thumb-wrapper {
    position: relative;
    width: 260px;
    height: 155px;
    aspect-ratio: 16 / 9;
    background-color: #121826;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}
.result-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}
.result-tag-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.result-platform-tag {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.result-uploader {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.result-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--text-main);
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-wrap: break-word;
}
.result-desc {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-wrap: break-word;
}

.card-divider {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Format Downloads Grid */
.format-section .section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.format-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
}
.format-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.format-item {
    background: rgba(10, 14, 24, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: var(--transition);
}
.format-item:hover {
    border-color: var(--border-glow);
    background: rgba(18, 24, 38, 0.9);
    transform: translateY(-2px);
}
.format-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.format-quality {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}
.format-ext-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
}
.format-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-dim);
}

.actions-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.cancel-btn {
    width: 100%;
    margin-top: 8px;
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    white-space: nowrap;
}
.cancel-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #EF4444;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}
.cancel-btn svg {
    flex-shrink: 0;
}

.direct-stream-btn {
    background: rgba(99, 102, 241, 0.15);
    color: #818CF8;
    border: 1px solid rgba(99, 102, 241, 0.35);
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.direct-stream-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: #818CF8;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.download-btn {
    width: 100%;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    border: none;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.download-btn:hover {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}
.download-btn.audio-btn {
    background: linear-gradient(135deg, var(--accent-pink), #BE185D);
}
.download-btn:disabled,
.download-btn.downloading {
    opacity: 0.95;
    cursor: wait;
    transform: none !important;
    box-shadow: none !important;
}

/* Download Progress Bar Overlay */
.download-btn .progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.28);
    transition: width 0.15s ease-out;
    z-index: 0;
    pointer-events: none;
}
.download-btn.downloading.audio-btn .progress-fill {
    background: rgba(255, 255, 255, 0.32);
}
.download-btn span,
.download-btn svg {
    position: relative;
    z-index: 2;
}

/* Error Card */
.error-card {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 860px;
    margin: 0 auto 40px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.error-content {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-wrap: break-word;
}
.error-content h4 {
    color: #F87171;
    margin-bottom: 4px;
}
.error-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Platforms Showcase Cards Section */
.platforms-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}
.section-header {
    text-align: center;
    margin-bottom: 48px;
}
.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.section-header p {
    color: var(--text-muted);
}

.platform-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.p-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.p-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}
.p-card-icon {
    margin-bottom: 16px;
}
.p-card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}
.p-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.p-status {
    font-size: 0.78rem;
    font-weight: 700;
    color: #10B981;
}

/* Features Grid */
.features-section {
    padding: 60px 0 80px;
    border-top: 1px solid var(--border-color);
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
}
.feature-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    transition: var(--transition);
}
.feature-box:hover {
    border-color: var(--border-glow);
}
.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}
.feature-box h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.feature-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Recent Downloads Drawer */
.history-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: #0E1422;
    border-left: 1px solid var(--border-color);
    z-index: 200;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
.history-drawer.open {
    right: 0;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.close-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.history-item {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 12px;
}
.history-thumb {
    width: 70px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}
.history-details {
    flex: 1;
    overflow: hidden;
}
.history-title {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.88rem;
}
.footer-note {
    font-size: 0.78rem;
    margin-top: 4px;
}

/* ==========================================================================
   Mobile-First Responsive Enhancements
   ========================================================================== */

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .platform-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-content {
        height: 64px;
    }

    .logo-title {
        font-size: 1.2rem;
    }

    .logo-tag {
        display: none;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-item {
        display: none;
    }

    .visitor-counter-badge {
        padding: 5px 12px;
        font-size: 0.76rem;
    }

    .hero-section {
        padding: 28px 0 20px;
    }

    .badge-pill {
        font-size: 0.78rem;
        padding: 5px 12px;
    }

    .hero-title {
        font-size: clamp(1.65rem, 5.5vw, 2.2rem);
        line-height: 1.25;
        margin-bottom: 12px;
    }

    .hero-subtitle {
        font-size: 0.92rem;
        margin-bottom: 24px;
        padding: 0 8px;
    }

    /* Swipeable Horizontal Platform Carousel on Mobile */
    .platform-bar {
        display: flex;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px;
        padding: 4px 0 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .platform-bar::-webkit-scrollbar {
        display: none;
    }

    .platform-chip {
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: 0.82rem;
        border-radius: 30px;
    }

    /* Mobile Downloader Form */
    .downloader-card {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
        position: relative;
    }

    .platform-badge {
        align-self: flex-start;
        font-size: 0.78rem;
        padding: 4px 10px;
    }

    .input-group input[type="url"] {
        width: 100%;
        font-size: 16px !important; /* Prevents mobile iOS browser auto-zoom */
        padding: 12px 38px 12px 12px;
        height: 48px;
        border-radius: var(--radius-md);
    }

    .clear-btn {
        right: 18px;
        top: 52px;
    }

    .paste-btn, .fetch-btn {
        width: 100%;
        height: 48px;
        justify-content: center;
        font-size: 0.95rem;
        border-radius: var(--radius-md);
    }

    /* Mobile Result Card */
    .result-card {
        padding: 16px;
        border-radius: var(--radius-lg);
        margin-top: 24px;
    }

    .result-header {
        flex-direction: column;
        gap: 14px;
    }

    .result-thumb-wrapper {
        width: 100%;
        height: 200px;
    }

    .result-title {
        font-size: 1.1rem;
    }

    .result-desc {
        font-size: 0.85rem;
    }

    .format-section h3 {
        font-size: 1rem;
    }

    .format-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .format-item {
        padding: 12px 14px;
    }

    .format-quality {
        font-size: 1rem;
    }

    .download-btn {
        min-height: 48px;
        font-size: 0.9rem;
    }

    /* Sections Mobile Layout */
    .platforms-section {
        padding: 40px 0;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .section-header p {
        font-size: 0.88rem;
    }

    .platform-cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .p-card {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .features-section {
        padding: 40px 0 60px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-box {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    .history-drawer {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .visitor-counter-badge {
        font-size: 0.72rem;
    }

    .visitor-counter-badge svg {
        width: 14px;
        height: 14px;
    }

    .downloader-card {
        padding: 10px;
    }

    .input-group {
        padding: 8px;
    }
}

/* ==========================================================================
   Mobile Floating Rounded Bottom Navbar
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 84px; /* Ensure content is not covered by floating bottom bar */
    }

    .mobile-bottom-nav {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 420px;
        height: 62px;
        background: rgba(14, 20, 34, 0.88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 35px; /* Rounded pill corners */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.25);
        z-index: 999;
        padding: 0 8px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.72rem;
        font-weight: 700;
        padding: 6px 18px;
        border-radius: 24px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }

    .nav-tab svg {
        width: 20px;
        height: 20px;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.25s;
    }

    .nav-tab:hover,
    .nav-tab.active {
        color: #FFFFFF;
        background: rgba(99, 102, 241, 0.18);
    }

    .nav-tab.active svg {
        stroke: var(--accent-pink);
        transform: translateY(-2px) scale(1.12);
    }

    .nav-tab.active::after {
        content: '';
        position: absolute;
        bottom: 3px;
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background-color: var(--accent-pink);
        box-shadow: 0 0 8px var(--accent-pink);
    }
}
