/* =====================================================
   AVFYP - MAIN STYLE
   ===================================================== */


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

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


html {
    scroll-behavior: smooth;
}


body {
    background: #0d0d0d;
    color: #ffffff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    min-height: 100vh;
}


/* =====================================================
   HEADER
   ===================================================== */

.header {
    position: sticky;

    top: 0;

    z-index: 1000;

    height: 64px;

    display: flex;

    align-items: center;

    padding: 0 20px;

    background: #111111;

    border-bottom: 1px solid #252525;
}


.logo {
    margin-left: 18px;

    font-size: 22px;

    font-weight: 800;

    letter-spacing: 1px;

    color: #ffffff;

    text-decoration: none;
}


/* =====================================================
   HAMBURGER
   ===================================================== */

.menu-button {
    width: 38px;
    height: 38px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 5px;

    border: 0;

    border-radius: 8px;

    background: transparent;

    cursor: pointer;
}


.menu-button:hover {
    background: #222222;
}


.menu-button span {
    display: block;

    width: 21px;
    height: 2px;

    background: #ffffff;

    border-radius: 2px;
}


/* =====================================================
   SIDEBAR
   ===================================================== */

.sidebar {
    position: fixed;

    top: 0;

    left: -290px;

    z-index: 2000;

    width: 280px;

    height: 100vh;

    background: #151515;

    border-right: 1px solid #292929;

    transition:
        left 0.25s ease;

    box-shadow:
        10px 0 30px rgba(0, 0, 0, 0.35);
}


.sidebar.active {
    left: 0;
}


.sidebar-header {
    height: 64px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 18px;

    border-bottom: 1px solid #292929;

    font-size: 15px;

    font-weight: 700;
}


.close-menu {
    width: 34px;
    height: 34px;

    border: 0;

    border-radius: 7px;

    background: #222222;

    color: #ffffff;

    font-size: 22px;

    cursor: pointer;
}


.close-menu:hover {
    background: #303030;
}


.sidebar-menu {
    display: flex;

    flex-direction: column;

    padding: 12px;
}


.sidebar-menu a {
    display: block;

    padding: 13px 14px;

    color: #dddddd;

    text-decoration: none;

    border-radius: 8px;

    font-size: 15px;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}


.sidebar-menu a:hover {
    background: #222222;

    color: #ffffff;
}


.sidebar-menu a.active {
    background: #222222;

    color: #ffffff;

    font-weight: 700;
}


/* =====================================================
   OVERLAY
   ===================================================== */

.overlay {
    position: fixed;

    inset: 0;

    z-index: 1500;

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

    opacity: 0;

    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}


.overlay.active {
    opacity: 1;

    visibility: visible;
}


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

.container {
    width: 100%;

    max-width: 1400px;

    margin: 0 auto;

    padding:
        28px
        22px
        50px;
}


.container > h1 {
    margin-bottom: 22px;

    font-size: 30px;

    line-height: 1.2;
}


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

.search-box {
    width: 100%;

    display: flex;

    margin-bottom: 30px;
}


.search-box input {
    flex: 1;

    min-width: 0;

    height: 46px;

    padding: 0 15px;

    background: #151515;

    color: #ffffff;

    border: 1px solid #303030;

    border-right: 0;

    border-radius:
        9px
        0
        0
        9px;

    outline: none;

    font-size: 14px;
}


.search-box input::placeholder {
    color: #777777;
}


.search-box input:focus {
    border-color: #555555;
}


.search-box button {
    width: 54px;

    height: 46px;

    border: 1px solid #303030;

    border-radius:
        0
        9px
        9px
        0;

    background: #222222;

    color: #ffffff;

    cursor: pointer;

    font-size: 18px;
}


.search-box button:hover {
    background: #2c2c2c;
}


/* =====================================================
   SECTION TITLE
   ===================================================== */

.section-title {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;
}


.section-title h2 {
    font-size: 20px;

    line-height: 1.3;
}


.section-title span {
    color: #777777;

    font-size: 13px;

    white-space: nowrap;
}


.section-link {
    color: #999999;

    font-size: 13px;

    text-decoration: none;

    white-space: nowrap;
}


.section-link:hover {
    color: #ffffff;
}


/* =====================================================
   VIDEO GRID
   ===================================================== */

.video-grid {
    display: grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap: 16px;
}


/* =====================================================
   VIDEO CARD
   ===================================================== */

.video-card {
    display: block;

    min-width: 0;

    overflow: hidden;

    background: #151515;

    border: 1px solid #292929;

    border-radius: 11px;

    color: #ffffff;

    text-decoration: none;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}


.video-card:hover {
    transform: translateY(-2px);

    border-color: #444444;

    background: #181818;
}


.video-thumbnail {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    background: #101010;

    overflow: hidden;
}


.video-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.video-thumbnail::after {
    content: "▶";

    position: absolute;

    left: 50%;
    top: 50%;

    transform:
        translate(
            -50%,
            -50%
        );

    width: 44px;
    height: 44px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

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

    color: #ffffff;

    font-size: 17px;

    opacity: 0.9;
}


.video-info {
    padding: 12px;
}


.video-title {
    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;

    overflow: hidden;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.45;

    color: #ffffff;
}


.video-description {
    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;

    overflow: hidden;

    margin-top: 6px;

    color: #888888;

    font-size: 12px;

    line-height: 1.45;
}


/* =====================================================
   POPULAR HOME
   TOP 4 - SQUARE 2x2
   ===================================================== */

.popular-section {
    margin-top: 42px;

    padding-top: 28px;

    border-top: 1px solid #292929;
}


.popular-grid {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 16px;
}


/* =====================================================
   POPULAR CARD
   ===================================================== */

.popular-card {
    display: block;

    min-width: 0;

    overflow: hidden;

    background: #151515;

    border: 1px solid #292929;

    border-radius: 11px;

    color: #ffffff;

    text-decoration: none;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}


.popular-card:hover {
    transform: translateY(-2px);

    border-color: #444444;

    background: #181818;
}


/* =====================================================
   POPULAR THUMBNAIL
   SQUARE 1:1
   ===================================================== */

.popular-card-thumbnail {
    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    background: #101010;

    overflow: hidden;
}


.popular-card-thumbnail img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =====================================================
   POPULAR OVERLAY
   ===================================================== */

.popular-card-overlay {
    position: absolute;

    inset: 0;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.35),
            rgba(0, 0, 0, 0.05) 45%,
            rgba(0, 0, 0, 0.35)
        );

    pointer-events: none;
}


/* =====================================================
   POPULAR RANK
   ===================================================== */

.popular-card-rank {
    position: absolute;

    top: 10px;

    left: 10px;

    display: flex;

    align-items: center;

    justify-content: center;

    min-width: 34px;

    height: 28px;

    padding: 0 9px;

    background:
        rgba(
            0,
            0,
            0,
            0.72
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.12
        );

    border-radius: 7px;

    color: #ffffff;

    font-size: 12px;

    font-weight: 700;
}


/* =====================================================
   POPULAR PLAY
   ===================================================== */

.popular-card-play {
    width: 48px;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background:
        rgba(
            0,
            0,
            0,
            0.68
        );

    border:
        1px solid
        rgba(
            255,
            255,
            255,
            0.15
        );

    color: #ffffff;

    font-size: 18px;

    padding-left: 2px;
}


/* =====================================================
   POPULAR INFO
   ===================================================== */

.popular-card-info {
    padding: 12px;
}


.popular-card-title {
    display: -webkit-box;

    -webkit-box-orient: vertical;

    -webkit-line-clamp: 2;

    overflow: hidden;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    line-height: 1.45;
}


.popular-card-views {
    margin-top: 7px;

    color: #777777;

    font-size: 12px;

    line-height: 1.4;
}


/* =====================================================
   POPULAR PAGE
   ===================================================== */

.popular-page {
    min-height: 60vh;
}


.popular-page .video-grid {
    margin-top: 2px;
}


.popular-rank {
    margin-bottom: 5px;

    color: #777777;

    font-size: 12px;
}


.popular-views {
    margin-top: 6px;

    color: #777777;

    font-size: 12px;
}


/* =====================================================
   EMPTY / LOADING
   ===================================================== */

.empty-message {
    grid-column: 1 / -1;

    padding:
        40px
        20px;

    text-align: center;

    color: #777777;

    background: #151515;

    border: 1px solid #292929;

    border-radius: 10px;
}


/* =====================================================
   PAGINATION
   ===================================================== */

.pagination {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 12px;

    margin-top: 24px;
}


.pagination button {
    min-height: 40px;

    padding: 0 15px;

    border: 1px solid #303030;

    border-radius: 8px;

    background: #181818;

    color: #ffffff;

    font-size: 13px;

    cursor: pointer;
}


.pagination button:hover:not(:disabled) {
    background: #252525;
}


.pagination button:disabled {
    opacity: 0.35;

    cursor: not-allowed;
}


.pagination span {
    min-width: 35px;

    text-align: center;

    color: #bbbbbb;

    font-size: 14px;
}


/* =====================================================
   ABOUT
   ===================================================== */

.about {

    margin-top: 45px;

    padding: 20px 0;

    border-top:
        1px solid #222;

    color: #999;

    line-height: 1.6;

    text-align: center;
}

.footer {

    padding:
        20px 0 10px;

    text-align: center;

    border-top:
        1px solid #222;
}

.copyright {

    margin: 0;

    color: #aaa;

    font-size: 13px;
}

.copyright-note {

    margin:
        7px 0 0;

    color: #666;

    font-size: 12px;
}



/* =====================================================
   TELEGRAM POPUP
   ===================================================== */

.telegram-popup {
    position: fixed;

    right: 18px;

    bottom: 18px;

    z-index: 1200;

    display: flex;

    align-items: center;

    gap: 10px;

    padding:
        11px
        14px;

    background: #151515;

    border: 1px solid #303030;

    border-radius: 10px;

    color: #ffffff;

    text-decoration: none;

    box-shadow:
        0
        8px
        25px
        rgba(
            0,
            0,
            0,
            0.35
        );

    transition:
        transform 0.18s ease,
        background 0.18s ease;
}


.telegram-popup:hover {
    transform: translateY(-2px);

    background: #1d1d1d;
}


.telegram-icon {
    font-size: 20px;
}


.telegram-text {
    display: flex;

    flex-direction: column;

    gap: 2px;
}


.telegram-text strong {
    font-size: 13px;
}


.telegram-text small {
    color: #777777;

    font-size: 10px;
}


/* =====================================================
   RESPONSIVE - TABLET
   ===================================================== */

@media (max-width: 1000px) {

    .video-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }


    /*
     * Popular tetap 2x2.
     */

    .popular-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}


/* =====================================================
   RESPONSIVE - MOBILE
   ===================================================== */

@media (max-width: 700px) {

    .header {
        height: 58px;

        padding: 0 14px;
    }


    .logo {
        margin-left: 12px;

        font-size: 20px;
    }


    .container {
        padding:
            22px
            14px
            40px;
    }


    .container > h1 {
        font-size: 26px;
    }


    .video-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }


    /*
     * Popular tetap 2 kolom
     * di mobile.
     */

    .popular-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 10px;
    }


    .video-info {
        padding: 10px;
    }


    .video-title {
        font-size: 13px;
    }


    .video-description {
        font-size: 11px;
    }


    .popular-card-info {
        padding: 10px;
    }


    .popular-card-title {
        font-size: 13px;
    }


    .popular-card-views {
        font-size: 11px;
    }


    .popular-card-rank {
        top: 8px;

        left: 8px;

        min-width: 31px;

        height: 25px;

        padding: 0 8px;

        font-size: 11px;
    }


    .popular-card-play {
        width: 42px;

        height: 42px;

        font-size: 16px;
    }


    .telegram-popup {
        right: 12px;

        bottom: 12px;

        padding:
            10px
            12px;
    }

}


/* =====================================================
   RESPONSIVE - SMALL PHONE
   ===================================================== */

@media (max-width: 450px) {

    /*
     * Popular sengaja TETAP 2 kolom.
     * Jadi Top 4 selalu:
     *
     * [ #1 ][ #2 ]
     * [ #3 ][ #4 ]
     */

    .popular-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 8px;
    }


    .video-grid {
        grid-template-columns: 1fr;
    }


    .search-box input {
        font-size: 13px;
    }


    .section-title h2 {
        font-size: 18px;
    }


    .pagination {
        gap: 7px;
    }


    .pagination button {
        padding:
            0
            10px;

        font-size: 12px;
    }


    .telegram-text small {
        display: none;
    }


    .popular-card-info {
        padding: 9px;
    }


    .popular-card-title {
        font-size: 12px;
    }


    .popular-card-views {
        font-size: 10px;
    }

}
