:root {
    --bg: #f4f6fb;
    --text: #222;
    --card: #fff;
    --accent: #4f5bff;
    --border: #dcdfff;
    --footer-bg: #222;
    --footer-text: #aaa;
    --success: #10b981;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --text: #eaeaea;
        --card: #232730;
        --border: #3a3f8f;
        --footer-bg: #000;
        --footer-text: rgba(255, 255, 255, 0.7);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-container {
    max-width: 1200px;
    margin: auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: -0.3px;
    background: #fff;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-btn {
    width: 26px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.menu-btn span {
    position: absolute;
    height: 2.5px;
    width: 100%;
    background: #fff;
    transition: .3s;
    border-radius: 3px;
}

.menu-btn span:nth-child(1) {
    top: 0
}

.menu-btn span:nth-child(2) {
    top: 9px
}

.menu-btn span:nth-child(3) {
    top: 18px
}

.menu-btn.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

.nav-menu {
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(12px);
}

.nav-menu a {
    color: #fff;
    padding: 14px 20px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 500;
    transition: 0.2s;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    background: rgba(79, 91, 255, 0.2);
    padding-left: 28px;
}

@media(min-width:768px) {
    .menu-btn {
        display: none;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: row;
        justify-content: center;
        background: none;
        padding-bottom: 0;
    }

    .nav-menu a {
        border: none;
        padding: 0 16px;
        font-weight: 500;
    }

    .nav-menu a:hover {
        background: none;
        padding: 0 16px;
        color: #a5b4fc;
    }
}

/* MAIN CONTAINER */
.wrapper {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--card);
    border: 1px solid rgba(79, 91, 255, 0.15);
    border-radius: 32px;
    padding: 28px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .12), 0 0 0 1px rgba(79, 91, 255, 0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.logo-box {
    width: 70px;
    height: 70px;
    margin: auto;
    border-radius: 24px;
    background: linear-gradient(135deg, #4f5bff, #60a5fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 18px;
    box-shadow: 0 10px 25px rgba(79, 91, 255, .25);
}

h1 {
    font-size: 1.9rem;
    margin-bottom: 10px;
    background: linear-gradient(125deg, #4f5bff, #818cf8, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.description {
    color: #94a3b8;
    line-height: 1.5;
    max-width: 550px;
    margin: auto auto 28px;
    font-size: 0.95rem;
}

/* INPUT FORM */
.input-wrapper {
    background: rgba(0, 0, 0, .05);
    border: 1.5px solid var(--border);
    border-radius: 60px;
    display: flex;
    flex-direction: row;
    gap: 0;
    transition: 0.2s;
    overflow: hidden;
    flex-wrap: nowrap;
}

.input-wrapper:focus-within {
    border-color: #4f5bff;
    box-shadow: 0 0 0 3px rgba(79, 91, 255, 0.2);
}

.input-wrapper input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.95rem;
    padding: 14px 18px;
    width: 100%;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.get-btn {
    border: none;
    outline: none;
    padding: 12px 24px;
    background: linear-gradient(135deg, #4f5bff, #3b82f6);
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 4px;
    border-radius: 60px;
}

.get-btn:active {
    transform: scale(0.97);
}

/* QUALITY SELECTOR */
.quality-selector {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px;
    background: rgba(79, 91, 255, 0.05);
    border: 1.5px dashed rgba(79, 91, 255, 0.3);
    border-radius: 50px;
}

.quality-btn {
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quality-btn:hover {
    border-color: #4f5bff;
    color: #4f5bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 91, 255, 0.15);
}

.quality-btn.active {
    background: linear-gradient(135deg, #4f5bff, #3b82f6);
    border-color: #4f5bff;
    color: white;
    box-shadow: 0 4px 14px rgba(79, 91, 255, 0.4);
    transform: scale(1.03);
}

.error {
    margin-top: 18px;
    color: #ef4444;
    display: none;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 60px;
    font-size: 0.85rem;
}

.loader {
    margin-top: 22px;
    display: none;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(79, 91, 255, 0.2);
    border-top: 3px solid #4f5bff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PREVIEW CARD */
.preview {
    margin-top: 32px;
    display: none;
    animation: fade .3s ease;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-title-card {
    background: rgba(79, 91, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 18px;
    margin-bottom: 24px;
    text-align: left;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}

.title-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.copy-title-btn,
.copy-channel-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
}

.copy-title-btn:active,
.copy-channel-btn:active {
    transform: scale(0.96);
}

.copy-title-btn:hover,
.copy-channel-btn:hover {
    background: #4f5bff;
    color: white;
    border-color: #4f5bff;
}

.channel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.channel-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f5bff, #60a5fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.channel-name {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
    word-break: break-word;
}

.preview-image {
    overflow: hidden;
    border-radius: 24px;
    background: #00000010;
}

.preview-image img {
    width: 100%;
    display: block;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}

.res-badge {
    margin-top: 12px;
    font-size: 0.75rem;
    background: rgba(79, 91, 255, 0.15);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 60px;
    color: #4f5bff;
    font-weight: 600;
}

.actions {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.action-btn {
    border: none;
    outline: none;
    padding: 12px 22px;
    border-radius: 50px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.download-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.copy-btn {
    background: linear-gradient(135deg, #9333ea, #7e22ce);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.25);
}

.action-btn:active {
    transform: scale(0.97);
}

/* ==========================================
   HOW TO USE & DETAILED GUIDE SECTION (SPACING FIX)
   ========================================== */
.how-to-use-card {
    margin-top: 40px;
    padding: 32px 24px 24px;
    border-top: 1px dashed var(--border);
    text-align: left;
    background: rgba(79, 91, 255, 0.02);
    border-radius: 24px;
}

.how-to-use-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.how-to-use-card h3 {
    font-size: 1.15rem;
    margin-top: 28px;
    margin-bottom: 14px;
    color: var(--text);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-intro {
    color: #94a3b8;
    font-size: 0.93rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* STEP-BY-STEP LIST SPACING */
.steps-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.5;
}

.step-item strong {
    color: var(--text);
    font-size: 0.98rem;
    display: block;
    margin-bottom: 4px;
}

.step-item p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.55;
}

.step-number {
    background: rgba(79, 91, 255, 0.15);
    color: #4f5bff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* FEATURES SECTION */
.features-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
}

.features-section p {
    color: #94a3b8;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 16px;
}

.features-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.features-list li {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.features-list li i {
    color: #4f5bff;
    margin-top: 4px;
    flex-shrink: 0;
}

/* FAQ SECTION */
.faq-mini-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item strong {
    display: block;
    font-size: 0.98rem;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.faq-item p {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 0;
}

/* TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--card);
    border-left: 4px solid #10b981;
    color: var(--text);
    padding: 12px 20px;
    border-radius: 60px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
    opacity: 0;
    transform: translateY(60px);
    transition: .35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    z-index: 999;
    font-weight: 600;
    backdrop-filter: blur(12px);
    pointer-events: none;
    text-align: center;
    font-size: 0.85rem;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* FOOTER */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 16px 16px;
    font-size: 12px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer a {
    color: var(--footer-text);
    text-decoration: none;
    margin: 0 6px;
    transition: 0.2s;
}

footer a:hover {
    color: #a5b4fc;
}

/* RESPONSIVE DESIGN (MOBILE & TABLET) */
@media(max-width:600px) {
    body {
        padding-top: 65px;
    }

    .container {
        padding: 20px 16px;
        border-radius: 28px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .description {
        font-size: 0.85rem;
        margin-bottom: 22px;
    }

    .input-wrapper {
        flex-direction: column;
        background: transparent;
        border: none;
        gap: 10px;
        border-radius: 0;
    }

    .input-wrapper input {
        width: 100%;
        background: rgba(0, 0, 0, 0.05);
        border: 1.5px solid var(--border);
        border-radius: 60px;
        padding: 14px 18px;
        font-size: 16px;
    }

    .get-btn {
        width: 100%;
        margin: 0;
        padding: 14px 20px;
        font-size: 1rem;
        border-radius: 60px;
    }

    .quality-selector {
        gap: 6px;
        margin-top: 16px;
        border-radius: 25px;
        padding: 8px;
    }

    .quality-btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .video-title-card {
        padding: 14px;
    }

    .video-title {
        font-size: 1.1rem;
    }

    .actions {
        flex-direction: row;
        gap: 10px;
    }

    .action-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        min-width: 120px;
    }

    .how-to-use-card {
        padding: 20px 16px;
        margin-top: 28px;
    }

    .how-to-use-title {
        font-size: 1.18rem;
    }

    .how-to-use-card h3 {
        font-size: 1.05rem;
    }
}

@media(max-width:480px) {
    .actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}