/* Default Theme Variables: Light Mode First */
:root {
    --bg-main: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(203, 213, 225, 0.8);
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    --accent-blue: #0284c7;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #0f172a;
    --input-placeholder: #94a3b8;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 4px 15px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.08);
    --item-bg: rgba(241, 245, 249, 0.8);
}

/* Dark Theme Overrides */
html[data-theme="dark"] {
    --bg-main: #0b0f19;
    --card-bg: rgba(20, 28, 46, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary-gradient: linear-gradient(135deg, #00F2FE 0%, #4FACFE 100%);
    --accent-blue: #00F2FE;
    --input-bg: rgba(11, 15, 25, 0.8);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-text: #ffffff;
    --input-placeholder: #6b7280;
    --nav-bg: rgba(11, 15, 25, 0.85);
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.4);
    --item-bg: rgba(255, 255, 255, 0.04);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Blockchain Dynamic Mesh Canvas */
.blockchain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.65;
}

/* Background Glow Effect */
.background-glow {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.2;
    pointer-events: none;
}
.glow-1 {
    top: -100px;
    left: -100px;
    background: #0284c7;
}
.glow-2 {
    bottom: 50px;
    right: -100px;
    background: #7f56d9;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    padding: 14px 0;
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.brand {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.3);
}
.brand-accent {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: rgba(2, 132, 199, 0.1) !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
    color: var(--accent-blue) !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.25s ease !important;
    min-height: 36px !important;
    white-space: nowrap !important;
}
.theme-toggle-btn:hover {
    background: rgba(2, 132, 199, 0.2) !important;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.2) !important;
}

/* Language Switcher */
.lang-btn {
    background: rgba(2, 132, 199, 0.1) !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
    color: var(--accent-blue) !important;
    padding: 6px 14px !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.25s ease !important;
    min-height: 36px !important;
    white-space: nowrap !important;
}
.lang-btn:hover {
    background: rgba(2, 132, 199, 0.2) !important;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.2) !important;
}

/* Main Content */
.main-content {
    flex: 1;
    padding-top: 40px;
    padding-bottom: 60px;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 35px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-blue);
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.25);
    padding: 6px 16px;
    border-radius: 30px;
    margin-bottom: 20px;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-blue);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
    color: var(--text-main);
}
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 650px;
    margin: 0 auto 25px;
    line-height: 1.6;
    font-weight: 400;
}

/* Platform Badges */
.platform-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.platform-pill {
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--item-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.platform-pill:hover, .platform-pill.active {
    background: rgba(2, 132, 199, 0.12);
    color: var(--text-main);
}
.platform-pill.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.18);
}

/* Downloader Card */
.downloader-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 6px;
    gap: 10px;
    transition: border-color 0.3s ease;
}
.input-wrapper:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.2);
}
.input-icon {
    padding-left: 15px;
    font-size: 1.2rem;
    color: var(--text-muted);
}
.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--input-text);
    font-size: 1rem;
    padding: 12px 5px;
    font-weight: 500;
}
.input-wrapper input::placeholder {
    color: var(--input-placeholder);
}

.button-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.paste-btn, .submit-btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-weight: 600;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    min-height: 44px;
}
.paste-btn {
    background: var(--item-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
    padding: 12px 18px;
}
.paste-btn:hover {
    background: rgba(2, 132, 199, 0.1);
}
.submit-btn {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 12px 26px;
    font-size: 1rem;
    font-weight: 700;
}
.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 20px rgba(2, 132, 199, 0.35);
}

/* Alert Banner */
.error-alert {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
}
.hidden {
    display: none !important;
}

/* Loader */
.loader-container {
    text-align: center;
    padding: 40px 0;
}
.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(2, 132, 199, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 15px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result Card */
.result-card {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--card-border);
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-preview-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 25px;
}
.thumbnail-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-border);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.duration-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.platform-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 8px;
}
.video-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-main);
}
.video-author {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.qualities-header {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-main);
}
.qualities-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.quality-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--item-bg);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    gap: 10px;
}
.quality-item.thumb-item {
    border-color: rgba(2, 132, 199, 0.3);
    background: rgba(2, 132, 199, 0.06);
}
.quality-label {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}
.ext-badge {
    background: rgba(2, 132, 199, 0.15);
    color: var(--accent-blue);
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}
.dl-link-btn {
    background: var(--primary-gradient);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.dl-link-btn:hover {
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 24px;
    border-radius: var(--radius-md);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-sm);
}
.feature-card:hover {
    transform: translateY(-3px);
}
.feature-icon {
    font-size: 1.8rem;
    color: var(--accent-blue);
    margin-bottom: 12px;
}
.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 700;
}
.feature-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Visitor Counter & Traffic Analytics Section */
.analytics-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    backdrop-filter: blur(15px);
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}
.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 16px;
    margin-bottom: 24px;
}
.analytics-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}
.analytics-title i {
    color: var(--accent-blue);
}
.live-status-pill {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.live-pulse {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: livePulse 1.2s infinite;
}
@keyframes livePulse {
    0% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.3; transform: scale(0.9); }
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}
.metric-box {
    background: var(--item-bg);
    border: 1px solid var(--card-border);
    padding: 18px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 16px;
}
.metric-icon {
    font-size: 1.6rem;
    color: var(--accent-blue);
    background: rgba(2, 132, 199, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.metric-data {
    display: flex;
    flex-direction: column;
}
.metric-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}
.metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.countries-wrapper {
    background: var(--item-bg);
    border: 1px solid var(--card-border);
    padding: 18px;
    border-radius: var(--radius-md);
}
.countries-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.country-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.country-chip {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
    font-weight: 600;
}
.flag-icon {
    font-size: 1.1rem;
}
.country-percent {
    font-weight: 700;
    color: var(--accent-blue);
    font-size: 0.8rem;
    margin-left: 4px;
}

/* FAQ Section */
.faq-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 35px 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}
.faq-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-main);
}
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}
.faq-item {
    background: var(--item-bg);
    border: 1px solid var(--card-border);
    padding: 20px;
    border-radius: var(--radius-md);
}
.faq-item h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.faq-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Footer */
.footer {
    padding: 25px 0;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.88rem;
    background: var(--nav-bg);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}
.footer-link:hover {
    text-decoration: underline;
}

.version-badge {
    background: rgba(2, 132, 199, 0.1);
    border: 1px solid rgba(2, 132, 199, 0.25);
    color: var(--accent-blue);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- 100% Mobile Responsive Styles --- */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    .main-content {
        padding-top: 25px;
        padding-bottom: 40px;
    }
    .hero-title {
        font-size: 1.85rem;
    }
    .hero-subtitle {
        font-size: 0.95rem;
    }
    .downloader-card {
        padding: 20px 16px;
    }
    .input-wrapper {
        flex-direction: column;
        align-items: stretch;
        background: transparent;
        border: none;
        padding: 0;
        gap: 12px;
    }
    .input-wrapper:focus-within {
        border-color: transparent;
        box-shadow: none;
    }
    .input-wrapper input {
        background: var(--input-bg);
        border: 1px solid var(--input-border);
        border-radius: var(--radius-md);
        padding: 14px 16px;
        font-size: 0.95rem;
        width: 100%;
    }
    .input-wrapper input:focus {
        border-color: var(--accent-blue);
    }
    .input-icon {
        display: none;
    }
    .button-group {
        width: 100%;
        gap: 10px;
    }
    .paste-btn {
        flex: 1;
        justify-content: center;
        border-radius: var(--radius-md);
    }
    .submit-btn {
        flex: 2;
        justify-content: center;
        border-radius: var(--radius-md);
    }
    .video-preview-grid {
        grid-template-columns: 1fr;
    }
    .analytics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .faq-grid {
        grid-template-columns: 1fr;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .brand {
        font-size: 1.25rem;
    }
    .brand-logo {
        width: 28px;
        height: 28px;
    }
    .hero-title {
        font-size: 1.55rem;
    }
    .platform-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .quality-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .dl-link-btn {
        width: 100%;
        justify-content: center;
    }
}
