/**
 * Common Styles - Dùng chung cho tất cả các trang
 * Bao gồm: fonts, header/footer, layout chung, toast, utilities
 */

/* ============================================
   FONTS
   ============================================ */
@font-face {
    font-family: 'VJAMAI';
    src: url('../frontend/home/v1/fonts/VJAMAI.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   HEADER & MENU
   ============================================ */
#menu {
    text-align: center;
}

#menu li {
    text-align: center;
}

#menu li > a {
    display: block;
    text-align: center;
}

#menu li > a.nav-auth-link,
#menu li.user-menu > a.user-menu-trigger {
    background: transparent;
}

/* Custom Layout for Download Buttons */
.list-link-dl {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 5px !important;
}

.list-link-dl .item-link {
    flex: 0 0 calc(33.333% - 5px) !important;
    max-width: calc(33.333% - 5px) !important;
    box-sizing: border-box !important;
    display: block !important;
    position: relative !important;
    text-align: center !important;
}

@media (min-width: 768px) {
    .list-link-dl .item-link {
        flex: 0 0 calc(16.666% - 5px) !important;
        max-width: calc(16.666% - 5px) !important;
    }
}

.list-link-dl .item-link img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: inline-block !important;
}

.list-link-dl .item-link .img-hv {
    position: absolute !important;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.list-link-dl .item-link:hover .img-hv {
    opacity: 1 !important;
}

/* ============================================
   USER MENU DROPDOWN
   ============================================ */
.user-menu {
    position: relative;
}

.user-menu .dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 1000;
    min-width: 150px;
}

.user-menu:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu .dropdown li {
    list-style: none;
    text-align: center;
}

.user-menu .dropdown a {
    background: transparent;
    display: flex !important;
    align-items: center;
    justify-content: center;
    height: 50px;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.user-menu .dropdown a:hover {
    opacity: 0.85;
}

/* Mobile User Menu */
@media (max-width: 768px) {
    .user-menu .dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        min-width: auto !important;
        display: none;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .user-menu .dropdown li {
        border-bottom: 1px dashed rgba(255, 255, 255, 0.3) !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .user-menu .dropdown li:first-child {
        border-top: 1px dashed rgba(255, 255, 255, 0.3) !important;
        margin-top: 5px !important;
    }
    
    .user-menu .dropdown li:last-child {
        border-bottom: none !important;
    }
    
    .user-menu .dropdown a {
        background: transparent !important;
        color: inherit !important;
        padding: 8px 20px !important;
        display: block !important;
        text-align: center !important;
        height: auto !important;
        border: none !important;
        font-size: 1.3em !important;
    }
    
    .user-menu .dropdown a:hover {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .user-menu.active .dropdown {
        display: block !important;
    }
    
    .user-menu:hover .dropdown {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
    }
    
    .user-menu > a {
        cursor: pointer !important;
        position: relative !important;
    }
    
    .user-menu > a::after {
        content: ' ▼';
        font-size: 12px;
        transition: transform 0.3s;
    }
    
    .user-menu.active > a::after {
        transform: rotate(180deg);
    }
}

/* ============================================
   COMMON LAYOUT & TITLE
   ============================================ */
.main__news {
    width: 100%;
    padding-top: 20px;
}

@media only screen and (min-width: 1024px) {
    .main__news {
        padding-top: 50px;
    }
}

.main-content-news {
    width: 96%;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    margin-top: 15px;
    margin-bottom: 60px;
    padding-bottom: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

@media only screen and (min-width: 768px) {
    .main-content-news {
        margin-top: 20px;
        margin-bottom: 100px;
        padding-bottom: 28px;
    }
}

.main-content-news > :not(.title-main-new) {
    padding-left: clamp(10px, 2.5vw, 24px);
    padding-right: clamp(10px, 2.5vw, 24px);
    box-sizing: border-box;
}

.title-main-new {
    position: relative;
    background: url('../frontend/home/v1/images/news/bg-title.png') no-repeat center right;
    background-size: cover;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 14px;
    gap: 0 10px;
}

@media only screen and (min-width: 768px) {
    .title-main-new {
        gap: 0 20px;
        padding: 25px 30px;
        min-height: 80px;
    }
}

.title-left {
    font-family: 'VJAMAI', sans-serif;
    font-size: 18px;
    color: #ffffff !important;
    font-weight: bold;
}

@media only screen and (min-width: 768px) {
    .title-left {
        font-size: 24px;
    }
}

/* ============================================
   FOOTER & RIGHT SIDEBAR
   ============================================ */
.footer-ace {
    width: 100%;
    padding: 36px 16px 28px;
    text-align: center;
    color: #fff;
    background: #181818;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.footer-link-privacy {
    margin-bottom: 10px;
}

.footer-link-privacy a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link-privacy a:hover {
    color: #ffa000;
}

.footer-ace p {
    margin-bottom: 6px;
}

.footer-ace-inner {
    width: 100%;
    max-width: 1000px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    position: relative;
    margin: 0 auto;
}

.faq-tink {
    position: absolute;
    display: block;
    text-indent: -999em;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: contain;
    width: 110px;
    height: 55px;
    left: 0;
    top: -10px;
}

.footer-ace-18 {
    position: absolute;
    right: 0;
    top: 0;
    max-width: 160px;
    object-fit: contain;
    object-position: top center;
}

@media (max-width: 768px) {
    .faq-tink {
        position: inherit;
        top: 0;
        margin: 0 auto 10px;
    }
    
    .footer-ace-18 {
        display: block;
        position: relative;
        left: 50%;
        margin-top: 10px;
        transform: translateX(-50%);
        margin-left: 0;
    }
}

/* Right Floating Sidebar */
.sidebar_right {
    transition: right 0.4s ease;
    right: -206px !important;
    z-index: 999 !important;
}

.sidebar_right .sidebar_right-content {
    opacity: 0;
    transition: opacity 0.25s ease 0.15s;
}

.sidebar_right.mo {
    right: 6px !important;
    z-index: 9999 !important;
}

.sidebar_right.mo .sidebar_right-content {
    opacity: 1;
}

.ctFixRight {
    cursor: pointer;
    transition: all 0.3s ease;
}

.ctFixRight .imgCtr {
    transition: transform 0.3s ease;
    transform: rotateZ(-180deg);
}

.ctFixRight.ctFixRight-mo .imgCtr {
    transform: rotateZ(0deg);
}

@media (max-width: 768px) {
    .sidebar_right {
        display: none !important;
    }
}

/* ============================================
   ALERT & TOAST MESSAGES
   ============================================ */
.alert {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'VJAMAI', sans-serif;
}

.alert-error {
    background: #fed7d7;
    color: #9b2c2c;
    border: 2px solid #feb2b2;
}

.alert-success {
    background: #c6f6d5;
    color: #2f855a;
    border: 2px solid #9ae6b4;
}

.notification-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: calc(100vw - 32px);
    background: #0d2031;
    color: #fff;
    font-family: 'VJAMAI', sans-serif;
    font-size: 14px;
    padding: 12px 20px;
    border: 2px solid #ffdf7e;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 99999;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.25s ease;
    pointer-events: none;
    box-sizing: border-box;
    text-align: center;
}

@media (max-width: 480px) {
    .notification-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

.notification-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.notification-toast.notification-success {
    border-color: #10b981;
}

.notification-toast.notification-error {
    border-color: #ef4444;
}

/* ============================================
   UTILITIES & SLIDERS
   ============================================ */
.f-VJAMAI {
    font-family: 'VJAMAI', sans-serif;
}

.no-posts,
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

@media (max-width: 1023.98px) {
    .list-slide {
        max-width: 488px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

.listSlide__new,
.listSlide__new .slick-list,
.listSlide__new .slick-track {
    overflow: hidden;
    height: 100% !important;
}

.listSlide__new .slick-slide,
.listSlide__new .slick-slide > div {
    height: 100%;
}

.listSlide__new a {
    display: block !important;
    width: 100%;
    height: 100%;
}

.listSlide__new img {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    display: block;
}

.slide__tinhnang .slick-list,
.slide__tinhnang .slick-track,
.slide__tinhnang .slick-slide,
.slide__tinhnang .slick-slide > div {
    height: 100%;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #efecde;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: #0d2031;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #f64149;
}

/* Mobile Table Sizing */
@media (max-width: 768px) {
    .table-rank th, .table-rank td,
    .ranking-table th, .ranking-table td {
        padding: 6px 4px !important;
        font-size: 12px !important;
    }
    .table-rank th, .ranking-table th {
        font-size: 11px !important;
    }
    .rank-number {
        font-size: 14px !important;
    }
    .sidebar-avatar {
        width: 80px;
        height: 80px;
    }
}

/* ============================================================
   RESPONSIVE LOGO & ANTI-HORIZONTAL-SCROLL (CHỐNG TRÀN TRANG)
   ============================================================ */

/* Khống chế toàn bộ website không bị cuộn ngang trên mọi thiết bị */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* ==========================================================================
   HEADER & LOGO RESPONSIVE - CỐ ĐỊNH CHUẨN XÁC TRÊN PC & MỌI THIẾT BỊ
   ========================================================================== */

.main_head {
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

/* Header & Logo Desktop (>= 1200px): Cố định vị trí chuẩn góc trái, kích thước chuẩn, thẳng hàng Menu */
@media (min-width: 1200px) {
    .main_head {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        height: 85px !important;
        background: transparent !important;
        border-bottom: none !important;
        padding: 0 !important;
        z-index: 100 !important;
    }

    .main_head .navbar {
        height: 85px !important;
        width: 100% !important;
        position: relative !important;
    }

    .main_head .limit__game {
        position: relative !important;
        height: 85px !important;
        max-width: 1360px !important;
        margin: 0 auto !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }

    .header-logo-pc {
        display: inline-flex !important;
        align-items: center !important;
        position: absolute !important;
        left: 20px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 20 !important;
        max-width: 260px !important;
        height: auto !important;
        text-decoration: none !important;
    }

    .header-logo-pc .logo-top,
    .logo-top {
        max-width: 250px !important;
        max-height: 82px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
        transition: transform 0.25s ease, filter 0.25s ease;
    }

    .header-logo-pc:hover .logo-top {
        transform: scale(1.04);
        filter: drop-shadow(0 6px 16px rgba(255, 203, 57, 0.75));
    }

    .navbar-content {
        float: right !important;
        margin-top: 21px !important;
    }

    .navbar-content ul li {
        width: 147px !important;
    }
}

/* Màn hình laptop vừa (1200px - 1399px): Tự động co tỉ lệ nhẹ, chống đè menu */
@media (min-width: 1200px) and (max-width: 1399px) {
    .main_head .limit__game {
        max-width: 100% !important;
        padding: 0 15px !important;
    }

    .header-logo-pc {
        left: 15px !important;
        max-width: 210px !important;
    }

    .header-logo-pc .logo-top,
    .logo-top {
        max-width: 200px !important;
        max-height: 72px !important;
    }

    .navbar-content ul li {
        width: 126px !important;
        font-size: 14.5px !important;
        margin: 0 -1px !important;
    }
}

/* Thiết bị Tablet & Mobile (< 1200px): Cố định Header chuẩn Flexbox, căn giữa logo và nút Hamburger */
@media (max-width: 1199px) {
    .main_head {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 60px !important;
        background: #0e0e0e !important;
        z-index: 9999 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6) !important;
        padding: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        overflow: visible !important; /* Cho phép logo tràn viền xuống dưới */
    }

    .main_head .navbar {
        height: 60px !important;
        width: 100% !important;
        position: relative !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .main_head .limit__game {
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 10px 0 0 !important; /* Sát cạnh trái */
        box-sizing: border-box !important;
        position: relative !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .header-logo-pc {
        display: none !important;
    }

    .left-header {
        display: flex !important;
        align-items: center !important;
        height: 100% !important;
        float: none !important;
        flex: 1 1 auto !important;
        max-width: calc(100% - 46px) !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .header-logo-mobile {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important; /* Dịch chữ sang trái gần logo hơn */
        text-decoration: none !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .icon-name-game {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important; /* Dịch chữ sang trái gần logo hơn */
        max-width: 100% !important;
        overflow: visible !important;
    }

    /* Icon Game Mobile: Thấp xuống (top: 7px), to 74px, tràn cạnh dưới */
    .icon-game {
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        align-self: flex-start !important;
        position: relative !important;
        overflow: visible !important;
        z-index: 10002 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .icon-game img,
    .logo-mobile-icon {
        width: 74px !important;
        height: 74px !important;
        max-width: 74px !important;
        max-height: 74px !important;
        position: relative !important;
        top: 7px !important; /* Thấp xuống xíu nữa so với mép trên */
        left: 0 !important;
        object-fit: contain !important;
        border: 2px solid #ffcb39 !important;
        border-radius: 11px !important;
        background: #000000 !important;
        display: block !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.75), 0 0 8px rgba(255, 203, 57, 0.35) !important;
    }

    /* Chữ Tên Game Mobile: Thấp xuống thêm (margin-top: 10px), to 20px, dịch sang trái và full chữ không bị cắt */
    .txt-name-game {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: visible !important;
        align-self: center !important;
        margin-top: 10px !important; /* Chữ thấp xuống xíu nữa */
        margin-left: -2px !important; /* Dịch sang trái 1 xíu */
    }

    .txt-name-game .name-game {
        font-size: 20px !important; /* Chữ to lên 1 xíu (20px) */
        line-height: 1.1 !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        color: #ffffff !important;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.8) !important;
        padding-right: 18px !important; /* Đệm chống cắt đuôi chữ nghiêng sVN-Avengeance */
        letter-spacing: 0.2px !important;
        display: inline-block !important;
    }

    /* Nút Hamburger Menu - Căn giữa chuẩn xác trong chiều cao Header, không bị rơi ra ngoài */
    .icon-hamburger {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        float: none !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        width: 44px !important;
        height: 44px !important;
        cursor: pointer !important;
        z-index: 10001 !important;
    }

    .icon-hamburger #menu__header-page {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        width: 32px !important;
        height: 28px !important;
        margin: 0 !important;
        padding: 0 !important;
        cursor: pointer !important;
    }

    .icon-hamburger #menu__header-page .inner-menu__header-page {
        position: absolute !important;
        top: 50% !important;
        left: 0 !important;
        right: 0 !important;
        height: 3.5px !important;
        background-color: #ffffff !important;
        border-radius: 2px !important;
        transform: translateY(-50%) !important;
        transition: all 0.25s ease-in-out !important;
    }

    .icon-hamburger #menu__header-page .inner-menu__header-page:before,
    .icon-hamburger #menu__header-page .inner-menu__header-page:after {
        position: absolute !important;
        content: "" !important;
        left: 0 !important;
        right: 0 !important;
        height: 3.5px !important;
        background-color: #ffffff !important;
        border-radius: 2px !important;
        transition: all 0.25s ease-in-out !important;
    }

    .icon-hamburger #menu__header-page .inner-menu__header-page:before {
        top: -9px !important;
    }

    .icon-hamburger #menu__header-page .inner-menu__header-page:after {
        top: 9px !important;
    }

    /* Hiệu ứng khi bấm mở menu: chuyển thành biểu tượng X màu vàng sang trọng */
    #toggle-menu__header-page:checked ~ .navbar #menu__header-page .inner-menu__header-page {
        background-color: transparent !important;
    }
    #toggle-menu__header-page:checked ~ .navbar #menu__header-page .inner-menu__header-page:before {
        top: 0 !important;
        transform: rotate(45deg) !important;
        background-color: #ffcb39 !important;
    }
    #toggle-menu__header-page:checked ~ .navbar #menu__header-page .inner-menu__header-page:after {
        top: 0 !important;
        transform: rotate(-45deg) !important;
        background-color: #ffcb39 !important;
    }

    /* Drawer Menu Mobile khi mở */
    .navbar-content {
        position: fixed !important;
        top: 60px !important;
        left: -100% !important;
        width: 100% !important;
        height: calc(100vh - 60px) !important;
        background: rgba(14, 14, 14, 0.98) !important;
        backdrop-filter: blur(8px) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 20px 15px !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        float: none !important;
    }

    #toggle-menu__header-page:checked ~ .navbar .navbar-content {
        left: 0 !important;
    }

    .navbar-content ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .navbar-content ul li {
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
        height: auto !important;
        line-height: normal !important;
    }

    .navbar-content ul li a {
        display: block !important;
        padding: 12px 16px !important;
        color: #ffffff !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        text-align: center !important;
        text-decoration: none !important;
    }

    .navbar-content ul li:hover,
    .navbar-content ul li:active {
        background: rgba(255, 203, 57, 0.15) !important;
        border-color: #ffcb39 !important;
    }

    .navbar-content ul li:hover a,
    .navbar-content ul li:active a {
        color: #ffcb39 !important;
    }
}

/* Mobile nhỏ (< 480px) */
@media (max-width: 480px) {
    .icon-game img,
    .logo-mobile-icon {
        width: 68px !important;
        height: 68px !important;
        max-width: 68px !important;
        max-height: 68px !important;
        top: 6px !important; /* Thấp xuống */
    }
    
    .txt-name-game {
        margin-top: 8px !important; /* Thấp xuống */
        margin-left: -2px !important;
    }

    .txt-name-game .name-game {
        font-size: 17.5px !important;
        padding-right: 15px !important;
    }
}

/* Mobile rất nhỏ (< 360px) */
@media (max-width: 359px) {
    .icon-game img,
    .logo-mobile-icon {
        width: 62px !important;
        height: 62px !important;
        max-width: 62px !important;
        max-height: 62px !important;
        top: 5px !important; /* Thấp xuống */
    }
    
    .txt-name-game {
        margin-top: 7px !important; /* Thấp xuống */
    }

    .txt-name-game .name-game {
        font-size: 15.5px !important;
        padding-right: 10px !important;
    }
}

/* Cố định giới hạn ảnh Text Game Hero và Logo Footer - không bao giờ tràn trang */
.main--game__show .text--brand .textgame__game {
    max-width: min(720px, 92vw) !important;
    max-height: 240px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin-inline: auto !important;
    display: block !important;
}

.faq-tink {
    max-width: 250px !important;
    height: 60px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    display: inline-block !important;
}

