






/* ---------- CSS Variables & Theme ---------- */
:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --text: #f0f0f0;
    --text-secondary: #b0b0b0;
    --accent: #10b981;
    --accent-hover: #059669;
    --error: #ef4444;
    --success: #22c55e;
    --border: #333;
    --radius: 0.75rem;
    --transition: 0.2s ease;
    --icon-color: #fff;
}

[data-theme="light"] {
    --bg: #ffffff;
    --surface: #f5f5f5;
    --text: #111111;
    --text-secondary: #555555;
    --accent: #047857;
    --accent-hover: #065f46;
    --error: #dc2626;
    --success: #16a34a;
    --border: #e5e7eb;
    --icon-color: #222;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    width: 100%;
}

/* ---------- Header ---------- */
.main-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
    margin-right: auto;
}

.nav-links {
    display: flex;
    gap: 1.2rem;
    margin-right: 1.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--accent);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ---------- Hamburger ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 20;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
}

.theme-toggle:hover {
    background: var(--border);
}

.icon-toggle {
    color: var(--icon-color);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Mobile Nav ---------- */
@media (max-width: 600px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        z-index: 15;
        margin-right: 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    margin: 2rem 0 1.5rem;
}

.hero h1 {
    font-size: 2.3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition);
}

.card:hover {
    transform: translateY(-2px);
}

.downloader-card {
    text-align: center;
}

/* ---------- Inputs ---------- */
.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

input[type="url"],
input[type="email"],
input[type="text"],
textarea {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    transition: border var(--transition);
    width: 100%;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* ---------- Buttons ---------- */
button,
.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition), transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--accent);
}

.btn-secondary {
    background: #6b7280;
}

/* ---------- Spinner ---------- */
.spinner {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Messages ---------- */
.error-message {
    color: var(--error);
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.form-status {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.form-status.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.form-status.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
}

/* ---------- Results ---------- */
#results-section {
    transition: opacity 0.3s;
}

.media-preview .preview-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius);
    overflow: hidden;
}

.thumbnail-wrapper img {
    width: 100%;
    display: block;
    border-radius: var(--radius);
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.quality-selector {
    width: 100%;
    max-width: 300px;
}

.quality-selector select {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
}

.media-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.media-list li {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 0.5rem;
    width: 150px;
    text-align: center;
}

.media-list a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* ---------- Ad placeholder ---------- */
.ad-banner-placeholder {
    text-align: center;
    background: #2d2d2d;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.ad-box {
    background: #444;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    border-radius: 4px;
}

/* ---------- Contact form ---------- */
#contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}

.note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.note a {
    color: var(--accent);
}

/* ---------- Legal pages ---------- */
.legal-page h1 {
    margin-bottom: 0.25rem;
}

.legal-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.legal-page h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    font-size: 1.15rem;
}

.legal-page h3 {
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.legal-page p {
    margin-bottom: 0.75rem;
}

.legal-page ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
}

.legal-page ul li {
    margin-bottom: 0.35rem;
}

.legal-page a {
    color: var(--accent);
}

.legal-page code {
    background: var(--border);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ---------- Footer ---------- */
.main-footer {
    margin-top: auto;
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-links a:hover,
.main-footer a:hover {
    color: var(--accent);
}

.main-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .input-group {
        flex-direction: column;
    }

    .video-actions {
        flex-direction: column;
    }
}