/* =========================================
   DESIGN SYSTEM
========================================= */

:root {
    --bg: #f7f8fc;
    --surface: #ffffff;
    --surface-soft: #f1f3f8;

    --text: #111318;
    --text-secondary: #6b7280;

    --border: #e5e7eb;

    --primary: #fe2c55;
    --primary-hover: #e51f47;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.08);

    --radius: 18px;

    --transition: 0.25s ease;
}


/* =========================================
   DARK MODE
========================================= */

body.dark {
    --bg: #08090d;
    --surface: #111318;
    --surface-soft: #181a21;

    --text: #f5f5f7;
    --text-secondary: #9ca3af;

    --border: #272a33;

    --primary: #ff2d55;
    --primary-hover: #ff1744;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}


/* =========================================
   RESET
========================================= */

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


html {
    scroll-behavior: smooth;
}


body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;

    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(254, 44, 85, 0.12),
            transparent 45%
        ),
        var(--bg);

    color: var(--text);

    min-height: 100vh;

    transition:
        background var(--transition),
        color var(--transition);
}


/* =========================================
   NAVBAR
========================================= */

.navbar {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 20px 6%;

    border-bottom: 1px solid var(--border);

    background: rgba(255, 255, 255, 0.65);

    backdrop-filter: blur(20px);

    position: sticky;
    top: 0;
    z-index: 100;
}


body.dark .navbar {
    background: rgba(8, 9, 13, 0.72);
}


.logo {
    font-size: 22px;
    font-weight: 800;

    letter-spacing: -0.5px;

    color: var(--text);
}


.logo span {
    color: var(--primary);
}


/* =========================================
   THEME BUTTON
========================================= */

.theme-toggle {
    width: 44px;
    height: 44px;

    border-radius: 50%;

    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text);

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;

    transition: all var(--transition);
}


.theme-toggle:hover {
    transform: translateY(-2px);

    border-color: var(--primary);

    color: var(--primary);
}


/* =========================================
   MAIN CONTAINER
========================================= */

.container {
    width: min(92%, 900px);

    margin: 0 auto;

    padding: 90px 0;
}


/* =========================================
   HERO
========================================= */

.hero {
    text-align: center;

    max-width: 720px;

    margin: 0 auto 45px;
}


.hero h1 {
    font-size: clamp(42px, 7vw, 72px);

    line-height: 1.05;

    letter-spacing: -3px;

    font-weight: 850;

    margin-bottom: 20px;
}


.hero h1 span {
    background:
        linear-gradient(
            135deg,
            #fe2c55,
            #ff6b81
        );

    -webkit-background-clip: text;

    background-clip: text;

    color: transparent;
}


.subtitle {
    font-size: 18px;

    line-height: 1.6;

    color: var(--text-secondary);

    max-width: 580px;

    margin: auto;
}


/* =========================================
   SEARCH CARD
========================================= */

.search-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 10px;

    box-shadow: var(--shadow);

    display: flex;

    gap: 10px;

    transition:
        border var(--transition),
        box-shadow var(--transition);
}


.search-card:focus-within {
    border-color: rgba(254, 44, 85, 0.5);

    box-shadow:
        0 20px 60px rgba(254, 44, 85, 0.10);
}


.search-card input {
    flex: 1;

    min-width: 0;

    border: none;

    outline: none;

    background: transparent;

    color: var(--text);

    padding: 17px 18px;

    font-size: 16px;
}


.search-card input::placeholder {
    color: var(--text-secondary);
}


/* =========================================
   PRIMARY BUTTON
========================================= */

.download-main {
    border: none;

    border-radius: 12px;

    padding: 0 25px;

    min-height: 54px;

    background: var(--primary);

    color: white;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition: all var(--transition);
}


.download-main:hover {
    background: var(--primary-hover);

    transform: translateY(-2px);

    box-shadow:
        0 10px 30px rgba(254, 44, 85, 0.25);
}


.download-main:active {
    transform: translateY(0);
}


.download-main:disabled {
    opacity: 0.65;

    cursor: not-allowed;

    transform: none;
}


/* =========================================
   ERROR
========================================= */

#error {
    text-align: center;

    color: #ef4444;

    margin-top: 15px;

    font-size: 14px;
}


/* =========================================
   RESULT CARD
========================================= */

.result {
    margin-top: 45px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 24px;

    padding: 25px;

    box-shadow: var(--shadow);

    animation: resultIn 0.35s ease;
}


@keyframes resultIn {

    from {
        opacity: 0;

        transform: translateY(15px);
    }

    to {
        opacity: 1;

        transform: translateY(0);
    }

}


/* =========================================
   VIDEO PREVIEW
========================================= */

.video-preview {
    width: 100%;

    max-height: 550px;

    object-fit: contain;

    border-radius: 16px;

    background: #000;

    display: block;

    margin-bottom: 25px;
}


.cover {
    width: 100%;

    max-width: 350px;

    display: block;

    margin: 0 auto 25px;

    border-radius: 16px;

    object-fit: cover;
}


/* =========================================
   VIDEO INFORMATION
========================================= */

.video-info {
    text-align: center;
}


.video-info h2 {
    font-size: 22px;

    line-height: 1.4;

    margin-bottom: 8px;
}


.author {
    color: var(--text-secondary);

    font-size: 15px;

    margin-bottom: 8px;
}


.duration {
    color: var(--text-secondary);

    font-size: 14px;
}


/* =========================================
   DOWNLOAD BUTTONS
========================================= */

.buttons {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 10px;

    margin-top: 25px;
}


.button {
    border: 1px solid var(--border);

    background: var(--surface-soft);

    color: var(--text);

    border-radius: 10px;

    padding: 13px 20px;

    font-size: 14px;

    font-weight: 650;

    cursor: pointer;

    transition: all var(--transition);
}


.button:hover {
    background: var(--primary);

    border-color: var(--primary);

    color: white;

    transform: translateY(-2px);
}


/* =========================================
   FOOTER
========================================= */

.footer {
    text-align: center;

    color: var(--text-secondary);

    font-size: 13px;

    padding: 30px 0;
}


/* =========================================
   HIDDEN
========================================= */

.hidden {
    display: none !important;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 650px) {

    .container {
        padding: 60px 0;
    }


    .hero h1 {
        letter-spacing: -2px;

        font-size: 44px;
    }


    .subtitle {
        font-size: 16px;
    }


    .search-card {
        flex-direction: column;

        padding: 8px;
    }


    .search-card input {
        min-height: 52px;
    }


    .download-main {
        width: 100%;
    }


    .result {
        padding: 18px;

        border-radius: 18px;
    }


    .buttons {
        flex-direction: column;
    }


    .button {
        width: 100%;
    }

}