/**
 * 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;
    }
}
