/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


/* =========================================================
   BODY
========================================================= */

body {
    min-height: 100vh;

    background: #101010;

    color: #ffffff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    padding: 0 20px;
}


/* =========================================================
   PAGE
========================================================= */

.page {
    width: 100%;

    max-width: 640px;

    margin: 0 auto;

    padding-top: 18px;

    padding-bottom: 50px;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    text-align: center;

    margin-bottom: 43px;
}


.hero h1 {
    font-size: 48px;

    line-height: 1.15;

    font-weight: 700;

    letter-spacing: -1.5px;

    margin-bottom: 16px;
}


.hero p {
    color: #9b9ba5;

    font-size: 17px;

    line-height: 1.65;
}


/* =========================================================
   SEARCH
========================================================= */

.search-section {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 32px;
}


.url-input-wrapper {
    flex: 1;

    height: 49px;

    display: flex;

    align-items: center;

    border: 2px solid #8b8b8f;

    border-radius: 10px;

    background: #1b1b1d;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.url-input-wrapper:focus-within {
    border-color: #ff2938;

    box-shadow:
        0 0 0 3px rgba(
            255,
            41,
            56,
            0.12
        );
}


.url-icon {
    width: 40px;

    flex-shrink: 0;

    text-align: center;

    color: #8c8c95;

    font-size: 17px;
}


.url-input-wrapper input {
    width: 100%;

    height: 100%;

    border: none;

    outline: none;

    background: transparent;

    color: #ffffff;

    font-size: 14px;

    padding-right: 12px;
}


.url-input-wrapper input::placeholder {
    color: #92929c;
}


/* =========================================================
   PRIMARY BUTTON
========================================================= */

.primary-button {
    height: 49px;

    min-width: 176px;

    border: none;

    border-radius: 10px;

    background: #ff2938;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease;
}


.primary-button:hover {
    background: #ff3e4c;
}


.primary-button:active {
    transform: scale(0.98);
}


.primary-button:disabled {
    opacity: 0.55;

    cursor: not-allowed;

    pointer-events: none;
}


/* =========================================================
   RESULT CARD
========================================================= */

.result-card {
    width: 100%;

    background: #1b1b1d;

    border: 1px solid #363638;

    border-radius: 17px;

    overflow: hidden;

    box-shadow:
        0 10px 30px rgba(
            0,
            0,
            0,
            0.2
        );
}


/* =========================================================
   VIDEO HEADER
========================================================= */

.video-header {
    height: 88px;

    display: flex;

    align-items: center;

    gap: 18px;

    padding: 16px;
}


.thumbnail {
    width: 80px;

    height: 58px;

    flex-shrink: 0;

    object-fit: cover;

    border-radius: 13px;

    background: #252527;
}


.video-title-wrapper {
    min-width: 0;

    flex: 1;
}


.video-title-wrapper h2 {
    color: #ffffff;

    font-size: 14px;

    line-height: 1.4;

    font-weight: 700;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   TABS
========================================================= */

.tabs {
    display: flex;

    height: 39px;

    border-top: 1px solid #363638;

    border-bottom: 1px solid #363638;

    background: #1b1b1d;
}


.tab {
    position: relative;

    width: 50%;

    border: none;

    background: transparent;

    color: #85858e;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}


.tab:hover {
    color: #ffffff;

    background: #202023;
}


.tab.active {
    color: #ffffff;
}


.tab.active::after {
    content: "";

    position: absolute;

    left: 0;

    right: 0;

    bottom: -1px;

    height: 2px;

    background: #ff2938;
}


/* =========================================================
   FORMAT HEADER
========================================================= */

.format-header {
    display: grid;

    grid-template-columns:
        1fr
        0.9fr
        1fr
        128px;

    align-items: center;

    min-height: 34px;

    padding:
        0
        15px
        0
        40px;

    background: #252527;

    border-bottom: 1px solid #38383a;

    color: #73737d;

    font-size: 12px;
}


/* =========================================================
   FORMAT LIST
========================================================= */

.format-list {
    width: 100%;
}


/* =========================================================
   FORMAT ROW
========================================================= */

.format-row {
    display: grid;

    grid-template-columns:
        1fr
        0.9fr
        1fr
        128px;

    align-items: center;

    min-height: 53px;

    padding:
        0
        15px
        0
        40px;

    border-bottom: 1px solid #353537;

    transition:
        background 0.15s ease;
}


.format-row:last-child {
    border-bottom: none;
}


.format-row:hover {
    background: #202023;
}


/* =========================================================
   FORMAT TEXT
========================================================= */

.format-quality {
    color: #ffffff;

    font-size: 14px;

    font-weight: 700;
}


.format-type {
    color: #7693bd;

    font-size: 12px;
}


.format-size {
    color: #7693bd;

    font-size: 12px;
}


/* =========================================================
   DOWNLOAD ROW BUTTON
========================================================= */

.row-download-button {
    justify-self: end;

    width: 128px;

    height: 29px;

    border: none;

    border-radius: 9px;

    background: #ff2938;

    color: #ffffff;

    font-size: 11px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        opacity 0.2s ease;
}


.row-download-button:hover {
    background: #ff3e4c;
}


.row-download-button:active {
    transform: scale(0.97);
}


/* =========================================================
   DOWNLOAD BUTTON DISABLED
========================================================= */

.row-download-button:disabled,
.row-download-button.disabled {
    opacity: 0.45;

    cursor: not-allowed;

    pointer-events: none;
}


/* =========================================================
   PROGRESS CARD
========================================================= */

.progress-card {
    margin-top: 20px;

    padding: 20px;

    background: #1b1b1d;

    border: 1px solid #363638;

    border-radius: 14px;

    box-shadow:
        0 10px 30px rgba(
            0,
            0,
            0,
            0.15
        );
}


/* =========================================================
   PROGRESS TITLE
========================================================= */

.progress-title {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 12px;

    color: #ffffff;

    font-size: 14px;

    font-weight: 600;
}


/* =========================================================
   PROGRESS TITLE TEXT
========================================================= */

#progressTitle {
    display: block;

    color: #ffffff;

    font-size: 14px;

    line-height: 1.4;
}


/* =========================================================
   PROGRESS MESSAGE
========================================================= */

#progressMessage {
    margin-top: 4px;

    color: #85858e;

    font-size: 11px;

    line-height: 1.4;
}


/* =========================================================
   PROGRESS PERCENTAGE
========================================================= */

#progressPercent {
    flex-shrink: 0;

    color: #ffffff;

    font-size: 15px;

    font-weight: 700;

    white-space: nowrap;
}


/* =========================================================
   PROGRESS TRACK
========================================================= */

.progress-track {
    width: 100%;

    height: 8px;

    overflow: hidden;

    background: #303033;

    border-radius: 10px;
}


/* =========================================================
   PROGRESS BAR
========================================================= */

.progress-bar {
    width: 0%;

    height: 100%;

    background: #ff2938;

    border-radius: inherit;

    transition:
        width 0.3s ease;
}


/* =========================================================
   PROGRESS DETAILS
========================================================= */

.progress-details {
    display: grid;

    grid-template-columns:
        1fr
        auto
        auto;

    align-items: center;

    gap: 12px;

    margin-top: 10px;

    color: #85858e;

    font-size: 11px;
}


/* =========================================================
   PROGRESS STATUS
========================================================= */

#progressStatus {
    min-width: 0;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* =========================================================
   DOWNLOAD SPEED
========================================================= */

#speed {
    white-space: nowrap;

    text-align: right;
}


/* =========================================================
   ETA
========================================================= */

#eta {
    min-width: 65px;

    white-space: nowrap;

    text-align: right;
}


/* =========================================================
   DOWNLOAD RESULT
========================================================= */

.download-result {
    display: flex;

    align-items: center;

    gap: 14px;

    margin-top: 20px;

    padding: 16px;

    background: #1b1b1d;

    border: 1px solid #363638;

    border-radius: 14px;

    box-shadow:
        0 10px 30px rgba(
            0,
            0,
            0,
            0.15
        );
}


/* =========================================================
   SUCCESS ICON
========================================================= */

.success-icon {
    width: 38px;

    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

    border-radius: 50%;

    background: #1d8c55;

    color: #ffffff;

    font-weight: 700;

    font-size: 16px;
}


/* =========================================================
   DOWNLOAD RESULT TITLE
========================================================= */

.download-result h3 {
    color: #ffffff;

    font-size: 14px;

    margin-bottom: 4px;
}


/* =========================================================
   DOWNLOAD RESULT FILENAME
========================================================= */

.download-result p {
    color: #85858e;

    font-size: 11px;

    max-width: 280px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* =========================================================
   DOWNLOAD LINK
========================================================= */

.download-link {
    margin-left: auto;

    padding:
        9px
        13px;

    border-radius: 8px;

    background: #ff2938;

    color: #ffffff;

    text-decoration: none;

    font-size: 11px;

    font-weight: 700;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}


.download-link:hover {
    background: #ff3e4c;
}


.download-link:active {
    transform: scale(0.97);
}


/* =========================================================
   ERROR
========================================================= */

.error-box {
    margin-bottom: 20px;

    padding:
        13px
        15px;

    border: 1px solid #6f252b;

    border-radius: 10px;

    background: #291619;

    color: #ff737c;

    font-size: 13px;

    line-height: 1.5;
}


/* =========================================================
   UTILITY
========================================================= */

.hidden {
    display: none !important;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 700px) {

    body {
        padding: 0 14px;
    }


    .page {
        padding-top: 25px;
    }


    /* =============================================
       HERO
    ============================================= */

    .hero {
        margin-bottom: 30px;
    }


    .hero h1 {
        font-size: 32px;
    }


    .hero p {
        font-size: 14px;
    }


    /* =============================================
       SEARCH
    ============================================= */

    .search-section {
        flex-direction: column;
    }


    .url-input-wrapper {
        width: 100%;
    }


    .primary-button {
        width: 100%;
    }


    /* =============================================
       FORMAT
    ============================================= */

    .format-header,
    .format-row {

        grid-template-columns:
            0.9fr
            0.7fr
            0.8fr
            105px;

        padding-left: 15px;
    }


    .row-download-button {
        width: 105px;
    }


    /* =============================================
       VIDEO HEADER
    ============================================= */

    .video-header {
        height: 80px;
    }


    .thumbnail {
        width: 72px;

        height: 52px;
    }


    /* =============================================
       DOWNLOAD RESULT
    ============================================= */

    .download-result {
        flex-wrap: wrap;
    }


    .download-link {
        width: 100%;

        margin-left: 0;

        text-align: center;
    }


    /* =============================================
       PROGRESS TITLE
    ============================================= */

    .progress-title {
        gap: 10px;
    }


    /* =============================================
       PROGRESS DETAILS
    ============================================= */

    .progress-details {
        grid-template-columns: 1fr;

        gap: 5px;
    }


    #speed,
    #eta {
        text-align: left;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    body {
        padding: 0 10px;
    }


    .page {
        padding-top: 20px;

        padding-bottom: 30px;
    }


    /* =============================================
       HERO
    ============================================= */

    .hero h1 {
        font-size: 28px;

        letter-spacing: -0.8px;
    }


    .hero p {
        font-size: 13px;
    }


    /* =============================================
       VIDEO CARD
    ============================================= */

    .video-header {
        gap: 12px;

        padding: 12px;
    }


    .thumbnail {
        width: 68px;

        height: 49px;

        border-radius: 10px;
    }


    .video-title-wrapper h2 {
        font-size: 13px;
    }


    /* =============================================
       FORMAT
    ============================================= */

    .format-header,
    .format-row {

        grid-template-columns:
            0.8fr
            0.7fr
            0.9fr
            95px;

        padding-left: 12px;

        padding-right: 10px;
    }


    .format-quality {
        font-size: 13px;
    }


    .format-type,
    .format-size {
        font-size: 11px;
    }


    .row-download-button {
        width: 95px;

        font-size: 10px;
    }


    /* =============================================
       PROGRESS
    ============================================= */

    .progress-card {
        padding: 16px;
    }


    #progressPercent {
        font-size: 14px;
    }


    /* =============================================
       RESULT
    ============================================= */

    .download-result {
        padding: 14px;
    }

}

/* =========================================================
   WHITE MODE
========================================================= */

body.light-mode {
    background:
        linear-gradient(
            180deg,
            #dceeff 0%,
            #eaf5ff 14%,
            #f8f8f4 28%,
            #f8f8f4 100%
        );

    color: #172b40;
}


/* =========================================================
   WHITE MODE - HERO BACKGROUND
========================================================= */

body.light-mode::before {
    content: "";

    position: fixed;

    top: 0;
    left: 0;
    right: 0;

    height: 230px;

    z-index: -1;

    background:
        linear-gradient(
            180deg,
            #cce5fb,
            #e7f3ff
        );

    border-bottom-left-radius: 50% 35px;

    border-bottom-right-radius: 50% 35px;
}


/* =========================================================
   WHITE MODE - HERO
========================================================= */

body.light-mode .hero h1 {
    color: #102942;

    text-shadow:
        0 1px 1px rgba(
            255,
            255,
            255,
            0.7
        );
}


body.light-mode .hero p {
    color: #263b50;
}


/* =========================================================
   THEME TOGGLE - TOP RIGHT
========================================================= */

.theme-toggle {
    position: fixed;

    top: 16px;
    right: 18px;

    z-index: 1000;

    padding: 8px 13px;

    border: 1px solid #55555b;

    border-radius: 999px;

    background: rgba(27, 27, 29, 0.92);

    color: #ffffff;

    font-size: 11px;

    font-weight: 600;

    white-space: nowrap;

    cursor: pointer;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.25);

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        border-color 0.2s ease;
}


.theme-toggle:hover {
    background: #252527;
}


.theme-toggle:active {
    transform: scale(0.97);
}


/* =========================================================
   WHITE MODE THEME BUTTON
========================================================= */

body.light-mode .theme-toggle {
    background: rgba(
        255,
        255,
        255,
        0.92
    );

    border-color: #aab8c4;

    color: #263b50;

    box-shadow:
        0 3px 10px rgba(
            40,
            70,
            95,
            0.15
        );
}


body.light-mode .theme-toggle:hover {
    background: #ffffff;
}


/* =========================================================
   WHITE MODE - INPUT
========================================================= */

body.light-mode .url-input-wrapper {
    background: #ffffff;

    border-color: #9bb2c7;

    box-shadow:
        0 4px 12px rgba(
            65,
            103,
            135,
            0.08
        );
}


body.light-mode .url-input-wrapper:focus-within {
    border-color: #2878b9;

    box-shadow:
        0 0 0 3px rgba(
            40,
            120,
            185,
            0.15
        );
}


body.light-mode .url-icon {
    color: #4c6e89;
}


body.light-mode .url-input-wrapper input {
    color: #1b3045;
}


body.light-mode .url-input-wrapper input::placeholder {
    color: #7b8b98;
}


/* =========================================================
   WHITE MODE - PRIMARY BUTTON
========================================================= */

body.light-mode .primary-button {
    background: #2677b5;

    box-shadow:
        0 4px 8px rgba(
            38,
            119,
            181,
            0.2
        );
}


body.light-mode .primary-button:hover {
    background: #1e669d;
}


/* =========================================================
   WHITE MODE - VIDEO CARD
========================================================= */

body.light-mode .result-card {
    background: #ffffff;

    border-color: #e0e4e8;

    box-shadow:
        0 8px 18px rgba(
            45,
            65,
            85,
            0.14
        );
}


body.light-mode .video-title-wrapper h2 {
    color: #172b40;
}


body.light-mode .thumbnail {
    background: #e9eef3;
}


/* =========================================================
   WHITE MODE - TABS
========================================================= */

body.light-mode .tabs {
    background: #ffffff;

    border-color: #e1e5e9;
}


body.light-mode .tab {
    color: #66737f;
}


body.light-mode .tab:hover {
    color: #1d4e73;

    background: #f2f7fb;
}


body.light-mode .tab.active {
    color: #1e567e;
}


body.light-mode .tab.active::after {
    background: #2878b9;
}


/* =========================================================
   WHITE MODE - FORMAT HEADER
========================================================= */

body.light-mode .format-header {
    background: #f1f4f6;

    border-color: #e1e5e9;

    color: #71808d;
}


/* =========================================================
   WHITE MODE - FORMAT ROW
========================================================= */

body.light-mode .format-row {
    border-color: #e5e8eb;

    background: #ffffff;
}


body.light-mode .format-row:hover {
    background: #f5f9fc;
}


body.light-mode .format-quality {
    color: #172b40;
}


body.light-mode .format-type,
body.light-mode .format-size {
    color: #47718f;
}


/* =========================================================
   WHITE MODE - DOWNLOAD BUTTON
========================================================= */

body.light-mode .row-download-button {
    background: #287bb9;
}


body.light-mode .row-download-button:hover {
    background: #1e669d;
}


body.light-mode .row-download-button:disabled,
body.light-mode .row-download-button.disabled {
    background: #9aaab6;

    opacity: 0.55;
}


/* =========================================================
   WHITE MODE - PROGRESS CARD
========================================================= */

body.light-mode .progress-card {
    background: #ffffff;

    border-color: #e0e5e9;

    box-shadow:
        0 8px 18px rgba(
            45,
            65,
            85,
            0.12
        );
}


body.light-mode #progressTitle {
    color: #172b40;
}


body.light-mode #progressMessage {
    color: #71808d;
}


body.light-mode #progressPercent {
    color: #172b40;
}


body.light-mode .progress-track {
    background: #dce5ec;
}


body.light-mode .progress-bar {
    background: #287bb9;
}


body.light-mode .progress-details {
    color: #71808d;
}


/* =========================================================
   WHITE MODE - DOWNLOAD RESULT
========================================================= */

body.light-mode .download-result {
    background: #ffffff;

    border-color: #e0e5e9;

    box-shadow:
        0 8px 18px rgba(
            45,
            65,
            85,
            0.12
        );
}


body.light-mode .download-result h3 {
    color: #172b40;
}


body.light-mode .download-result p {
    color: #71808d;
}


body.light-mode .success-icon {
    background: #24915c;
}


body.light-mode .download-link {
    background: #287bb9;
}


body.light-mode .download-link:hover {
    background: #1e669d;
}


/* =========================================================
   WHITE MODE - ERROR
========================================================= */

body.light-mode .error-box {
    background: #fff0f1;

    border-color: #e7a6ac;

    color: #bd3542;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 700px) {

    body {
        padding: 0 10px;
    }


    .page {
        width: 100%;

        max-width: 100%;

        padding-top: 78px;

        padding-bottom: 30px;
    }


    /* =============================================
       THEME BUTTON
    ============================================= */

    .theme-toggle {
        top: 12px;

        right: 10px;

        padding: 7px 11px;

        font-size: 10px;
    }


    /* =============================================
       HERO
    ============================================= */

    .hero {
        width: 100%;

        margin-bottom: 28px;

        padding: 0 8px;
    }


    .hero h1 {
        width: 100%;

        font-size: 29px;

        line-height: 1.2;

        letter-spacing: -0.8px;

        white-space: normal;

        word-break: normal;

        overflow-wrap: normal;
    }


    .hero p {
        font-size: 13px;

        line-height: 1.6;
    }


    /* =============================================
       SEARCH
    ============================================= */

    .search-section {
        width: 100%;

        flex-direction: column;

        gap: 10px;

        margin-bottom: 25px;
    }


    .url-input-wrapper {
        width: 100%;

        height: 45px;
    }


    .url-input-wrapper input {
        font-size: 13px;
    }


    .primary-button {
        width: 100%;

        height: 45px;
    }


    /* =============================================
       VIDEO CARD
    ============================================= */

    .video-header {
        height: 80px;

        padding: 12px;

        gap: 12px;
    }


    .thumbnail {
        width: 72px;

        height: 52px;
    }


    .video-title-wrapper h2 {
        font-size: 13px;
    }


    /* =============================================
       FORMAT
    ============================================= */

    .format-header,
    .format-row {
        grid-template-columns:
            0.9fr
            0.7fr
            0.8fr
            105px;

        padding-left: 12px;

        padding-right: 10px;
    }


    .format-quality {
        font-size: 13px;
    }


    .format-type,
    .format-size {
        font-size: 11px;
    }


    .row-download-button {
        width: 105px;

        font-size: 10px;
    }


    /* =============================================
       PROGRESS
    ============================================= */

    .progress-card {
        padding: 16px;
    }


    .progress-title {
        gap: 10px;
    }


    .progress-details {
        grid-template-columns: 1fr;

        gap: 5px;
    }


    #speed,
    #eta {
        text-align: left;
    }


    /* =============================================
       DOWNLOAD RESULT
    ============================================= */

    .download-result {
        flex-wrap: wrap;

        padding: 14px;
    }


    .download-result p {
        max-width: 220px;
    }


    .download-link {
        width: 100%;

        margin-left: 0;

        text-align: center;
    }

}

/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .page {
        padding-top: 72px;
    }


    .theme-toggle {
        top: 10px;

        right: 9px;

        padding: 6px 10px;

        font-size: 9px;
    }


    .hero {
        padding: 0 5px;
    }


    .hero h1 {
        font-size: 26px;

        letter-spacing: -0.6px;
    }


    .hero p {
        font-size: 12px;
    }


    .format-header,
    .format-row {
        grid-template-columns:
            0.8fr
            0.7fr
            0.9fr
            95px;

        padding-left: 10px;

        padding-right: 8px;
    }


    .row-download-button {
        width: 95px;

        font-size: 9px;
    }

}