﻿/* ================================================================
   UserBar — Base
   ================================================================ */

div#UserBar * {
    box-sizing: border-box;
}

div#UserBar {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    text-align: left;
    font-size: 14px;
    font-family: Tahoma, Helvetica, Arial, "segoe ui", sans-serif;
    color: #333;
    width: 100%;
}

div#UserBar.alone {
    top: 0;
    background: red;
    position: fixed;
    z-index: 100000;
}

div#UserBar a {
    border: 0;
}


/* ================================================================
   Icons — dùng MDI font thay cho sprite PNG
   ================================================================ */

div#UserBar .iCmd {
    float: left;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.15s, background 0.15s;
}

div#UserBar .iCmd:before {
    font-family: "Material Design Icons";
    font-size: 24px;
    line-height: 1;
    font-style: normal;
    font-weight: normal;
}


/* Link icon (iHome) đã bỏ */


/* mdi icons — trạng thái bình thường */

div#UserBar .iHome:before {
    content: "\F11D9";
}


/* mdi-view-grid-outline */

div#UserBar .iNoti:before {
    content: "\F009C";
}


/* mdi-bell-outline */

div#UserBar .iMess:before {
    content: "\F036A";
}


/* mdi-message-outline */


/* mdi icons — trạng thái đang được chọn (Alt) */

div#UserBar .iHome.Alt:before {
    content: "\F0570";
}


/* mdi-view-grid */

div#UserBar .iNoti.Alt:before {
    content: "\F009A";
}


/* mdi-bell */

div#UserBar .iMess.Alt:before {
    content: "\F0369";
}


/* mdi-message */


/* Active: icon sáng hơn */

div#UserBar .iCmd.Alt {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}


/* Badge số thông báo */

div#UserBar .iCmd .iText {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    padding: 0 3px;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    border-radius: 8px;
    box-sizing: border-box;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, .3);
    background: linear-gradient(to bottom, #fa3c45 0%, #dc0d17 100%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    pointer-events: none;
}


/* ================================================================
   Tab Panel — fixed sidebar bên phải
   top / width / height được set bằng JS theo options
   ================================================================ */

#UserBarTabPanel {
    position: fixed;
    right: 0;
    z-index: 9998;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    overflow: hidden;
    font-family: Tahoma, Helvetica, Arial, "segoe ui", sans-serif;
    font-size: 14px;
    color: #333;
}


/* Shadow bên trái khi hiển thị ở chế độ mobile / màn hình nhỏ */

@media (max-width: 1199px) {
    #UserBarTabPanel {
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.18);
    }
}


/* Mỗi tab content: flex column, ẩn mặc định */

#UserBarTabPanel .tabPanelContent {
    display: none;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
}


/* jQuery .show() đặt display:block — override thành flex */

#UserBarTabPanel .tabPanelContent[style*="block"] {
    display: flex !important;
}


/* Header cố định trên cùng mỗi tab */

#UserBarTabPanel .tabPanelHeader {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-bottom: 1px solid #dde3ec;
    background: #f7f8fa;
    min-height: 42px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
}

#UserBarTabPanel .tabPanelTitle {
    font-weight: bold;
    font-size: 1em;
    color: #333;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

#UserBarTabPanel .tabPanelHeader .Link {
    font-weight: bold;
    font-size: 0.9em;
    color: #1c5396;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}

#UserBarTabPanel .tabPanelHeader .Link:hover {
    color: #e74c3c;
    text-decoration: underline;
}


/* Checkbox filter "Chưa xem" trong header iNoti */

#UserBarTabPanel .notiFilterLabel {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85em;
    color: #555;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    user-select: none;
}

#UserBarTabPanel .notiFilterChk {
    cursor: pointer;
    margin: 0;
    accent-color: #1c5396;
}


/* Vùng nội dung cuộn — luôn full width, slimScrollWrapper cần full width */

#UserBarTabPanel .tabPanelBody {
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}


/* slimScroll tạo wrapper div — ép full width để thanh cuộn sát mép phải */

#UserBarTabPanel .tabPanelBody .slimScrollWrapper,
#UserBarTabPanel .tabPanelBody>div[style] {
    width: 100% !important;
    box-sizing: border-box !important;
}


/* ================================================================
   Tab iAppl — danh sách ứng dụng
   ================================================================ */

#UserBarTabPanel .menuItem {
    display: block;
    padding: 9px 14px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    transition: background 0.12s;
}

#UserBarTabPanel .menuItem:hover {
    background: #2565be;
    color: #fff;
}

#UserBarTabPanel .menuItem .appicon {
    float: left;
    font-size: 20px;
    margin-right: 10px;
    color: #2565be;
    line-height: 1.5;
}

#UserBarTabPanel .menuItem:hover .appicon {
    color: #fff;
}

#UserBarTabPanel .menuItem .spAppName {
    display: block;
    overflow: hidden;
    line-height: 1.8;
}

#UserBarTabPanel .menuItem .iAppNoti {
    float: right;
    padding: 1px 5px;
    font-style: normal;
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    background: linear-gradient(to bottom, #fa3c45 0%, #dc0d17 100%);
    margin-top: 4px;
}


/* ================================================================
   Tab iNoti — thông báo
   ================================================================ */

#UserBarTabPanel .notiDetail {
    display: flex;
    align-items: flex-start;
    line-height: 1.4em;
    color: #000;
    border-bottom: 1px solid #e3e8f0;
    padding: 8px 10px;
    min-height: 68px;
    white-space: normal;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
}

#UserBarTabPanel a.notiDetail:hover {
    background: #f5f7fb;
}

#UserBarTabPanel .notiNew {
    background: #FCF8E3;
}


/* Cột trái: avatar */

#UserBarTabPanel .notiAVT {
    flex-shrink: 0;
    height: 52px;
    width: 52px;
    margin-right: 10px;
    border-radius: 3px;
    background: no-repeat center / cover;
}


/* notiAVT dùng MDI icon */

#UserBarTabPanel .notiAVT-memberPending,
#UserBarTabPanel .notiAVT-messagePending {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8eef8;
    font-size: 28px;
    color: #2565be;
}

#UserBarTabPanel .notiAVT-memberPending:before {
    font-family: "Material Design Icons";
    content: "\F0849";
}

#UserBarTabPanel .notiAVT-messagePending:before {
    font-family: "Material Design Icons";
    content: "\F0390";
}


/* Cột phải: nội dung */

#UserBarTabPanel .notiNote {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 0.9em;
}


/* impoDes: flex column — desc trên, notiCmd dưới, canh đều trong cột */

#UserBarTabPanel .notiNote.impoDes {
    display: flex;
    flex-direction: column;
    font-size: 0.92em;
    color: #004f73;
    background: transparent;
}

#UserBarTabPanel .impoDesc {
    padding: 0 0 4px;
    white-space: normal;
    color: #004f73;
    line-height: 1.5;
}

#UserBarTabPanel .impoDesc b {
    color: #0080bb;
    font-size: 0.95em;
}

#UserBarTabPanel .notiTitle {
    font-size: 0.85em;
    font-weight: bold;
    color: #666;
    background: #ededed;
    border-bottom: 1px solid #d0d0d0;
    padding: 7px 12px;
    text-align: center;
}


/* notiCmd: time canh trái, nút canh phải */

#UserBarTabPanel .notiCmd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
    gap: 6px;
    min-height: 24px;
}

#UserBarTabPanel .UpdateTime {
    color: #909090;
    font-size: 0.82em;
    flex-shrink: 0;
}

#UserBarTabPanel .friendName {
    font-weight: bold;
    color: #3b5998;
}

#UserBarTabPanel .impoDes b {
    color: #0080bb;
    font-size: 0.9em;
}


/* ================================================================
   Tab iMess — iframe chat full height
   ================================================================ */

#UserBarTabPanel .tabContent-iMess {
    padding: 0;
}

#UserBarTabPanel .tabContent-iMess iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* ================================================================
   Buttons
   ================================================================ */

.button {
    display: inline-block;
    font-size: 1em;
    color: #000;
    padding: 5px 10px;
    margin-left: 8px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
    border: 1px solid #dcdcdc;
    background: linear-gradient(to bottom, #f7f7f7 0%, #dddddd 100%);
}

.button:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #cccccc 100%);
}

.button.button-small {
    font-size: 0.9em;
    padding: 3px 8px;
}

.button.acceptCmd {
    color: #1c5396;
    border-color: #b0c4de;
    background: aliceblue;
}


/* ================================================================
   Misc
   ================================================================ */

.handCursor {
    cursor: pointer;
}

.ajaxError {
    color: #8f0222;
    padding: 5px 10px;
}

#NeoLoadMore {
    min-height: 40px;
}

div#UserBar .Link {
    display: inline-block;
    font-weight: bold;
    color: #1c5396;
    cursor: pointer;
}


/* see publicStyle.css */

.dataError {
    display: table;
    min-height: 200px;
    height: 100%;
    width: 100%;
    color: #a90329;
}

.dataError div {
    display: table-cell;
    font-size: 16px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.5em;
}


/* ================================================================
   Responsive
   ================================================================ */

@media only screen and (max-width: 568px) {
    #UserBarTabPanel {
        width: 100% !important;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
}