/* ===== Jynx Menu Replica ===== */
.jmenu {
    --acc: #6C5CE7;
    --bg: #0E0E14;
    --bg2: #16161E;
    --bg3: #22222E;
    --txt: #DCDCE6;
    --dim: #6E6E82;
    --sep: #282836;

    width: 732px;
    height: 480px;
    background: var(--bg);
    border-radius: 12px;
    display: flex;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    color: var(--txt);
    overflow: hidden;
    position: relative;
    user-select: none;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.04);
}

/* ===== Sidebar ===== */
.jmenu-sidebar {
    width: 72px;
    min-width: 72px;
    background: var(--bg2);
    border-radius: 12px 0 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.jmenu-sidebar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: var(--sep);
    opacity: 0.4;
}

.jmenu-sidebar-logo {
    width: 56px;
    height: 56px;
    margin-top: 6px;
    object-fit: contain;
}

.jmenu-tabs {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 4px;
    width: 100%;
    gap: 0;
}

.jmenu-tab {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.15s ease;
}

.jmenu-tab:hover {
    background: rgba(255,255,255,0.03);
}

.jmenu-tab svg {
    width: 20px;
    height: 20px;
    color: var(--txt);
    fill: currentColor;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.jmenu-tab.active svg {
    opacity: 1;
}

.jmenu-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--acc);
    border-radius: 0 1.5px 1.5px 0;
}

.jmenu-tab.active {
    background: rgba(108, 92, 231, 0.1);
}

.jmenu-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #50DC78;
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== Content Area ===== */
.jmenu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Header */
.jmenu-header {
    padding: 10px 20px 0 16px;
    flex-shrink: 0;
}

.jmenu-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.jmenu-header-title {
    color: var(--acc);
    font-weight: 600;
    font-size: 14px;
}

.jmenu-header-tab {
    color: var(--dim);
    font-size: 12px;
}

.jmenu-header-sep {
    height: 1px;
    background: var(--sep);
    opacity: 0.4;
    margin-bottom: 6px;
}

/* Search */
.jmenu-search {
    height: 24px;
    background: var(--bg3);
    border-radius: 5px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    margin: 0 20px 6px 16px;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.jmenu-search:focus-within {
    border-color: rgba(108, 92, 231, 0.47);
    background: rgba(34, 34, 46, 0.86);
}

.jmenu-search-icon {
    color: var(--dim);
    font-size: 11px;
    margin-right: 6px;
    opacity: 0.6;
}

.jmenu-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--txt);
    font-family: inherit;
    font-size: 12px;
    flex: 1;
    height: 100%;
}

.jmenu-search input::placeholder {
    color: var(--dim);
    opacity: 0.6;
}

/* Scrollable body */
.jmenu-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 20px 8px 16px;
    scrollbar-width: none;
}

.jmenu-body::-webkit-scrollbar {
    display: none;
}

/* Footer */
.jmenu-footer {
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dim);
    font-size: 11px;
    opacity: 0.6;
    flex-shrink: 0;
}

/* ===== Layout ===== */
.jm-cols {
    display: flex;
    gap: 20px;
}

.jm-col {
    flex: 1;
    min-width: 0;
}

.jm-full {
    width: 100%;
}

/* ===== Section Header ===== */
.jm-section {
    margin-top: 4px;
}

.jm-section:first-child {
    margin-top: 0;
}

.jm-section-sep {
    height: 1px;
    background: var(--sep);
    opacity: 0.4;
    margin: 8px 0 4px;
}

.jm-section-label {
    color: var(--acc);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ===== Toggle Row ===== */
.jm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 24px;
    margin-bottom: 4px;
    padding: 0 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}

.jm-row:hover {
    background: rgba(255,255,255,0.025);
}

.jm-row-label {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jm-row.off .jm-row-label {
    opacity: 0.47;
}

/* Toggle Switch */
.jm-toggle {
    width: 32px;
    height: 14px;
    border-radius: 7px;
    background: var(--bg3);
    border: 1px solid var(--sep);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.jm-toggle.on {
    background: var(--acc);
    border-color: var(--acc);
}

.jm-toggle-knob {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #F0F0F8;
    position: absolute;
    top: 1px;
    left: 1px;
    transition: left 0.2s ease;
}

.jm-toggle.on .jm-toggle-knob {
    left: 19px;
}

/* ===== Slider ===== */
.jm-slider-row {
    margin-bottom: 4px;
    padding: 0 4px;
}

.jm-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 15px;
    margin-bottom: 2px;
}

.jm-slider-label {
    color: var(--dim);
    font-size: 12px;
}

.jm-slider-value {
    color: var(--txt);
    font-size: 12px;
    min-width: 36px;
    text-align: right;
}

.jm-slider-track {
    width: 100%;
    height: 5px;
    background: rgba(34,34,46,0.59);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.jm-slider-fill {
    height: 100%;
    background: var(--acc);
    border-radius: 3px;
    pointer-events: none;
}

.jm-slider-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: inset 0 0 0 3px var(--acc);
}

/* ===== Dropdown ===== */
.jm-dropdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 24px;
    margin-bottom: 4px;
    padding: 0 4px;
}

.jm-dropdown-label {
    font-size: 13px;
    color: var(--txt);
}

.jm-dropdown {
    position: relative;
}

.jm-dropdown-btn {
    width: 120px;
    height: 22px;
    background: var(--bg3);
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--txt);
    font-family: inherit;
    font-size: 12px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: border-color 0.15s;
}

.jm-dropdown-btn.open {
    border-color: var(--acc);
}

.jm-dropdown-arrow {
    color: var(--dim);
    font-size: 10px;
}

.jm-dropdown-list {
    position: absolute;
    top: 24px;
    right: 0;
    width: 120px;
    background: var(--bg2);
    border: 1px solid var(--sep);
    border-radius: 5px;
    z-index: 50;
    display: none;
    overflow: hidden;
}

.jm-dropdown-list.show {
    display: block;
}

.jm-dropdown-item {
    height: 24px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
    color: var(--txt);
    transition: background 0.1s;
}

.jm-dropdown-item:hover {
    background: rgba(108, 92, 231, 0.12);
}

.jm-dropdown-item.selected {
    color: var(--acc);
}

/* ===== Keybind ===== */
.jm-keybind-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 32px;
    margin-bottom: 4px;
    padding: 0 4px;
}

.jm-keybind-label {
    color: var(--dim);
    font-size: 13px;
    opacity: 0.63;
}

.jm-keybind-btns {
    display: flex;
    gap: 4px;
}

.jm-keybind-key {
    width: 80px;
    height: 22px;
    background: var(--bg3);
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--txt);
    font-family: inherit;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s;
}

.jm-keybind-mode {
    width: 52px;
    height: 22px;
    background: var(--bg3);
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s;
    color: rgb(180,180,180);
}

.jm-keybind-mode[data-mode="Toggle"] {
    color: rgb(100,200,255);
}

.jm-keybind-mode[data-mode="Always"] {
    color: rgb(100,255,100);
}

/* ===== Colour Swatch ===== */
.jm-color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 24px;
    margin-bottom: 4px;
    padding: 0 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}

.jm-color-row:hover {
    background: rgba(255,255,255,0.025);
}

.jm-color-swatch {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

/* ===== Collapsible Section (Colours tab) ===== */
.jm-collapsible-header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 8px;
    background: rgba(34,34,46,0.47);
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background 0.15s;
}

.jm-collapsible-header:hover {
    background: rgba(34,34,46,0.7);
}

.jm-collapsible-arrow {
    color: var(--dim);
    font-size: 10px;
    transition: transform 0.2s;
}

.jm-collapsible-header.open .jm-collapsible-arrow {
    transform: rotate(90deg);
}

.jm-collapsible-body {
    display: none;
    padding-left: 8px;
}

.jm-collapsible-body.show {
    display: block;
}

/* ===== Settings tab specials ===== */
.jm-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 22px;
    padding: 0 4px;
    font-size: 12px;
}

.jm-status-dot-inline {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #50DC78;
    flex-shrink: 0;
}

.jm-info-line {
    font-size: 11px;
    color: var(--dim);
    padding: 1px 4px;
    line-height: 1.6;
}

.jm-config-list {
    max-height: 80px;
    overflow-y: auto;
    scrollbar-width: none;
    margin-bottom: 6px;
}

.jm-config-list::-webkit-scrollbar { display: none; }

.jm-config-item {
    height: 24px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
    color: var(--txt);
}

.jm-config-item:hover {
    background: rgba(255,255,255,0.03);
}

.jm-config-item.selected {
    background: rgba(108,92,231,0.15);
    color: var(--acc);
}

.jm-config-input-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.jm-config-input {
    flex: 1;
    height: 24px;
    background: var(--bg3);
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--txt);
    font-family: inherit;
    font-size: 12px;
    padding: 0 8px;
    outline: none;
    transition: border-color 0.15s;
}

.jm-config-input:focus {
    border-color: var(--acc);
}

.jm-config-input::placeholder {
    color: var(--dim);
    opacity: 0.5;
}

.jm-btn {
    height: 24px;
    padding: 0 14px;
    background: var(--bg3);
    border: none;
    border-radius: 5px;
    color: var(--txt);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.jm-btn:hover {
    background: rgba(108,92,231,0.25);
}

.jm-btn-delete:hover {
    background: rgba(230,80,80,0.25);
    color: #E65050;
}

.jm-btn-reset:hover {
    background: rgba(200,160,50,0.25);
    color: #C8A032;
}

.jm-btn-row {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.jm-btn-row .jm-btn {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jm-config-path {
    font-size: 10px;
    color: var(--dim);
    opacity: 0.5;
    padding: 2px 4px;
}

/* ===== Tab panels ===== */
.jm-tab-panel {
    display: none;
}

.jm-tab-panel.active {
    display: block;
}

/* ===== Hidden settings (search filter) ===== */
.jm-row.hidden,
.jm-slider-row.hidden,
.jm-dropdown-row.hidden,
.jm-keybind-row.hidden,
.jm-color-row.hidden {
    display: none;
}

/* ===== Menu wrapper for site ===== */
.menu-demo-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive: allow horizontal scroll on small screens */
@media (max-width: 780px) {
    .menu-demo-wrapper {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 12px;
    }
    .jmenu {
        flex-shrink: 0;
    }
}
