/**
 * HMS ULTRA-PREMIUM SIDEBAR 
 * Floating Glassmorphism + Apple Liquid Dynamics
 */

/* Ensure the background has a slight gradient so the glass effect is visible */
#hms-master-app {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f1 100%) !important;
}

/* =========================================
   1. THE FLOATING GLASS PILLAR
   ========================================= */
#hms-sidebar {
    background: var(--hms-white-transparent); /* Highly transparent */
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--hms-border); /* White frosted edg21
    
    display: flex;
    flex-direction: column;
    
    /* Floating Margins & Radius */
    /*height: calc(100% - 40px);*/
    height: 100%;
    width: 260px;
    /*margin: 20px;*/
    border-radius: 15px; /* Big rounded Apple corners */
    
    padding: 0;
    z-index: 20;
    position: relative;
    
    /* Smooth width change when collapsing */
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* =========================================
   2. FLOATING EDGE TOGGLE
   ========================================= */
/* =========================================
   2. FLOATING EDGE TOGGLE (Fixed SVG & Z-Index)
   ========================================= */
#hms-sidebar-toggle {
    position: absolute;
    top: 50px;
    right: -16px; 
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.95); /* Made more solid so it pops over the background */
    border: 1px solid var(--hms-border);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0px;
    cursor: pointer;
    color: var(--hms-black-light);
    z-index: 21; /* Boosted to ensure it's never hidden by content */
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

/* NEW: This forces the SVG inside the toggle to actually have a size! */
#hms-sidebar-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5px; /* Makes the arrow a bit bolder and more energetic */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#hms-sidebar-toggle:hover {
    transform: scale(1.15);
    color: var(--hms-primary);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* =========================================
   3. LOGO AREA
   ========================================= */
.hms-sidebar-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px 20px;
    min-height: 85px;
    transition: all 0.3s ease;
}

.hms-sidebar-logo img {
    max-height: 38px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.08));
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   4. MENU WRAPPER
   ========================================= */
.hms-menu {
    list-style: none !important;
    margin: 10px 0 0 0 !important;
    padding: 0 16px !important;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px !important;
}

.hms-menu::-webkit-scrollbar { width: 4px; }
.hms-menu::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }

/* =========================================
   5. MENU ITEMS & LIQUID BACKGROUND
   ========================================= */
.hms-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    color: var(--hms-black-light);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.2px;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    transition: color 0.5s ease;
    font-family: sans-serif;
}


/* ICON STYLE (Heroicons) */
.hms-menu-item .hms-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    margin-right: 14px;
    color: var(--hms-black-light);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hms-menu-item .hms-icon svg {
    width: 18px;
    height: 18px;
}

/* Hover + Active */
.hms-menu-item.active .hms-icon,
.hms-menu-item:hover .hms-icon {
    background: var(--hms-primary);
    color: #ffffff;
    border-color: var(--hms-primary);
    /*box-shadow: 0 8px 20px rgba(var(--hms-primary-rgb, 117, 21, 33), 0.4);*/
      box-shadow: 0px 4px 14px 1px #00000059;
    transform: scale(1.1) rotate(-3deg);
}

/* COLLAPSED FIX */
/* =========================================
   8. COLLAPSED STATE FIXES
   ========================================= */
/* Re-center the whole flex item so the hover bubble stays centered */
#hms-sidebar.collapsed .hms-menu-item {
    justify-content: center;
    padding: 10px 0;
}

#hms-sidebar.collapsed .hms-menu-item .hms-icon {
    margin-right: 0;
}

/* Make sure the active maroon line stays on the left edge */
#hms-sidebar.collapsed .hms-menu-item.active::before {
    left: -16px;
}


/* The invisible liquid pill behind the text */
.hms-menu-item::after {
    content: '';
    border: 1px solid #00000017;
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.03);
    z-index: -1;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.hms-menu-item:hover {
    color: var(--hms-black);
}

/* On hover, the liquid pill expands smoothly */
.hms-menu-item:hover::after {
    opacity: 1;
    transform: scale(1);
}

/* =========================================
   6. LIQUID BUBBLE ICONS
   ========================================= */
.hms-menu-item .dashicons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.6); /* Frosted glass bubble */
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%; /* Perfect circle */
    margin-right: 14px;
    font-size: 18px;
    color: var(--hms-black-light);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   7. ACTIVE / HOVER STATES
   ========================================= */
.hms-menu-item.active {
    color: var(--hms-primary);
    font-weight: 700;
}

/* Active Liquid Pill turns Maroon-tinted */
.hms-menu-item.active::after {
    /*background: rgba(var(--hms-primary-rgb, 117, 21, 33), 0.08); */
    opacity: 1;
    transform: scale(1);
    /*border: 1px solid rgba(var(--hms-primary-rgb, 117, 21, 33), 0.15);*/
        border: 1px solid #0000004f;
    background: #00000008;
}

/* Active & Hover Icon Bubble turns solid color and pops */
.hms-menu-item.active .dashicons,
.hms-menu-item:hover .dashicons {
    background: var(--hms-primary);
    color: #ffffff !important;
    border-color: var(--hms-primary);
    box-shadow: 0 8px 20px rgba(var(--hms-primary-rgb, 117, 21, 33), 0.4);
    transform: scale(1.1) rotate(-3deg); /* Playful tilt */
}

/* Active Left Edge Indicator (Donezo Style) */
.hms-menu-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    height: 50%;
    width: 4px;
    background: var(--hms-primary);
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 8px rgba(var(--hms-primary-rgb, 117, 21, 33), 0.4);
    z-index: 2;
}

/* =========================================
   8. COLLAPSED STATE (Smooth & Centered)
   ========================================= */
#hms-sidebar.collapsed {
    width: 90px;
}

#hms-sidebar.collapsed #hms-sidebar-toggle {
    transform: rotate(180deg);
}

/* Stack logo and arrow */
#hms-sidebar.collapsed .hms-sidebar-top {
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
}

#hms-sidebar.collapsed .hms-sidebar-logo {
    display: flex;
    padding: 0;
}

#hms-sidebar.collapsed .hms-sidebar-logo img {
    max-width: 45px;
    max-height: 35px;
    object-fit: contain;
}

/* Hide Text Smoothly */
#hms-sidebar.collapsed .hms-menu-text {
    opacity: 0;
    visibility: hidden;
    width: 0;
    display: none;
}

/* Re-center Icons */
#hms-sidebar.collapsed .hms-menu-item {
    justify-content: center;
    padding: 10px 0;
}

#hms-sidebar.collapsed .hms-menu-item .dashicons {
    margin-right: 0;
}

#hms-sidebar.collapsed .hms-menu-item.active::before {
    left: -16px;
}





#hms-sidebar {
    display: flex;
    flex-direction: column;
}

#hms-sidebar .hms-menu {
    flex: 1;
    overflow-y: auto;
}

.hms-sidebar-plan-card {
    position: relative;
    margin: 14px;
    padding: 14px;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(145deg, #111827, #1f2937);
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hms-plan-card-glow {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(215, 155, 72, 0.35);
    filter: blur(10px);
}

.hms-plan-basic .hms-plan-card-glow {
    background: rgba(59, 130, 246, 0.38);
}

.hms-plan-premium .hms-plan-card-glow {
    background: rgba(168, 85, 247, 0.4);
}

.hms-plan-advanced .hms-plan-card-glow {
    background: rgba(16, 185, 129, 0.4);
}

.hms-plan-inactive .hms-plan-card-glow {
    background: rgba(239, 68, 68, 0.35);
}

.hms-plan-card-badge {
    position: relative;
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    margin-bottom: 10px;
}

.hms-plan-card-title {
    position: relative;
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 900;
    color: #ffffff;
}

.hms-plan-card-desc {
    position: relative;
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.78);
}

.hms-plan-card-features {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.hms-plan-card-features span {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hms-plan-card-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    background: #ffffff;
    color: #111827;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hms-plan-card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.18);
    color: #111827;
}

.hms-plan-card-btn-disabled {
    cursor: default;
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.8);
}

.hms-plan-card-btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Collapsed sidebar view */
#hms-sidebar.collapsed .hms-sidebar-plan-card {
    margin: 10px 8px;
    padding: 10px;
    border-radius: 14px;
    text-align: center;
}

#hms-sidebar.collapsed .hms-plan-card-badge,
#hms-sidebar.collapsed .hms-plan-card-desc,
#hms-sidebar.collapsed .hms-plan-card-features,
#hms-sidebar.collapsed .hms-plan-card-btn {
    display: none;
}

#hms-sidebar.collapsed .hms-plan-card-title {
    font-size: 0;
    margin: 0;
}

#hms-sidebar.collapsed .hms-plan-card-title::before {
    content: "★";
    font-size: 18px;
    line-height: 1;
}