:root {
    --bg-dark: #101828;
    --nav-dark: #364153;
    --text-dark: #ebe6e7;
    --bs-src-box: #1e2939;
    --bs-input-bg: #1e2939;
    --primary: #ff2056;
    --tou: #c70036;
    --box-h6-txt: #d1d5dc;
    --drp-header-bg: #364153;
    --box-text: #ebe6e7;
    --input-text: #ebe6e7;
    --footer-border: #364153;
    --footer-color: #99a1af;
    --footer-link-hover: #4a5565bf;

}

:root.light {
    --bg-dark: #f3f4f6;
    --text-dark: #1e2939;
    --nav-dark: #fff;
    --primary: #c70036;
    --bs-src-box: #fff;
    --bs-input-bg: #fff;
    --box-text: #fff;
    --box-h6-txt: #6a7282;
    --drp-header-bg: #fff;
    --footer-border: #d1d5dc;
    --footer-color: #4a5565;
    --input-text: #1e2939;
    --footer-link-hover: #f2f4f7;
}

* {
    margin: 0;
    padding: 0;
}


body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background: var(--bg-dark);
    color: var(--text-dark);
    overflow-x: hidden;
}

body.light {
    /* background: var(--bg-light); */
    color: var(--text-light);
}

a {
    text-decoration: none;
    color: inherit;
}

nav {
    padding: 23px 0px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sun {
    display: none;
}

.light .moon {
    display: none;
}

.light .sun {
    display: block;
}

.logo-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-head img {
    width: 44px;
    height: 44px;
    margin-top: 1px;
}

.logo-head span {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.rightUl {
    display: flex;
    align-items: center;
    /* gap: 18px; */
    list-style: none;
    margin: 0;
    padding: 0;
}

.rightUl>li {
    padding: 10px 12px;
}

.rightUl>li:nth-child(4) {
    display: none;
}

.rightUl li:nth-child(5),
.rightUl li:nth-child(4) {
    padding: 0;
}

.right a {
    font-size: 16px;
    color: var(--text-dark);
}

body.light .right a {
    color: var(--text-light);
}

.right>ul>li>a:hover {
    color: var(--primary);
}

button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

.dark-btn {
    padding-left: 8px;
    padding-right: 0;
    padding-top: 5px;
}

.menu-btn {
    display: none;
    width: 32px;
    height: 32px;
    padding: 0;
    margin-right: 8px;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    padding: 0;
}

.menu-lang {
    position: relative;

}

.language-btn svg {
    width: 20px;
    height: 20px;
    transition: transform .25s ease;
}

.language-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.drpMenu {
    position: absolute;
    top: 52px;
    background: var(--drp-header-bg);
    border-radius: 6px;
    display: none;
    right: 12px;
    padding-left: 0;
    max-height: 220px;
    box-shadow: 0 0 #0000;
    width: 118px;
    z-index: 100;
    box-shadow:
        0 1px 3px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px -1px rgba(0, 0, 0, 0.1);

}

.drpMenu {
    overflow: hidden;
}

.drpMenu li {
    list-style: none;
}

.drpMenu a {
    display: block;
    padding: 11.5px 16px;
    font-size: 16px;
}

.drpMenu li:first-child a {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.drpMenu li:last-child a {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

.drpMenu a:hover {
    background: var(--footer-link-hover);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease;
    z-index: 999;
    /* below sidebar */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    background: var(--nav-dark);
    transform: translateX(-100%);
    transition: transform .3s ease;
    padding: 28px 22px;
    z-index: 1000;
}

.sidebar.open {
    transform: translateX(0);
}

.close-btn {
    padding: 0;
    margin-bottom: 15px;
}

.sidebar a {
    display: block;
    padding: 12px 0;
}

/* .sidebar-lang {
    margin-top: 18px;
} */

.sidebar-lang-btn {
    width: 100%;
    font-size: 16px;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
}

.sidebar-lang-btn .arrow {
    transition: transform .25s ease;
}

.sidebar-lang-btn.active .arrow {
    transform: rotate(180deg);
}

.sidebar-lang-menu {
    max-height: 0;
    overflow: hidden;
    padding-left: 22px;
}

.sidebar-lang-menu.open {
    max-height: 300px;
}


.sidebar-lang-menu a:hover {
    color: var(--primary);
}

.logo-head:hover h4 {
    color: var(--primary);
}

.moon,
.sun,
.menu-btn svg,
.close-btn svg,
.arrow svg {
    width: 20px;
    height: 20px;
}

.search-box {
    border-radius: 6px;
    padding: 42px 48px;
    background-color: var(--bs-src-box);
    box-shadow:
        0 1px 3px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.down-vid-h1 {
    padding-bottom: 44px;
    font-size: 30px;
    text-align: center;
    font-weight: 400;
    margin: -4px;
}

.form-grp {
    position: relative;
    background-color: #ff2056;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    align-items: center;
    margin-bottom: 19px;
}

.form-input::placeholder {
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: #828892;
}

.form-input {
    padding: 0 16px;
    outline: #ff2056;
    height: 48px;
    border-radius: 4px;
    padding-inline: 16px;
    border: 0;
    background: var(--bs-input-bg);
    font-size: 16px;
    color: var(--input-text);
    width: 100%;
}

.submit-btn {
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-size: 16px;
    display: flex;
    /* align-items: center; */
    justify-content: center;
    gap: 4px;
    font-weight: 600;
    color: var(--box-text);
    min-width: 101px;
}

.submit-btn svg {
    width: 15px;
    height: 24px;
}

.by-accept {
    font-size: 16px;
    font-weight: 400;
    text-align: center;
    margin: 0;
    color: var(--box-h6-txt);
}

.by-accept span {
    color: #c70036;
}

.content-box {
    padding: 46px 32px 0;
}

.contentH2 {
    font-size: 30px;
    margin: 0;
    font-weight: 600;
    text-align: center;

}

.mbContent {
    margin-bottom: 28px;
}

.contentP {
    text-align: center;
}

.twoCol {
    gap: 32px;
    display: flex;

}

.col1 {
    width: 60%;
}

.content-box h3 {
    font-size: 20px;
    line-height: 24px;
    font-weight: 600;
    margin: 0;
}

.mb3 {
    margin-bottom: 12px !important;
}

ol {
    padding: 0;
    list-style: none;
}

ol li {
    line-height: 25px;
}

.cardContent {
    display: grid;
    gap: 40px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
    text-align: center;
    line-height: 24px;
}

.cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.cards .icon-img {
    width: 56px;
    height: 56px;
    color: #ff2056;
}

footer {
    max-width: 850px;
    margin: 42px auto 0;
}

.footer-container {

    color: var(--footer-color);
    padding: 28px 0px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--footer-border);
    font-size: 14px;
}

.footer-ul {
    list-style: none;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}


/* suggestion */
#searchSuggestions {
    position: absolute;
    display: none;
    width: 86%;
    max-width: 100%;
    top: 60px;
    left: 0;
    z-index: 99;
}

ul.result_box {
    border-radius: 8px;
    background: var(--nav-dark);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    scrollbar-width: none;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-gutter: stable;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

ul.result_box::-webkit-scrollbar {
    display: none;
    /* Chrome / Safari */
}

ul.result_box li.search_result {
    padding: 10px 20px;
    cursor: pointer;
    line-height: 1;
}

ul.result_box li.search_result:hover,
ul.result_box li.selected {
    background-color: var(--footer-link-hover);
}


#result {
    grid-template-columns: repeat(3, 1fr);
    display: grid;
    gap: 20px;
    margin-top: 22px;
}

#result-video {
    margin-top: 22px;

}

.resultCard {
    width: 100%;
}

.video-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    /* fills empty space nicely */
    overflow: hidden;
    border-radius: 6px;
}

.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.video-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    height: 43px;
    line-height: 21px;
    overflow: hidden;
    padding-top: 8px;
    text-align: center;
    text-decoration: none;
    text-overflow: ellipsis;
    margin: 0;
}

#loading_img {
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;

    /* default = dark mode */
    background-image: url("./images/loadingDark.gif");
}

/* light mode */
.light #loading_img {
    background-image: url("./images/loading.gif");
}


.resultCard:hover .video-title {
    cursor: pointer;
    color: #ec003f;
}

.menu-lang:hover {
    color: var(--primary);
}

.dark-btn:hover svg {
    color: var(--primary);
}

.footer-ul li a:hover {
    text-decoration: underline;
}



@media (max-width: 1023px) {
    nav {
        padding: 24px;
    }

    .rightUl>li:not(:last-child):not(:nth-last-child(2)) {
        display: none;
    }

    .rightUl li:nth-child(4) {
        display: block;
    }

    .dark-btn {
        padding-top: 3px;
    }

    .menu-btn {
        display: block;
    }

    .logo-head {
        margin-top: -1px;
    }

    .language-btn {
        display: none;
    }

    .search-box {
        padding: 32px 24px;
    }

    .down-vid-h1 {
        padding-bottom: 34px;
        margin: -10px;
    }

    .mbContent {
        margin-bottom: 20px;
    }

    .content-box {
        padding: 32px 24px 0;
    }

    .cardContent {
        margin-top: 20px;
    }
}

@media (max-width: 992px) {
    footer {
        padding: 0 24px;
    }
}

@media (max-width: 767px) {
    .cardContent {
        gap: 20px;
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    .twoCol {
        flex-direction: column;
    }

    .col1,
    .col2 {
        width: 100%;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }


    #result {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-ul {
        gap: 20px;
    }
}
@media (max-width: 384px){
    #result {
        gap: 10px;
    }
}
@media (max-width: 375px) {
    #result {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 896px;
        margin: 0 auto;

    }

    .form-grp {
        margin-inline: 32px;
    }
}