/* ==== Variables & Themes ==== */
:root {
    /* Color Palette - Light Mode */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-bg: linear-gradient(135deg, #f0fdf4, #e0e7ff, #fae8ff);

    /* Platform Colors */
    --youtube: #ff0000;
    --instagram: #e1306c;
    --tiktok: #00f2fe;
    /* Custom representation */
    --twitter: #1da1f2;
    --facebook: #1877f2;
    --reddit: #ff4500;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode */
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --secondary: #f472b6;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);

    /* Gradients */
    --gradient-bg: linear-gradient(135deg, #020617, #0f172a, #170f23);
}

/* ==== Reset & Base ==== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==== Navbar ==== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
}

.logo i {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--border);
}

/* ==== Hero Section ==== */
.hero {
    position: relative;
    padding: 6rem 0 4rem;
    text-align: center;
    background: var(--gradient-bg);
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: var(--primary);
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 30vw;
    height: 30vw;
    background: var(--secondary);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

/* Search Box */
.input-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    transform: translateY(0);
    transition: transform 0.3s;
}

.input-card:hover {
    transform: translateY(-5px);
}

.download-form {
    display: flex;
    gap: 1rem;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.download-form input {
    width: 100%;
    padding: 1.25rem 3.5rem 1.25rem 3rem;
    font-size: 1.1rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
    color: var(--text-main);
    transition: all 0.3s;
    outline: none;
    font-family: var(--font-body);
}

.download-form input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.paste-btn {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.paste-btn:hover {
    color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    font-size: 1.1rem;
    padding: 0 2rem;
    border-radius: 16px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px -10px var(--primary);
}

.btn-secondary {
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-download {
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid var(--border);
    width: 100%;
    justify-content: space-between;
}

.btn-download:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==== Loader ==== */
.loader-container {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==== Result Section ==== */
.result-section {
    padding: 2rem 0;
}

.result-card {
    padding: 2rem;
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.thumbnail-wrapper {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.thumbnail-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.duration-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.9rem;
    width: fit-content;
    margin-bottom: 1.5rem;
}

.platform-badge i {
    font-size: 1.1rem;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
}

.download-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.options-column h3 {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.format-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s;
}

.format-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.format-details {
    display: flex;
    flex-direction: column;
}

.res-tag {
    font-weight: 600;
    font-size: 1.1rem;
}

.size-tag {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.format-badge {
    font-size: 0.75rem;
    background: var(--border);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.empty-message {
    color: var(--text-muted);
    font-style: italic;
    padding: 1rem 0;
}

/* ==== Sections ==== */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Supported Platforms */
.platforms-section {
    padding: 6rem 0;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.platform-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem 1rem;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-sm);
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.platform-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.youtube-color {
    color: var(--youtube);
}

.instagram-color {
    color: var(--instagram);
}

.tiktok-color {
    color: var(--text-main);
}

.twitter-color {
    color: var(--twitter);
}

.facebook-color {
    color: var(--facebook);
}

.reddit-color {
    color: var(--reddit);
}

/* How it Works */
.how-it-works {
    padding: 6rem 0;
    background: var(--bg-card);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    padding: 3rem 2rem;
    text-align: center;
}

.step-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    line-height: 1;
    box-shadow: var(--shadow-md);
}

.step-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.step-card p {
    color: var(--text-muted);
}

/* FAQ */
.faq-section {
    padding: 6rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-body);
}

.faq-question i {
    transition: transform 0.3s;
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    color: var(--text-muted);
    padding-bottom: 1.5rem;
}

/* ==== Footer ==== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 4rem 0 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 300px;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.link-group h4 {
    margin-bottom: 1rem;
}

.link-group a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.link-group a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==== Toasts ==== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateX(100%);
}

.toast.removing {
    animation: slideOut 0.3s ease forwards;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ==== Responsive ==== */
@media (max-width: 900px) {
    .result-header {
        flex-direction: column;
    }

    .thumbnail-wrapper {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .download-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
        /* simple mobile nav for now */
    }

    .download-form {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
    }

    .steps-container {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ==== Features Section (Why Choose Us) ==== */
.features-section {
    padding: 6rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    padding: 2rem;
    border-radius: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 1.25rem;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ==== SEO Article Section ==== */
.seo-article-section {
    padding: 5rem 0 4rem;
    background: var(--bg-card);
    margin-top: 2rem;
}

.seo-article-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.seo-article-inner h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.seo-article-inner h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.seo-article-inner p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.seo-article-inner ol,
.seo-article-inner ul {
    color: var(--text-muted);
    line-height: 1.9;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.seo-article-inner li {
    margin-bottom: 0.5rem;
}

.seo-article-inner strong {
    color: var(--text-main);
}

/* ==== Responsive: Features Section ==== */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .seo-article-inner h2 {
        font-size: 1.6rem;
    }
}