@import url(./root.css);

.menu-sub-dropdown {
    display: none;
    position: absolute;
    top: 45px;
    right: 0;
    width: 275px;
}

#mobile-sidebar .menu-sub-dropdown {
    bottom: 45px;
    right: 0;
    left: 0;
    top: unset;
    z-index: 999;
    width: unset;
}

.menu-sub-dropdown.show {
    display: block;
}

#kt_header_user_menu_toggle {
    position: relative;
}

/* ===== USER ACCOUNT DROPDOWN ===== */
#kt_header_user_menu_toggle .user-account-dropdown {
    top: calc(100% + 12px);
    right: 0;
    z-index: 1000;
    width: 275px;
    max-width: calc(100vw - 24px);
    padding: 16px;
    overflow: hidden;
    color: var(--ihd-primary-color);
    background: #fff;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(2, 31, 68, 0.16);
}

#kt_header_user_menu_toggle .user-account-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    margin-bottom: 10px;
}

#kt_header_user_menu_toggle .user-account-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #d9d9d9;
}

#kt_header_user_menu_toggle .user-account-name {
    min-width: 0;
    overflow: hidden;
    color: var(--ihd-primary-color);
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#kt_header_user_menu_toggle .user-account-separator {
    height: 1px;
    margin: 5px 0;
    background: #d9d9d9;
}

#kt_header_user_menu_toggle .user-account-dropdown .menu-item {
    padding: 0;
}

#kt_header_user_menu_toggle .user-account-dropdown .menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    padding: 0;
    color: var(--ihd-primary-color) !important;
    font-weight: 400;
    line-height: 24px;
    text-decoration: none;
    border-radius: 8px;
}

#kt_header_user_menu_toggle .user-account-dropdown .menu-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: currentColor;
    line-height: 1;
}

#kt_header_user_menu_toggle .user-account-dropdown .menu-link span {
    font-size: 14px;
}

#kt_header_user_menu_toggle .user-account-dropdown .menu-link:hover,
#kt_header_user_menu_toggle .user-account-dropdown .menu-link:focus {
    color: var(--ihd-primary-color) !important;
    background: rgba(2, 31, 68, 0.07);
}

.landing-header,
.landing-header * {
    transition: color 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

.landing-header {
    transition: background 0.3s ease,
        box-shadow 0.3s ease;
}

#kt_landing_menu .menu-link::after {
    transition: transform 0.3s ease,
        background-color 0.3s ease;
}

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

.landing-header.transparent-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: transparent;
    transition: all 0.3s ease;
}

.landing-header.normal-header {
    width: 100%;
    background: var(--ihd-primary-color);
}

/* Scrolled: primary color background, white text */
.landing-header.scrolled {
    width: 100%;
    top: 0;
    z-index: 100;
    background: var(--ihd-primary-color);
    box-shadow: rgba(0, 0, 0, 0.25) 0px 4px 12px;
}
.landing-header.normal-header.scrolled {
    position: sticky;
}

.landing-header.transparent-header.scrolled {
    position: fixed;
}

/* ===== LOGO ===== */
.header-logo {
    height: 60px;
    border-radius: 10px;
    margin-left: 10px;
}

/* ===== TOP BAR ===== */
.container-fluid.px-6 {
    background-color: #fff;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.header-top-content {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    padding-right: 40px;
    padding-top: 20px;
    flex-wrap: nowrap;
}

.landing-header .slide {
    width: 1px;
    height: 30px;
    flex-shrink: 0;
}

/* ===== AVATAR & USER ===== */
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

#kt_header_user_menu_toggle .cursor-pointer {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    max-width: 160px;
}

#kt_header_user_menu_toggle .cursor-pointer span,
#kt_header_user_menu_toggle .cursor-pointer {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== NOTIFICATION BELL ===== */
#notificationDropdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

#notificationDropdown:hover i {
    color: var(--ihd-primary-color) !important;
}

#notificationList {
    position: absolute;
    top: 45px;
    right: 0;
    display: none;
    min-width: 320px;
    max-width: 360px;
}

#notificationList.show {
    display: block;
}

.notification-item {
    font-size: 13px !important;
    line-height: 1.4;
    padding: 10px 15px;
}

.notification-item.unread {
    background-color: #f5f5f5;
    border-left: 3px solid #dc3545;
    font-weight: 600;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:hover .text-truncate {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
}

.notification-loader {
    text-align: center;
    padding: 10px;
}

/* ===== NAV MENU ===== */
#kt_header_nav_wrapper {
    width: 100%;
    display: flex !important;
    justify-content: flex-end;
    margin-right: 20px;
}

.flex-equal a {
    white-space: nowrap;
}

/* Nav link underline effect */
#mobile-sidebar .main-menu a.menu-link.nav-link,
.landing-header .main-menu a.menu-link.nav-link {
    position: relative;
    padding: 10px 16px;
}

#mobile-sidebar .main-menu a.menu-link.nav-link.active,
.landing-header .main-menu a.menu-link.nav-link.active {
    color: var(--ihd-primary-color);
}

#mobile-sidebar .main-menu a.menu-link.nav-link::after,
.landing-header .main-menu a.menu-link.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 2px;
    background-color: var(--ihd-primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

#mobile-sidebar .main-menu a.menu-link.nav-link:hover::after,
#mobile-sidebar .main-menu a.menu-link.nav-link.active::after,
.landing-header .main-menu a.menu-link.nav-link:hover::after,
.landing-header .main-menu a.menu-link.nav-link.active::after {
    transform: scaleX(1);
}

/* ===== HOT LINE ===== */
.landing-header .hot-line {
    margin-bottom: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 13px;
}

/* ===== ONLINE DOT ===== */
#online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #28a745;
    box-shadow: 0 0 8px 2px #28a745;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.4;
    }
}

#onlineUsersDropdown {
    display: none;
    width: 250px;
    max-height: 300px;
    overflow-y: auto;
    right: 0;
}

#onlineUsersDropdown.show {
    display: block;
}

.online-user-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.online-user-item:last-child {
    border-bottom: none;
}

.online-user-item .user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.online-user-item .user-name {
    font-weight: 600;
    color: #333;
}

/* ===== USER CONTENT ===== */
.landing-header .user-content {
    display: flex;
    justify-content: flex-end;
    margin-right: 20px;
}

#mobile-sidebar .user-content {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

/* ===== MOBILE SIDEBAR (slides from RIGHT) ===== */
.mobile-sidebar-container {
    position: fixed;
    top: 0;
    right: -320px;
    /* hidden off-screen to the right */
    left: unset;
    width: 280px;
    height: 100%;
    background: var(--ihd-primary-color);
    z-index: 1050;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
}

.mobile-sidebar-container.show {
    right: 0;
    /* slide in from right */
}

/* Overlay backdrop */
.mobile-sidebar-container::before {
    content: none;
    /* handled via JS backdrop if needed */
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 12px;
}

.mobile-sidebar-header .logo-link {
    display: block;
    max-width: 160px;
}

.mobile-sidebar-header .logo-link img {
    width: 100%;
    height: auto;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

#mobile-sidebar #sidebar-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ===== COLOR RULES BY STATE ===== */

/* transparent (landing index, not scrolled) → white */
.landing-header.transparent-header .slide {
    background: rgba(255, 255, 255, 0.4);
}

.landing-header.transparent-header .hot-line,
.landing-header.transparent-header .hot-line i,
.landing-header.transparent-header #notificationDropdown i,
.landing-header.transparent-header #kt_header_user_menu_toggle,
.landing-header.transparent-header #kt_landing_menu .menu-item .menu-link.nav-link,
.landing-header.transparent-header #online-dot-trigger {
    color: #fff;
}

.landing-header.transparent-header #kt_landing_menu .menu-item .menu-link.nav-link::after,
.landing-header.transparent-header #kt_landing_menu .menu-item .menu-link.nav-link:hover::after,
.landing-header.transparent-header #kt_landing_menu .menu-item .menu-link.nav-link.active::after {
    background-color: #fff;
}

/* normal-header → primary color */
.landing-header.normal-header .slide {
    background: var(--ihd-primary-color);
}

.landing-header.normal-header .hot-line,
.landing-header.normal-header .hot-line i,
.landing-header.normal-header #notificationDropdown i,
.landing-header.normal-header #kt_header_user_menu_toggle,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link,
.landing-header.normal-header #online-dot-trigger {
    color: var(--ihd-primary-color);
}

.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link::after,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link:hover::after,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link.active::after {
    background-color: var(--ihd-primary-color);
}

/* scrolled → white text on primary bg */
.landing-header.scrolled .slide {
    background: rgba(255, 255, 255, 0.4);
}

.landing-header.scrolled .hot-line,
.landing-header.scrolled .hot-line i,
.landing-header.scrolled #notificationDropdown i,
.landing-header.scrolled #kt_header_user_menu_toggle,
.landing-header.scrolled #kt_landing_menu .menu-item .menu-link.nav-link,
.landing-header.scrolled #online-dot-trigger,
.landing-header.normal-header .hot-line,
.landing-header.normal-header .hot-line i,
.landing-header.normal-header #notificationDropdown i,
.landing-header.normal-header #kt_header_user_menu_toggle,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link,
.landing-header.normal-header #online-dot-trigger {
    color: #fff;
}

.landing-header.scrolled #kt_landing_menu .menu-item .menu-link.nav-link::after,
.landing-header.scrolled #kt_landing_menu .menu-item .menu-link.nav-link:hover::after,
.landing-header.scrolled #kt_landing_menu .menu-item .menu-link.nav-link.active::after,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link::after,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link:hover::after,
.landing-header.normal-header #kt_landing_menu .menu-item .menu-link.nav-link.active::after {
    background-color: #fff;
}

/* Scrolled: login button */
.landing-header.scrolled .btn.bg-white,
.landing-header.normal-header .btn.bg-white {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Scrolled: avatar border */
.landing-header.scrolled .header-avatar,
.landing-header.normal-header .header-avatar {
    border-color: rgba(255, 255, 255, 0.6);
}

/* Scrolled: hamburger icon */
.landing-header #kt_landing_menu_toggle i {
    color: #fff;
}

/* ===== SIDEBAR MENU COLORS ===== */
#sidebar-content #kt_landing_menu .menu-item .menu-link.nav-link {
    color: #fff;
}

#sidebar-content #kt_landing_menu .menu-item .menu-link.nav-link::after,
#sidebar-content #kt_landing_menu .menu-item .menu-link.nav-link:hover::after,
#sidebar-content #kt_landing_menu .menu-item .menu-link.nav-link.active::after {
    background-color: rgba(255, 255, 255, 0.8);
}

/* ===== LOGO VISIBILITY ===== */
.landing-header .logo-link {
    display: block;
}

.landing-header .pc-online-dot {
    display: block;
}

.landing-header .mobile-online-dot {
    display: none;
}

.landing-header .mobile-logo-link {
    display: none;
}

/* ===== RESPONSIVE: ≤991px (tablet & mobile) ===== */
@media (max-width: 991.98px) {

    /* Single-row header layout */
    .landing-header .container-fluid.p-0 {
        justify-content: space-between;
        align-items: center;
    }

    /* Hide PC-only elements; they live in sidebar */
    .landing-header #kt_header_nav_wrapper,
    .landing-header .hot-line,
    .landing-header .pc-online-dot,
    .landing-header .user-login.logged-out.text-end,
    .landing-header .slide,
    .landing-header .header-top-content {
        display: none !important;
    }

    /* Show hamburger */
    #kt_landing_menu_toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Logo swap */
    .landing-header .logo-link {
        display: none;
    }

    .landing-header .mobile-logo-link {
        display: flex;
        align-items: center;
        background: transparent;
    }

    .landing-header .pc-online-dot {
        display: none;
    }

    .landing-header .mobile-online-dot {
        display: block;
    }

    /* Sidebar blocks */
    #mobile-sidebar #kt_header_nav_wrapper {
        display: block !important;
        flex-grow: 1;
    }

    #mobile-sidebar .user-login.logged-out.text-end {
        display: block !important;
        margin-top: 12px;
    }

    #mobile-sidebar .hot-line {
        display: flex !important;
        margin: 12px 0 8px;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: #fff;
        font-size: 14px;
    }

    #mobile-sidebar .hot-line i {
        color: #fff;
    }

    #mobile-sidebar .flex-equal {
        flex-grow: 0;
    }

    /* Notification badge - keep accessible on mobile within sidebar */
    #mobile-sidebar #notificationList {
        position: static;
        width: 100%;
        max-height: 260px;
        overflow-y: auto;
    }
}

/* ===== RESPONSIVE: ≥992px ===== */
@media (min-width: 992px) {
    #online-dot-trigger {
        cursor: pointer;
        user-select: none;
    }
}

/* ===== TOP MENUX (decorative bar) ===== */
@media all {
    a {
        line-height: 1;
    }

    @media screen and (max-width: 991px) {
        .landing-header .top-menux {
            display: none;
        }
    }

    .landing-header .top-menux {
        z-index: 2;
        width: 100%;
    }

    .landing-header .top-menux .container {
        position: relative;
    }

    .landing-header .top-menux h1 {
        margin: 0;
        font-size: 16px;
        text-align: center;
        color: #fff;
        font-weight: 400;
        text-transform: uppercase;
    }

    .landing-header .top-menux .top-menux-logo {
        position: absolute;
        top: 50%;
        left: 0;
        z-index: 999;
    }

    .landing-header .top-menux .top-menux-logo a {
        display: inline-block;
    }

    .landing-header .top-menux .top-menux-contact {
        width: 149px;
        height: 33px;
        position: absolute;
        top: 35%;
        right: 25px;
    }

    .landing-header .top-menux .top-menux-contact a {
        position: relative;
        text-decoration: none;
        color: #fff;
        font-weight: 700;
        font-size: 13px;
        padding-top: 8px;
        text-align: center;
        display: inline-block;
        width: 100%;
    }

    .landing-header .top-menux .top-menux-contact a img {
        width: 17px;
        margin-right: 5px;
        vertical-align: middle;
    }
}



/* =========================
   MOBILE USER SUBMENU
========================= */

#mobile-sidebar #sidebar_user_submenu {
    max-height: 0;
    opacity: 0;
    visibility: hidden;

    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;

    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;

    transform: translateY(-8px);
    transform-origin: top;

    transition:
        max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0.45s,
        margin-bottom 0.35s ease,
        padding 0.35s ease;
}

#mobile-sidebar #sidebar_user_submenu.is-open {
    max-height: 700px;
    opacity: 1;
    visibility: visible;

    margin-bottom: 8px;
    padding-top: 4px;
    padding-bottom: 4px;

    transform: translateY(0);

    transition:
        max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease 0.05s,
        transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s,
        margin-bottom 0.35s ease,
        padding 0.35s ease;
}

#mobile-sidebar #sidebar_user_submenu a {
    font-size: 14px;
    padding: 10px !important;

    opacity: 0;
    transform: translateX(-8px);

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        opacity 0.2s ease,
        transform 0.25s ease;
}

#mobile-sidebar #sidebar_user_submenu.is-open a {
    opacity: 1;
    transform: translateX(0);
}

/* Hiển thị từng mục lần lượt */
#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(1) {
    transition-delay: 0.04s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(2) {
    transition-delay: 0.06s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(3) {
    transition-delay: 0.08s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(4) {
    transition-delay: 0.1s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(5) {
    transition-delay: 0.12s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(6) {
    transition-delay: 0.14s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(7) {
    transition-delay: 0.16s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(8) {
    transition-delay: 0.18s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(9) {
    transition-delay: 0.2s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(10) {
    transition-delay: 0.22s;
}

#mobile-sidebar #sidebar_user_submenu.is-open a:nth-child(11) {
    transition-delay: 0.24s;
}

#mobile-sidebar #sidebar_user_submenu .sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    padding-left: 14px !important;
}
