/* Toggle switch */
.lsj-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.lsj-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.lsj-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.lsj-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 20px;
}
.lsj-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}
input:checked + .lsj-slider {
    background-color: #007cba;
}
input:checked + .lsj-slider:before {
    transform: translateX(20px);
}
.lsj-toggle-label {
    font-size: 12px;
    color: #666;
}

/* Off-canvas panel */
.lsj-offcanvas-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90%;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
    transition: right 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
}

.lsj-offcanvas-panel.lsj-panel-open {
    right: 0;
}

.lsj-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.lsj-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.lsj-panel-content input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#lsj-results {
    font-size: 14px;
    line-height: 1.4;
}

#lsj-results ul {
    list-style: none;
    padding: 0;
}

#lsj-results li {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Popup improvements */
.lsj-hover-popup {
    position: fixed;  /* changed from absolute to stay within viewport */
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 8px 12px;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10000;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Long press button */
.lsj-longpress-btn {
    position: absolute;
    background: #007cba;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.lsj-longpress-btn:hover {
    background: #005a87;
}

/* Tap button (mobile) */
.lsj-tap-btn {
    position: absolute;
    background: #007cba;
    color: #fff;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.lsj-tap-btn:hover {
    background: #005a87;
}

.lsj-tappable {
    -webkit-touch-callout: none; /* iOS */
    user-select: none; /* all browsers */
}

/* Lookup button for mobile */
.lsj-lookup-btn {
    position: absolute;
    background: #007cba;
    color: #fff;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    white-space: nowrap;
}
.lsj-lookup-btn:hover {
    background: #005a87;
}