/* JS panel configuration */
.jsPanel {
    z-index: 2000 !important;
}

.tooltip {
    z-index: 2500 !important;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #2B4354;
}

.tab-buttons button {
    flex: 1;
    padding: 4px;
    border: none;
    cursor: pointer;
    background: #FFFCFF;
    color: #2B4354;
}
.tab-buttons button.active {
    background: #2B4354;
    color: #F7D457;
}
.tab-content {
    display: none;
    padding: 10px;
}
.tab-content.active {
    display: block;
}

.tab-section {
    font-weight: bold;
    color: #2B4354;
    background-color: #F7D457;
    border: solid;
    border-color: #2B4354;
    border-radius: 0.3rem;
    padding-left: 6px;
    margin-top: 10px;
}

.tab-chapter {
    margin-top: 10px;
    margin-bottom: 0px;
    font-weight: bold;
}

.setting {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
}

.setting label {
    flex: 1;
    text-align: left;
}

.setting input, .setting select {
    width: 175px;
}
.setting input[type="checkbox"] {
    margin-left: auto;
}

.general_buttons {
    text-align: center;
}
.general_buttons button, #addTag, #removeTag {
    background-color: var(--Dark-blue);
    color: var(--Whiteish);
    border-radius: 0.3rem;
    border: none;
}

#addTag, #removeTag {
    margin: 5px;
}

.specific-set {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.specific-set label {
    display: block;
    text-align: left;
    align-self: flex-start;
}

.specific-set .newRefName {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.specific-set .newRefName input {
    flex: 1;
}

.specific-set .newRefName button {
    flex: 0;
    white-space: nowrap;
    background-color: var(--Dark-blue);
    color: var(--Whiteish);
    border-radius: 0.3rem;
    border: none;
}

.toggler {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
}

/* hide the native checkbox but keep it accessible */
.toggler input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.annot-toggle {
    justify-content: flex-start;
}

/* the track */
.slider {
  position: relative;
  display: inline-block;
  width: 175px;
  height: 24px;
  background: #ccc;
  border-radius: 0.3rem;
  transition: background .25s ease;
}

#map-format +.slider, #annot-style +.slider, #qt-curve +.slider, #qt-curve-dir +.slider, #annot_perform +.slider, #auto_ref + .slider {
    background: var(--Goldish);
}

/* the knob */
.slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  width: 10px;
  height: 20px;
  background: #fff; /*The slider color*/
  border: 1px solid #000;
  border-radius: 0.3rem;
  transition: transform .25s ease;
}

/* the data-on/data-off text inside the track */
.slider::after {
  content: attr(data-off);      /* reads data-off from the .slider element */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  color: var(--Dark-blue);
  pointer-events: none;
}

/* checked state */
.toggler input:checked + .slider {
  background: green;
}
#map-format:checked + .slider, #annot-style:checked + .slider, #qt-curve:checked + .slider, #qt-curve-dir:checked + .slider, #annot_perform:checked + .slider, #auto_ref:checked + .slider {
  background: var(--Dark-blue);
}

.toggler input:checked + .slider::before {
  transform: translateX(157px);
}
.toggler input:checked + .slider::after {
  content: attr(data-on);       /* reads data-on from the .slider element */
  color: var(--Whiteish);
}

#map-format:checked + .slider::after, #annot-style:checked + .slider::after, #qt-curve:checked + .slider::after, #qt-curve-dir:checked + .slider::after {
    color: var(--Goldish);
}

/*Export tab */
.img-btns {
    border-top: 1px solid #2B4354;
    padding-bottom: 5px;
}

.export-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding-bottom: 5px;
    gap: 5px;
    justify-content: space-between;
}

.export-buttons .general_buttons {
    flex: 1 1 auto;
}

/*Dimension flex */
.dimensions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 5px;
    padding-bottom: 5px;
}

.dim-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 5px;
    justify-content: space-between;
    padding-top: 5px;
}

#img-lock {
    flex: 0 0 auto;
    border: none;
    background: none;
    cursor: pointer;
    padding: 3px;
}

.dim-options .specific-setting {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    gap: 5px;
}

.dim-options .specific-setting input, .dim-options .specific-setting select {
    flex: 1 1 auto;
}

.dim-options label {
    flex: 0 0 auto;
}

.bg-settings label {
    align-self: center;
}

#px-info {
    text-align: center;
}
/* Mini preview for image export */
.preview-color {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding-bottom: 5px;
}

#img-bg-color {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
}

#img-preview {
    flex: 1 1 auto;
    width: 100%;
    height: 120px;
    border: 1px solid #aaa;
    border-radius: 0.3rem;
    background: #f8f8f8;
    position: relative;
    overflow: hidden;
}


/* Dragging Rings */
.draggable-table {
    width: 100%;
    border-collapse: collapse;
}
.draggable-table th,
.draggable-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}
.draggable-table th {
    background-color: #f4f4f4;
    font-weight: bold;
}
.draggable-table tbody tr {
    cursor: move;
    transition: background-color 0.2s;
}
.draggable-table tbody tr:hover {
    background-color: #f9f9f9;
}
.dragging {
    opacity: 0.5;
    background-color: #e3f2fd !important;
}
.drag-over {
    border-top: 2px solid #2196F3;
}

/* Help icon (tooltip trigger) */
.help-icon {
    color: #2B4354;
    opacity: 0.55;
    margin-left: 4px;
    font-size: 11px;
    cursor: help;
    vertical-align: middle;
}
.help-icon:hover { opacity: 1; }

/* Tool description blurb in Extended Analysis tabs */
.tool-description {
    font-size: 11px;
    color: #555;
    font-style: italic;
    margin: 6px 0 8px 0;
    padding: 4px 6px;
    border-left: 3px solid #2B4354;
    background: #f8f8f8;
}

/* Feature name inline edit */
.feat-name-input {
    width: 100%;
    border: 1px solid #2B4354;
    border-radius: 0.2rem;
    padding: 1px 4px;
    font-size: inherit;
}
.restore-name-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #2B4354;
    padding: 0 2px;
    font-size: 14px;
    vertical-align: middle;
    opacity: 0.7;
}
.restore-name-btn:hover { opacity: 1; }

.source-sub {
    margin: 0.2rem 1.1rem 0.5rem 0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-left: 2px solid var(--Dark-blue);
}
.tab-chapter-sub {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--Dark-blue);
    opacity: 0.75;
    margin: 0.2rem 0 0.3rem;
}

/* Source filter column headers — align with form-switch width (2.5em) */
.source-filter-col-hdr {
    width: 2.5em;
    text-align: center;
    color: var(--Dark-blue);
}

#source-filters,
#source-filters-rings {
    font-size: 1.1rem;
}

/* Tint Bootstrap switches to HERA palette */
#source-filters .form-check-input:checked,
#source-filters-rings .form-check-input:checked {
    background-color: var(--Dark-blue);
    border-color: var(--Dark-blue);
}

