/* =============================================================================
   1. RESET & BASE
   ============================================================================= */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    font-size: 16px;
    line-height: 1.45;
    font-family: 'Inter', 'Assistant', Arial, sans-serif;
    font-weight: 400;
    color: #2f2f2f;
    background-color: #ffffff;
    direction: ltr;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.rtl {
    font-size: 18px;
    line-height: 1.45;
    font-family: 'Assistant', 'Inter', Arial, sans-serif;
    font-weight: 400;
    color: #2f2f2f;
    direction: rtl;
    text-align: right;
}

/* =============================================================================
   2. TYPOGRAPHY
   ============================================================================= */

h3, h4, h5, h6, p, input, button, select, div, span {
    text-align: left;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    line-height: inherit;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.25;
    font-weight: 600;
    color: #1f1f1f;
    letter-spacing: -0.01em;
    margin: 0 0 20px 0;
}

h2 {
    font-size: 1.8rem;
    line-height: 1.3;
    font-weight: 600;
    color: #222222;
    letter-spacing: -0.005em;
    margin: 0 0 16px 0;
}

h3 {
    font-size: 1.35rem;
    line-height: 1.3;
    color: #262626;
    margin: 20px 0 10px 0;
}

.h3-regular {
    font-weight: 500;
}

.h3-bold {
    font-weight: 600;
}

.h2-bold {
    font-size: 1.5rem;
    font-weight: normal;
    color: #000000;
    margin: 10px 0;
}

p {
    margin: 0 0 12px 0;
    color: inherit;
}

label {
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    color: #333333;
    margin-bottom: 5px;
    line-height: 1.5;
}

/* RTL text alignment */
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl h5, body.rtl h6,
body.rtl p, body.rtl input, body.rtl button, body.rtl select, body.rtl div, body.rtl span {
    text-align: right;
}

body.rtl label {
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    display: inline-block;
    margin-left: 0;
    margin-right: 5px;
}

/* =============================================================================
   3. LAYOUT — Main Container
   ============================================================================= */

#mainContainer {
    display: flex;
    height: calc(100vh - 50px);
    width: 100vw;
    overflow: hidden;
    flex-direction: row;
}

body.rtl #mainContainer {
    flex-direction: row-reverse;
}

/* =============================================================================
   4. TOP PANEL
   ============================================================================= */

#topPanel {
    width: 100%;
    height: 70px;
    background-color: #FFFFFF;
    border-bottom: 1px solid #ccc;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 2000;
}

.topPanelContent {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.topPanelContent label {
    margin-right: 20px;
}

#topPanelText {
    display: flex;
    flex-direction: column;
}

.topPanelTextLine {
    font-size: 0.88rem;
    color: #4a4a4a;
    letter-spacing: 0.01em;
    margin-top: -4px;
}

/* Language selection */
#languageSelection {
    display: flex;
    align-items: center;
    gap: 10px;
}

.languageButton {
    cursor: pointer;
    color: rgb(121, 121, 121);
    background: none;
    border: none;
    font-size: 0.88rem;
}

/* Network wizard */
#networkWizard {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

.wizard-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 24px 40px 20px 40px;
    max-width: 640px;
    width: 90%;
}

.wizard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.wizard-header-text {
    flex: 1;
}

.wizard-icon {
    flex-shrink: 0;
}

.wizard-icon svg {
    width: 110px;
    height: auto;
}

.wizard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 6px 0;
    text-align: left;
}

.wizard-subtitle {
    font-size: 1.0rem;
    font-weight: 700;
    color: #333;
    text-align: left;
    margin: 0;
}

.wizard-columns {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.wizard-column {
    flex: 1;
    min-width: 0;
}

.wizard-column-label {
    font-size: 1.0rem;
    font-weight: 600;
    color: #3a3a3a;
    margin: 0 0 10px 0;
    padding-left: 17px;
}

.wizard-options {
    height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid #e8e8f0;
    border-radius: 8px;
    padding: 4px;
}

.wizard-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
}

.wizard-option:hover {
    background: #f0f0f8;
}

.wizard-option input[type="radio"] {
    accent-color: #1a7cfb;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

.wizard-option span {
    font-size: 0.88rem;
    color: #3a3a3a;
}

.wizard-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.wizard-submit {
    display: block;
    width: 100%;
    padding: 13px;
    background: #1a7cfb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.0rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.wizard-submit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wizard-submit:not(:disabled):hover {
    background: #1567d8;
}

.wizard-actions-step2 {
    flex-direction: row;
    align-items: stretch;
}

.wizard-actions-step2 .wizard-submit {
    flex: 1;
}

.wizard-back {
    flex: 0 0 auto;
    padding: 13px 18px;
    background-color: #ffffff;
    border: 1.5px solid #1a7cfb;
    color: #1a7cfb;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-align: center;
    white-space: nowrap;
}

.wizard-back:hover {
    background-color: #e8f0fe;
}

.wizard-skip {
    background: none;
    border: none;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
    text-decoration: underline;
    flex-shrink: 0;
    margin-left: auto;
}

body.rtl .wizard-skip {
    margin-left: 0;
    margin-right: auto;
}

.wizard-skip:hover {
    color: #444;
}

.wizard-disclaimer {
    margin: 17px 0 0 0;
    padding-top: 0;
    font-size: 0.88rem;
    color: #000000;
    text-align: center;
    line-height: 1.5;
}

body.rtl .wizard-disclaimer {
    text-align: center;
}

.wizard-node-count {
    min-height: 1.4em;
    margin-bottom: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}

.wizard-node-count-ok {
    color: #2a9d5c;
}

.wizard-node-count-zero {
    color: #e8001c;
}

/* ── Wizard Step 3 — Citation Threshold ───────────────────── */
.wizard-threshold-section {
    margin: 8px 0 4px;
}

.wizard-threshold-explanation {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 20px 0;
    padding: 12px 14px;
    background: #f4f7ff;
    border-left: 3px solid #1a7cfb;
    border-radius: 4px;
}
body.rtl .wizard-threshold-explanation {
    border-left: none;
    border-right: 3px solid #1a7cfb;
    font-size: 0.95rem;
    text-align: right;
}

.wizard-threshold-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.wizard-threshold-slider {
    flex: 1;
    accent-color: #1a7cfb;
    height: 6px;
    cursor: pointer;
}

.wizard-threshold-bound {
    font-size: 0.8rem;
    color: #888;
    min-width: 20px;
    text-align: center;
}

.wizard-threshold-value-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.wizard-threshold-label {
    font-size: 0.88rem;
    color: #444;
}
body.rtl .wizard-threshold-label {
    font-size: 0.95rem;
}

.wizard-threshold-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a7cfb;
    min-width: 2.5ch;
    text-align: center;
}

body.rtl .wizard-title,
body.rtl .wizard-subtitle {
    text-align: right;
}

body.rtl .wizard-columns {
    flex-direction: row-reverse;
}

body.rtl .wizard-option {
    flex-direction: row-reverse;
}

body.rtl .wizard-option input[type="checkbox"] {
    margin-left: 8px;
}

body.rtl .wizard-column-label {
    padding-left: 0;
    padding-right: 17px;
}

/* Node selection ripple ring */
@keyframes nodeRipple {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.85; }
    100% { transform: translate(-50%, -50%) scale(4.5); opacity: 0; }
}

.node-ripple {
    position: absolute;
    border-radius: 50%;
    border: 4px solid #e8001c;
    pointer-events: none;
    z-index: 10;
    animation: nodeRipple 0.8s ease-out forwards;
}

/* Node search box */
#nodeSearchContainer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    z-index: 2001;
}

#nodeSearchInput {
    width: 100%;
    padding: 7px 34px 7px 14px;
    border: 1px solid #d0d0d8;
    border-radius: 4px;
    font-size: 0.88rem;
    font-family: inherit;
    box-sizing: border-box;
    background-color: #f0f0f5;
    color: #aaa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#nodeSearchInput:not(:disabled) {
    background-color: #ffffff;
    color: #333;
    border-color: #b0b0c0;
}

#nodeSearchInput:not(:disabled):focus {
    outline: none;
    border-color: #1a7cfb;
    box-shadow: 0 0 0 3px rgba(26, 124, 251, 0.12);
}

#nodeSearchClear {
    display: none;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 13px;
    padding: 0;
    line-height: 1;
    z-index: 1;
}

#nodeSearchClear:hover {
    color: #333;
}

body.rtl #nodeSearchClear {
    right: auto;
    left: 10px;
}

#nodeSearchDropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d0d0d8;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 3000;
    max-height: 260px;
    overflow-y: auto;
}

.node-search-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #2f2f2f;
}

.node-search-item:hover,
.node-search-item.active {
    background-color: #e8f0fe;
    color: #1a7cfb;
}

body.rtl #nodeSearchInput {
    direction: rtl;
    text-align: right;
    padding: 7px 14px 7px 34px;
}

/* Vertical divider between language buttons */
.divider {
    width: 1px;
    height: 20px;
    background-color: gray;
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
}

/* Horizontal section divider (available but currently unused in markup) */
.sub-divider {
    border: none;
    height: 2px;
    background-color: #918d8f;
    margin: 20px 0;
}

/* =============================================================================
   5. LEFT PANEL
   ============================================================================= */

#leftPanel {
    position: fixed;
    left: -560px;
    top: 50px;
    bottom: 50px;
    width: 520px;
    height: calc(100% - 50px);
    background-color: #FFFFFF;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
    border-right: 1px solid black;
    max-height: calc(100% - 50px);
}

#leftPanel.open {
    left: 0;
}

body.ltr #leftPanel {
    padding-left: 20px;
    padding-right: 20px;
}

body.rtl #leftPanel {
    padding-left: 20px;
    padding-right: 20px;
}

#leftPanelContent {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 0;
}

.filter-columns {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-cards-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
}

.filter-cards-row .filter-card {
    flex: 1;
    min-width: 0;
}

.filter-column-title {
    margin: 0;
    font-size: 1.0rem;
    color: #3a3a3a;
    border-left: 3px solid #1a7cfb;
    padding-left: 8px;
}

body.rtl .filter-column-title {
    border-left: none;
    border-right: 3px solid #1a7cfb;
    padding-left: 0;
    padding-right: 8px;
    text-align: right;
}

.filter-node-btn-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-node-btn-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding-right: 14px;
    box-sizing: border-box;
}

body.rtl .filter-node-btn-row {
    padding-right: 0;
    padding-left: 14px;
}

.filter-node-hint {
    font-size: 0.85rem;
    color: #5d5d5d;
    flex: 1;
}

/* Left button panel */
#leftButtonPanel {
    position: fixed;
    left: 0;
    top: 240px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 998;
    transition: left 0.3s ease;
    background-color: #FFFFFF;
    max-height: calc(100% - 50px);
}

#leftButtonPanel.panel-shifted {
    left: 520px;
}

/* =============================================================================
   6. RIGHT PANEL
   ============================================================================= */

#rightPanel {
    position: fixed;
    right: -375px;
    top: 50px;
    height: calc(100% - 50px);
    width: 315px;
    background-color: #FFFFFF;
    border-left: 1px solid #000000;
    transition: right 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1500;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#rightPanel.open {
    right: 0;
    display: block;
}

/* Right button panel */
#rightButtonPanel {
    position: fixed;
    right: 0;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
}

#rightButtonPanel button {
    width: 40px;
    padding: 10px;
    cursor: pointer;
}

/* Right panel content layout */
.right-panel-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 4px;
}

.right-panel-card {
    margin: 0 0 0 -20px;
    padding: 12px 14px 12px 20px;
    border: none;
    border-radius: 0;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.right-panel-card h3 {
    margin: 0;
    font-size: 1.0rem;
    color: #3a3a3a;
    border-left: 3px solid #1a7cfb;
    padding-left: 8px;
}

body.rtl .right-panel-card {
    margin: 0 -20px 0 0;
    padding: 12px 20px 12px 14px;
}

body.rtl .right-panel-card h3 {
    border-left: none;
    border-right: 3px solid #1a7cfb;
    padding-left: 0;
    padding-right: 8px;
    text-align: right;
}

.layout-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout-card-content select {
    padding: 6px 28px 6px 8px;
    border-radius: 4px;
    border: 1.5px solid #1a7cfb;
    font-size: 0.88rem;
    line-height: 1.2;
    color: #1a7cfb;
    font-weight: 700;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a7cfb' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    width: 100%;
}

.layout-card-content select option {
    line-height: 1.2;
    padding: 2px 4px;
}

body.rtl .layout-card-content select {
    background-position: left 8px center;
    padding: 6px 8px 6px 28px;
}

.algorithm-explanation,
.clustering-explanation {
    font-size: 0.88rem;
    color: #555555;
}

.kmeans-k-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.88rem;
}

.kmeans-k-row input[type="number"] {
    padding: 3px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.kmeans-k-row input[type="number"]:disabled {
    background: #f0f0f0;
    color: #aaa;
}

/* =============================================================================
   7. BOTTOM PANEL
   ============================================================================= */

#bottomPanel {
    width: 100%;
    background-color: #FFFFFF;
    position: fixed;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    border-top: 1px solid black;
}

.bottomPanelContent {
    display: grid;
    grid-template-columns: auto auto;
    row-gap: 3px;
    column-gap: 0;
}

.bottomPanelCheckbox {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

body.rtl .bottomPanelCheckbox {
    flex-direction: row-reverse;
    margin-left: 15px;
    margin-right: 0;
}

body.rtl .bottomPanelCheckbox input[type="checkbox"] {
    margin-left: 5px;
}

.bottomPanelContent input[type="checkbox"] {
    margin-right: 5px;
    margin-left: 20px;
}

.bottomPanelContent label {
    margin-right: 20px;
}

/* =============================================================================
   8. SETTINGS PANEL (legacy — kept for safety)
   ============================================================================= */

#settingsPanel {
    width: calc(100% - 675px);
    height: 50px;
    background-color: #d0d0d0;
    border-top: 1px solid #ccc;
    position: fixed;
    bottom: 50px;
    left: 300px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* =============================================================================
   9. NETWORK GRAPH CONTAINER
   ============================================================================= */

#networkGraphContainer {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

#networkGraphContainer .network-instructions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    color: #555;
    padding: 2rem;
    box-sizing: border-box;
}

#networkGraphContainer .network-instructions h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

#networkGraphContainer .network-instructions .instruction-tagline {
    margin: 0.5rem 0 1.5rem;
    font-size: 1rem;
    color: #333;
}

#networkGraphContainer .network-instructions .instruction-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    max-width: 520px;
    width: 100%;
}

#networkGraphContainer .network-instructions .instruction-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #444;
    font-size: 1rem;
    line-height: 1.4;
}

#networkGraphContainer .network-instructions .instruction-item-clickable {
    cursor: pointer;
}

#networkGraphContainer .network-instructions .instruction-item-clickable:hover {
    text-decoration: underline;
}

#networkGraphContainer .network-instructions .instruction-icon {
    width: 40px;
    height: 40px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

body.rtl #networkGraphContainer .network-instructions .instruction-actions {
    align-items: flex-end;
    width: 100%;
    text-align: right;
    padding-right: 1.5rem;
    gap: 1.2rem;
}

/* RTL: force icon to be on the far right reliably across browsers */
body.rtl #networkGraphContainer .network-instructions .instruction-item {
    position: relative;
    flex-direction: row;
    justify-content: flex-start;
    padding-right: 48px;
    text-align: right;
    width: 100%;
    font-size: 1.18rem;
    line-height: 1.5;
}

body.rtl #networkGraphContainer .network-instructions .instruction-item .instruction-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

body.rtl #networkGraphContainer .network-instructions .instruction-item > span:not(.instruction-icon) {
    flex: 1 1 auto;
    text-align: right;
    display: block;
}

/* =============================================================================
   10. LEGEND
   ============================================================================= */

#legendContainer {
    position: fixed;
    top: 90px;
    right: 60px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    border: none;
    border-radius: 5px;
    z-index: 10;
    pointer-events: none;
}

body.rtl #legendContainer {
    margin-left: 0;
    margin-right: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    font-size: 0.75rem;
    color: #2d2d2d;
    font-weight: 500;
}

.legend-color {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    margin-left: 6px;
    border: 1px solid #000;
}

/* =============================================================================
   11. NODE DETAILS / BIO DATA
   ============================================================================= */

#bioDataContainer {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 0;
    padding: 5px;
}

#placeholderText {
    text-align: center;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
}

.data-item {
    margin-bottom: 10px;
    font-size: 0.88rem;
}

.data-item strong {
    display: inline-block;
    width: 100%;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.data-item span {
    display: inline-block;
    width: 100%;
    font-size: 0.88rem;
}

/* Name field with region color dot */
.node-name-value-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-direction: row-reverse;
}

.node-name-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Node details collapsible extra-details section */
.node-details-more-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.node-details-more-header .toggle-advanced {
    display: none;
}

.node-details-more-label {
    font-size: 0.88rem;
    color: #000000;
    text-align: center;
}

.node-details-more-header:hover .node-details-more-label {
    text-decoration: underline;
}

.node-details-more-controls {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.node-details-more-controls.collapsed {
    display: none !important;
}

body.rtl .node-details-more-label {
    text-align: right;
}

/* Connection lists (Refers to / Referred by) */
.connections-section {
    margin-top: 32px;
}

.connections-section-title {
    font-size: 1.0rem;
    font-weight: 600;
    color: #3a3a3a;
    margin-bottom: 6px;
    border-left: 3px solid #1a7cfb;
    padding-left: 8px;
}

.connections-empty {
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
    padding: 2px 0;
}

.connection-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.connection-list.collapsed {
    display: none !important;
}

.connection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #2c2c2c;
    flex-direction: row-reverse;
    justify-content: flex-end;
    transition: background-color 0.15s ease;
}

.connection-item:hover {
    background-color: #ececf5;
}

.connection-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.connection-name {
    flex: 1;
    font-size: 0.88rem;
}

body.rtl .connection-item {
    flex-direction: row-reverse;
}

body.rtl .connection-name {
    text-align: right;
}

body.rtl .connections-section-title {
    text-align: right;
    border-left: none;
    border-right: 3px solid #1a7cfb;
    padding-left: 0;
    padding-right: 8px;
}

/* =============================================================================
   12. CLUSTER MEMBERS
   ============================================================================= */

.cluster-members-section {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cluster-members-section h3 {
    border-left: none !important;
    border-right: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    font-size: 0.88rem;
    font-weight: 600;
    color: #666;
}

.cluster-members-wrapper {
    position: static;
    flex: 1;
}

.cluster-members-container {
    position: static;
    max-height: calc(50vh - 260px);
    overflow-y: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    background-color: #ffffff;
    margin-bottom: 8px;
}

.cluster-members-empty {
    color: #666666;
    font-size: 0.88rem;
}

.cluster-group {
    margin-bottom: 8px;
}

.cluster-group:last-child {
    margin-bottom: -3px;
}

.cluster-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 0.88rem;
    color: #2a2a2a;
}

.cluster-group-title {
    font-weight: inherit;
    font-size: inherit;
}

.cluster-color-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #000000;
    flex-shrink: 0;
}

.cluster-node-list {
    margin: 4px 0 0 0;
    padding: 0;
}

.cluster-node-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #3a3a3a;
    transition: background-color 0.15s ease;
}

.cluster-node-item:hover {
    background-color: #ececf5;
}

/* Network stats grid */
.network-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}

.network-stat-cell {
    background-color: #f4f6fb;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.network-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a7cfb;
}

.network-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

/* Top influencers list */
.top-influencers-list {
    margin-top: 6px;
}

.influencer-name {
    flex: 1;
    font-size: 0.8rem;
}

.influencer-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background-color: #1a7cfb;
    border-radius: 10px;
    padding: 1px 7px;
    flex-shrink: 0;
}

/* =============================================================================
   13. FILTER CONTROLS
   ============================================================================= */

#controls {
    display: contents;
    margin: 0;
    padding: 0;
}

#errorContainer {
    color: red;
    margin-top: 0;
}

/* Filter card */
.filter-card {
    margin: 0 0 0 -20px;
    padding: 12px 14px 12px 20px;
    border: none;
    border-radius: 0;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-left: 3px solid #1a7cfb;
    padding-left: 8px;
}

.filter-card-header h3,
.filter-card-header h4 {
    margin: 0;
    font-size: 1.0rem;
    color: #3a3a3a;
}

.filter-card-actions {
    display: inline-flex;
    gap: 8px;
}

.filter-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-card .selectAllButtons {
    margin-top: 4px;
}

.filter-card .filterCheckboxes {
    border: none;
    border-radius: 0;
    padding: 6px;
    background-color: transparent;
}

body.rtl .filter-card {
    margin: 0 -20px 0 0;
    padding: 12px 20px 12px 14px;
}

body.rtl .filter-card-header {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 3px solid #1a7cfb;
    padding-left: 0;
    padding-right: 8px;
}

body.rtl .filter-card-actions {
    flex-direction: row-reverse;
}

body.rtl .filter-card-header h3,
body.rtl .filter-card-header h4 {
    width: 100%;
    text-align: right;
}

/* Checkboxes */
.filterCheckboxes {
    min-height: 200px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 5px;
    background-color: #fff;
}

.filterCheckboxes label {
    display: flex;
    align-items: baseline;
    color: #3a3a3a;
    font-size: 0.88rem;
}

.filterCheckboxes label input[type="checkbox"] {
    margin-right: 5px;
    vertical-align: middle;
    margin-top: -2px;
}

body.rtl .filterCheckboxes label {
    flex-direction: row-reverse;
    font-size: 0.88rem;
}

body.rtl .filterCheckboxes label input[type="checkbox"] {
    margin-left: 5px;
    margin-right: 0;
    vertical-align: middle;
    margin-top: -2px;
}

.checkbox-container {
    display: table;
    margin-top: 5px;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 1px;
    vertical-align: middle;
}

.checkbox-container label {
    display: table-cell;
    vertical-align: middle;
}

/* Search */
.searchContainer {
    text-align: left;
    margin-bottom: 10px;
}

.searchContainer input[type="text"] {
    width: 100%;
    padding: 7px 14px;
    box-sizing: border-box;
    border: 1px solid #d0d0d8;
    border-radius: 4px;
    font-size: 0.88rem;
    font-family: inherit;
    background-color: #ffffff;
    color: #333;
    outline: none;
    transition: border-color 0.2s ease;
}

.searchContainer input[type="text"]:focus {
    border-color: #1a7cfb;
    box-shadow: 0 0 0 3px rgba(26, 124, 251, 0.12);
}

body.rtl .searchContainer {
    text-align: right;
    margin-bottom: 10px;
}

body.rtl .searchContainer input[type="text"] {
    direction: rtl;
    text-align: right;
}

.hiddenFilterControls {
    display: none;
}

/* Select All / Deselect All buttons */
.selectAllButtons {
    display: flex;
    margin-top: 20px;
    justify-content: space-between;
    width: 100%;
}

.selectAllButtons button {
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid transparent;
    color: #6e6e6e;
    box-shadow: none;
    display: inline-block;
    background-color: transparent;
    cursor: pointer;
}

.selectAllButtons button.selectAllTransparent {
    margin-right: auto;
}

.selectAllButtons button.deSelectAllTransparent {
    margin-left: auto;
}

body.rtl .selectAllButtons button.selectAllTransparent {
    margin-left: auto;
    margin-right: 0;
}

body.rtl .selectAllButtons button.deSelectAllTransparent {
    margin-right: auto;
    margin-left: 0;
}

/* Filter buttons (apply etc.) */
.filter-buttons {
    display: block;
}

.filter-buttons button {
    font-size: 16px;
    border-radius: 8px;
    border: none;
    color: inherit;
    box-shadow: none;
    display: flex;
    padding: 4px 12px;
    background-color: transparent;
    text-align: center;
    white-space: nowrap;
    word-break: keep-all;
    margin-bottom: 10px;
    min-width: 130px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.filter-buttons button.blue {
    background-color: #ffffff;
    border: 1.5px solid #1a7cfb;
    color: #1a7cfb;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.filter-buttons button.blue:hover {
    background-color: #e8f0fe;
}

.filter-buttons label[data-string-key="target_filter_lbl"] {
    margin-top: 20px;
}

.filter-buttons button.apply_button {
    background-color: #1a7cfb;
    border: none;
    color: white;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    min-width: 180px;
    display: block;
    margin: 20px auto;
    margin-bottom: 10px;
    text-align: center;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.filter-buttons button.apply_button:hover {
    background-color: #1567d8;
}

/* Apply row */
.apply-row {
    margin-top: 2px;
    display: flex;
    justify-content: center;
}

/* Sticky Apply row in the left panel (easy to revert):
   Remove this block to disable sticky behavior. */
#leftPanel .apply-row {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding: 6px 0;
    z-index: 6;
    margin-top: -8px;
}

/* Reduce vertical space between Apply row and the checkbox under it */
#leftPanel .apply-row + .checkbox-open-new-tab {
    margin-top: -10px;
}

/* Open in new tab checkbox */
.checkbox-open-new-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.checkbox-open-new-tab .custom-checkbox {
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.checkbox-open-new-tab .custom-label {
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    color: #333;
    cursor: pointer;
}

label[data-string-key="openInNewTab"] {
    font-size: 0.75rem;
    padding: 2px 4px;
    color: #333;
    line-height: 1.2;
    display: block;
    margin: 20px auto;
    text-align: center;
}

/* Inline control */
.inline-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =============================================================================
   14. ADVANCED FILTER
   ============================================================================= */

.advanced-filter-card {
    margin: 0 0 0 -20px;
    padding: 12px 14px 12px 20px;
    border: none;
    border-radius: 0;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.advanced-filter-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.advanced-filter-titlebar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-left: 3px solid #1a7cfb;
    padding-left: 8px;
}

.advanced-filter-titlebar h3 {
    margin: 0;
    flex: 1;
}

body.rtl .advanced-filter-titlebar h3 {
    text-align: right;
}

.advanced-filter-header h3 {
    margin: 0;
    font-size: 1.0rem;
    color: #3a3a3a;
}

.advanced-filter-subtitle {
    font-size: 0.8rem;
    color: #666666;
}

.advanced-filter-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Collapsed state for Advanced Filtering controls */
.advanced-filter-controls.collapsed {
    display: none !important;
}

.advanced-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.advanced-filter-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2c2c2c;
}

.toggle-advanced {
    background: none;
    border: none;
    color: #888;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    margin-right: 3px;
    padding: 0;
    transition: color 0.15s ease;
}

.toggle-advanced:hover {
    color: #222;
}

/* Mirror spacing in RTL so the icon sits on the left with gap */
body.rtl .toggle-advanced {
    margin-left: 0;
    margin-right: auto;
}

.chip-button {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1.5px solid #1a7cfb;
    background-color: #ffffff;
    color: #1a7cfb;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background-color 0.15s ease;
}

.chip-button:hover {
    background-color: #e8f0fe;
}

body.rtl .chip-button {
    justify-content: center;
    text-align: center;
}

.selection-summary {
    font-size: 0.8rem;
    color: #5d5d5d;
}

body.rtl .selection-summary {
    text-align: right;
}

body.rtl .advanced-filter-card {
    text-align: right;
    margin: 0 -20px 0 0;
    padding: 12px 20px 12px 14px;
}

body.rtl .advanced-filter-titlebar {
    border-left: none;
    border-right: 3px solid #1a7cfb;
    padding-left: 0;
    padding-right: 8px;
}

/* =============================================================================
   15. POPUP
   ============================================================================= */

.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 30%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    pointer-events: auto;
}

.centrality-popup {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 75%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    pointer-events: auto;
    justify-content: center;
    align-items: stretch;
}

.centrality-popup-content {
    background-color: #fefefe;
    margin: 0 auto;
    height: 100%;
    width: 90%;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 16px rgba(0,0,0,0.2);
}

.centrality-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e2e2;
    flex-shrink: 0;
}

.popup-content .centrality-popup-header {
    margin: -20px -20px 16px -20px;
}

.centrality-popup-header h2 {
    margin: 0;
    font-size: 1.0rem;
    font-weight: 700;
}

.centrality-popup-header .close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.centrality-popup-header .close:hover {
    color: #333;
}

.centrality-popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.centrality-popup-footer {
    padding: 12px 20px;
    border-top: 1px solid #e2e2e2;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.centrality-section {
    background-color: #f9f9fc;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 12px 14px;
}

.centrality-section h3 {
    font-size: 1.0rem;
    margin: 0 0 4px 0;
}

.centrality-desc {
    font-size: 0.75rem;
    color: #666;
    margin: 4px 0 8px 0;
    line-height: 1.4;
}

.popup-content {
    background-color: #fefefe;
    margin: 26vh auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-height: 80%;
    overflow-y: auto;
    border-radius: 8px;
}

.popup .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

/* RTL: move the close (×) to the left side */
body.rtl .popup .close {
    float: left;
}

.popup .close:hover,
.popup .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.popup-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.popup-buttons button {
    margin-left: 10px;
    padding: 6px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    color: inherit;
    box-shadow: none;
    display: inline-block;
    cursor: pointer;
}

.popup-buttons button.blue {
    background-color: #ffffff;
    border: 1.5px solid #1a7cfb;
    color: #1a7cfb;
    transition: background-color 0.15s ease;
}

.popup-buttons button.blue:hover {
    background-color: #e8f0fe;
}

.popup-buttons button.transparent {
    background-color: transparent;
}

/* =============================================================================
   16. BUTTONS & CONTROLS
   ============================================================================= */

/* Global blue button — secondary, outlined style */
button.blue {
    background-color: #ffffff;
    border: 1.5px solid #1a7cfb;
    color: #1a7cfb;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background-color 0.15s ease;
}

button.blue:hover {
    background-color: #e8f0fe;
}

/* Close button */
.closeButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background-color: transparent;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease;
}

.closeButton:hover {
    color: #333;
}

.closePanelsButtons {
    display: flex;
    margin-top: 0px;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
}

/* Tighten only the left panel's space under the title without moving the title itself */
#leftPanel .closePanelsButtons {
    padding: 12px 0 0px;
}

/* Settings panel checkboxes */
.settingsPanelContent {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.settingsPanelCheckbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

/* Styled checkboxes */
.styled-checkbox {
    margin-top: 6px;
    margin-left: 8px;
}

.styled-checkbox + label {
    margin-left: 8px;
    color: #6e6e6e;
    font-size: 14px;
}

body.rtl .styled-checkbox {
    margin-left: 0;
    margin-right: 10px;
}

body.rtl .styled-checkbox + label {
    margin-left: 0;
    margin-right: 10px;
    color: #6e6e6e;
    font-size: 14px;
}

/* Icon buttons */
.icon-button {
    width: 46px;
    height: 46px;
    margin: 10px 10px 10px 5px;
    border: none;
    background-color: transparent;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    display: inline-block;
}

.icon-button::before,
.icon-button::after {
    content: none;
}

.create-network {
    background-image: url('./icons/v5/new.ico');
}

.filter-network {
    background-image: url('./icons/filter.ico');
}

.save-network {
    background-image: url('./icons/v5/export.ico');
}

.load-network {
    background-image: url('./icons/v5/import.ico');
}

.icon-button-small {
    width: 30px;
    height: 30px;
    margin: 10px 10px 10px 5px;
    border: none;
    background-color: transparent;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    display: inline-block;
}

.zoom-in {
    background-image: url('./icons/zoom-in.ico');
}

.zoom-out {
    background-image: url('./icons/zoom-out.ico');
}

.node-info {
    background-image: url('./icons/node_info.ico');
}

.view-settings {
    background-image: url('./icons/v5/network analysis.ico');
}

.physics-settings {
    background-image: url('./icons/view_settings.ico');
}

.physics-run-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.physics-btn-run {
    width: 70%;
    padding: 6px 0;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 4px;
    border: 1.5px solid #1a7cfb;
    cursor: pointer;
    background-color: #ffffff;
    color: #1a7cfb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.physics-btn-run:hover {
    background-color: #e8f0fe;
}

.physics-btn-reset {
    background-color: transparent;
    border: none;
    color: #1a7cfb;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 0;
    transition: text-decoration 0.15s ease;
}

.physics-btn-reset:hover {
    text-decoration: underline;
}

.physics-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.physics-slider-label {
    width: 85px;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: #3a3a3a;
}

.physics-slider-value {
    width: 28px;
    font-size: 0.8rem;
    text-align: right;
    flex-shrink: 0;
    color: #555;
}

.physics-slider-row input[type="range"] {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

/* Edge count filter card */
.edge-count-range-info {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.edge-count-inputs-row {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.edge-count-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.edge-count-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.88rem;
    color: #3a3a3a;
    box-sizing: border-box;
}

.edge-count-input:focus {
    outline: none;
    border-color: #1a7cfb;
}

/* =============================================================================
   17. BRANDING
   ============================================================================= */

.textObject_poweredBy {
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-style: italic;
    color: #000000;
    padding-top: 3px;
    margin-right: -2px;
}

.textObject_Jewdit {
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #00bfff;
    text-decoration: none;
}

.textObject_Jewdit:hover {
    text-decoration: underline;
}

.textObject_JewditLab {
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #4a4a4a;
    margin-top: -8px;
}

.textObject_RabbiNet {
    font-family: Arial, sans-serif;
    font-size: 30px;
    color: #000000;
    padding-top: 4px;
    margin-bottom: -3px;
}

.placeholder {
    visibility: hidden;
}

/* =============================================================================
   18. ABOUT POPUP
   ============================================================================= */

.about-popup {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.about-popup-content {
    background-color: #fefefe;
    width: 1100px;
    max-width: 95%;
    height: 80vh;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.about-popup-body {
    padding: 24px;
    margin-top: 14px;
    overflow-y: auto;
    flex: 1;
}

.about-section {
    margin-bottom: 24px;
}

.about-h3 {
    font-size: 1.0rem;
    font-weight: 700;
    color: #3a3a3a;
    border-left: 3px solid #1a7cfb;
    padding-left: 8px;
    margin: 0 0 10px 0;
}

.about-popup-body p {
    font-size: 0.88rem;
    color: #3a3a3a;
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.about-list {
    font-size: 0.88rem;
    color: #3a3a3a;
    line-height: 1.6;
    padding-left: 20px;
    margin: 0;
}

.about-list li {
    margin-bottom: 8px;
}

.about-link {
    color: #1a7cfb;
    text-decoration: none;
    word-break: break-all;
}

.about-link:hover {
    text-decoration: underline;
}

/* Language visibility for About popup */
.about-lang-he {
    display: none;
}
body.rtl .about-lang-en {
    display: none;
}
body.rtl .about-lang-he {
    display: block;
}

/* RTL heading border on right side */
body.rtl .about-h3 {
    border-left: none;
    border-right: 3px solid #1a7cfb;
    padding-left: 0;
    padding-right: 8px;
}

/* RTL list padding */
body.rtl .about-list {
    padding-left: 0;
    padding-right: 20px;
}

/* Hebrew About popup — larger font sizes */
body.rtl .about-popup-body p,
body.rtl .about-list {
    font-size: 0.95rem;
}
body.rtl .about-h3 {
    font-size: 1.1rem;
}

/* ── About popup tab bar ─────────────────────────────────── */
.about-tabs {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
    gap: 0;
    background: #fefefe;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    position: relative;
    z-index: 1;
}

.about-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 18px 10px;
    cursor: pointer;
    font-size: 1.0rem;
    font-weight: 700;
    color: #3a3a3a;
    font-family: inherit;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}
.about-tab-btn:hover {
    color: #1a7cfb;
}
.about-tab-btn.active {
    color: #1a7cfb;
    border-bottom: 3px solid #1a7cfb;
}

/* Show/hide tab label spans based on language */
.about-tab-label-he {
    display: none;
}
body.rtl .about-tab-label-en {
    display: none;
}
body.rtl .about-tab-label-he {
    display: inline;
}

/* RTL tab bar direction */
body.rtl .about-tabs {
    direction: rtl;
}

/* ── Corpus tab ──────────────────────────────────────────── */
.about-corpus-intro {
    font-size: 0.88rem;
    color: #3a3a3a;
    line-height: 1.6;
    margin: 0 0 14px 0;
}
body.rtl .about-corpus-intro {
    font-size: 0.95rem;
}

.about-corpus-list-wrap {
    overflow-y: auto;
    max-height: 52vh;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px 16px;
    direction: rtl; /* always RTL — content is always Hebrew */
}

.about-corpus-subheading {
    margin: 16px 0 8px 0;
    border-right: 3px solid #1a7cfb;
    padding-right: 8px;
    text-align: right;
}
.about-corpus-subheading:first-child {
    margin-top: 0;
}

.about-corpus-subheading-he {
    font-size: 0.95rem;
    font-weight: 700;
    color: #3a3a3a;
}

.about-corpus-subheading-en {
    font-size: 0.75rem;
    font-weight: 400;
    color: #888;
    display: block;
    text-align: right;
}
body.rtl .about-corpus-subheading-en {
    display: none;
}

.about-corpus-ul {
    list-style: disc;
    padding-right: 20px; /* RTL: bullets on the right */
    padding-left: 0;
    margin: 0 0 4px 0;
    font-size: 0.88rem;
    color: #3a3a3a;
    line-height: 1.7;
    text-align: right;
    direction: rtl;
}
body.rtl .about-corpus-ul {
    font-size: 0.95rem;
}
