/* =============================================
   FLATSOME SIDEBAR MENU - CSS
   ============================================= */

/* Container chính */
.flatsome-sidebar-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 9999;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Nút toggle hamburger */
.sidebar-toggle {
   
    width: 100%;
    height: 42px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    border-radius: 0px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
   
}

/* Trong chế độ thu gọn */
.sidebar-collapsed .sidebar-toggle {
   
    
}

/* Hamburger icon */
.hamburger {
    width: 20px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    border-radius: 1px;
}

/* Animation hamburger khi mở */
.sidebar-expanded .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    top: 7px;
    position: absolute;
}

.sidebar-expanded .hamburger span:nth-child(2) {
    opacity: 0;
}

.sidebar-expanded .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    top: 7px;
    position: absolute;
}

/* Nội dung sidebar */
.sidebar-content {
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 0;
    box-shadow: 2px 0 20px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

/* Trạng thái thu gọn */
.sidebar-collapsed .sidebar-content {
    width: 70px;
}

.sidebar-collapsed .menu-text,
.sidebar-collapsed .sidebar-follow h4,
.sidebar-collapsed .social-links,
.sidebar-collapsed .sidebar-buttons,
.sidebar-collapsed .submenu,
.sidebar-collapsed .arrow {
    display: none;
}

/* Menu wrapper */
.menu-wrapper {
    padding: 0 10px;
}

/* Menu list */
.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-list li {
    margin-bottom: 5px;
}

.menu-list li > a {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    color: #fff;
    text-decoration: none;
    border-radius: 0px;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

.menu-list li > a:hover {
    
   
	background: linear-gradient(267.03deg, rgb(24, 255, 182) 12.02%, rgb(0, 163, 133) 47.51%, rgb(7, 109, 101) 103.82%);
  border-width: 1px 0px 1px 1px;
  border-style: solid none solid solid;
  border-color: transparent currentcolor transparent transparent;
  border-image: linear-gradient(347.17deg, rgba(0, 74, 52, 0) 100.34%, rgb(255, 255, 254) 100.53%) 1;
	
}

.menu-list li > a img {
    width: 42px;
    height: 42px;
    margin-right: 12px;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Arrow cho accordion */
.arrow {
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #fff;
    transition: transform 0.3s ease;
}

.has-submenu.active .arrow {
    transform: rotate(180deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.3);
    margin: 5px 0;
    border-radius: 8px;
}

.has-submenu.active .submenu {
    max-height: 500px;
}

.submenu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 5px;
}

.submenu-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    color: #fff;
    text-decoration: none;
    border-radius: 0px;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 12px;
	background: linear-gradient(171.62deg,rgba(7,109,101,.4) 6.42%,rgba(0,32,30,.4) 93.58%) !important;
}

.submenu-grid a:hover {
  background: linear-gradient(1turn,#04413c,#076d65 25.6%,#00c29e),radial-gradient(54.11% 78.92% at 29.64% -6.12%,rgba(0,255,166,.6) .79%,rgba(26,183,171,0) 100%) !important;
  transform: translateY(-2px);
  color: #fff;
}

.submenu-grid a img {
  width: 38px;
  height: 38px;
  margin-bottom: 5px;
}

.submenu-grid a span {
    display: block;
    line-height: 1.2;
}

/* Sidebar follow */
.sidebar-follow {
    margin: 30px 15px 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-follow h4 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-links a {
    display: inline-block;
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.social-links a img {
    width: 20px;
    height: 20px;
}

/* Sidebar buttons */
.sidebar-buttons {
    padding: 0 15px;
    margin-top: 20px;
}

.sidebar-buttons a {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-livechat {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: #fff;
}

.btn-livechat:hover {
    background: linear-gradient(45deg, #ff5252, #ff7979);
    transform: translateY(-1px);
}

.btn-telegram {
    background: linear-gradient(45deg, #0088cc, #0099dd);
    color: #fff;
}

.btn-telegram:hover {
    background: linear-gradient(45deg, #007bb3, #0088cc);
    transform: translateY(-1px);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: -1;
}

.sidebar-expanded .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* Sidebar fallback */
.sidebar-fallback {
    padding: 20px;
    color: #fff;
    text-align: center;
}

.sidebar-fallback p {
    margin: 10px 0;
    font-size: 14px;
    opacity: 0.8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar-collapsed .sidebar-content {
        width: 60px;
    }
    
    .sidebar-content {
        width: 260px;
    }
    
   .menu-list li > a {
    padding: 10px 2px;
  }
    
  .menu-list li > a img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
  }
    
    .submenu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .sidebar-toggle {
        width: 100%;
        height: 35px;
        right: 12px;
    }
    
    .sidebar-collapsed .sidebar-toggle {
       
    }
    
    .hamburger {
        width: 18px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .sidebar-content {
        width: 240px;
    }
    
    .sidebar-collapsed .sidebar-content {
        width: 55px;
    }
    
    .submenu-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .sidebar-buttons a {
        font-size: 11px;
        padding: 8px;
    }
}

/* Animation cho smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Đảm bảo sidebar không bị che bởi admin bar */
body.admin-bar .flatsome-sidebar-menu {
    top: 32px;
    height: calc(100vh - 32px);
}

@media (max-width: 782px) {
    body.admin-bar .flatsome-sidebar-menu {
        top: 0px;
        height: calc(100vh - 46px);
        display: none;
    }
}

/* Tối ưu cho theme Flatsome */
.flatsome-sidebar-menu * {
    box-sizing: border-box;
}

.flatsome-sidebar-menu a {
    outline: none;
}

.flatsome-sidebar-menu img {
    max-width: 100%;
    height: auto;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .sidebar-content {
        background: linear-gradient(135deg, #0a0a0a 0%, #1c1c1c 100%);
    }
}