/* ========== Widget wrapper ========== */
#sidebar-menu-widget {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========== Toggle button – always at left viewport edge ========== */
.sm-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 84px;
    background: rgba(0, 0, 0, 0.40);
    border: 1px solid rgba(255,255,255,0.15);
    border-right: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background 0.3s;
    outline: none;
    backdrop-filter: blur(4px);
    gap: 2px;
    padding: 6px 4px;
    box-sizing: border-box;
}

.sm-toggle:hover {
    background: rgba(0, 0, 0, 0.60);
}

/* Top arrow – white */
.sm-toggle-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
    transition: transform 0.3s;
    flex-shrink: 0;
}

/* Expanded: arrow points right */
#sidebar-menu-widget.sm-expanded .sm-toggle-arrow {
    transform: rotate(-135deg);
}

/* "Cata" label – RED */
.sm-toggle-text {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #e63946;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    margin-top: 2px;
}

#sidebar-menu-widget.sm-expanded .sm-toggle-text {
    color: rgba(230,57,70,0.70);
}

/* ========== Panel – slides out right, toggle stays at left edge ========== */
.sm-panel {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 210px;
    background: rgba(10, 10, 30, 0.78);
    border: 1px solid rgba(255,255,255,0.10);
    border-left: 1px solid rgba(255,255,255,0.06);
    border-radius: 0 12px 12px 0;
    backdrop-filter: blur(12px);
    box-shadow: 4px 0 24px rgba(0,0,0,0.50);
    padding: 4px 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
                opacity 0.28s ease,
                visibility 0.28s;
}

#sidebar-menu-widget.sm-expanded .sm-panel {
    visibility: visible;
    opacity: 1;
    transform: translateY(-50%) translateX(40px);
}

/* ========== Menu items – single line, tighter spacing ========== */
.sm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    height: 34px;
    box-sizing: border-box;
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.3;
    border-bottom: 1px dashed rgba(255,255,255,0.09);
    transition: background 0.2s, padding-left 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
}

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

.sm-item:hover,
.sm-item.is-active {
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding-left: 18px;
}

.sm-icon {
    font-size: 15px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    line-height: 1;
}

.sm-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sm-arrow {
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    flex-shrink: 0;
    transition: transform 0.3s, color 0.2s;
}

.sm-item[data-has-children] .sm-arrow {
    display: inline-block;
}

.sm-item.sm-sub-open .sm-arrow {
    transform: rotate(90deg);
    color: #f7c948;
}

/* ========== Submenu – vertical scroll when overflow ========== */
.sm-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    max-height: 0;
    background: rgba(0,0,0,0.18);
    transition: max-height 0.32s cubic-bezier(0.4,0,0.2,1);
}

.sm-sub.open {
    max-height: 220px;
    overflow-y: auto;
}

/* Custom thin scrollbar for submenu */
.sm-sub.open::-webkit-scrollbar {
    width: 4px;
}
.sm-sub.open::-webkit-scrollbar-track {
    background: transparent;
}
.sm-sub.open::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
}
.sm-sub.open::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.35);
}

.sm-sub li {
    border-bottom: 1px dashed rgba(255,255,255,0.06);
}

.sm-sub li:last-child {
    border-bottom: none;
}

.sm-sub a {
    display: block;
    padding: 6px 12px 6px 44px;
    height: 28px;
    box-sizing: border-box;
    color: rgba(255,255,255,0.60);
    text-decoration: none;
    font-size: 11px;
    line-height: 1.3;
    transition: background 0.15s, color 0.15s, padding-left 0.15s;
}

.sm-sub a:hover {
    background: rgba(247,201,72,0.10);
    color: #f7c948;
    padding-left: 48px;
}

/* ========== Overlay ========== */
#sidebar-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
}

#sidebar-menu-overlay.visible {
    display: block;
}
