/**********************
** Login page styles **
***********************/
.login-page {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
}

.login-page form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 300px;
}
.login-page input[type="text"],
.login-page input[type="password"],
.login-page button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
}
.login-page button {
    background-color: #007BFF;
    color: #fff;
    border: none;
    cursor: pointer;
}

.login-page button:hover {
    background-color: #0056b3;
}

.login-page .shake {
    animation: shake 0.3s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}
.login-page #errorMessage {
    color: red;
    display: none;
    font-size: 14px;
}

.logout-button-div {
    position: absolute;
    top: 12px;
    right: 15px;
    z-index: 1;
}

.admin-key-button-div {
    position: absolute;
    top: 12px;
    right: 48px; /* sits just to the left of logout icon */
    z-index: 1;
}

.admin-key-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    text-decoration: none;
}

.admin-key-icon {
    width: 22px;
    height: 22px;
    transition: filter 0.2s ease;
    filter: invert(0);
}

.admin-key-button:hover .admin-key-icon {
    filter: brightness(0.6);
    cursor: pointer;
}

/*
.logout-button {
    text-decoration: none;
    padding: 6px 14px;
    background: white;
    color: #414141;
    border-radius: 5px;
    font-size: 12px;
    border: solid #b7b7b7 1px;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: #e8e6e6; 
    color: #000000; 
    border-color: #9c9c9c; 
    cursor:pointer;
}
*/
.logout-button-div {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1;
}

/* No button look */
.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    text-decoration: none;
}

/* Icon base style */
.logout-icon {
    width: 26px;    /* adjust as needed */
    height: 26px;
    transition: filter 0.2s ease;
    filter: invert(0);           /* normal state */
}

/* Strong hover effect to confirm it's working */
.logout-button:hover .logout-icon {
    filter: brightness(0.6);
    cursor: pointer;
}



/**********************
** Main page styles **
***********************/
html, body {
    margin: 0px;
    padding: 0px;
    width: 100%;
    height: 100%;
    font-family: Helvetica;
    overflow: hidden;
}

.website-text {
    /*left: 46px;*/
    left: 8px;
    top: 16px;
    position:absolute;
    cursor: default;
}

body.showing-charts .website-text {
    cursor: pointer;
}

.nav-bar {
    position: fixed; /*absolute;*/
    top: 0;
    left: 0;
    width: 100%;
    height: 45px; 
    background-color: #f8fafd; 
    border-bottom: #dfdfdf solid 1px;
    z-index: 10000; /* High z-index to stay above chart content */
}
.nav-bar-2 {
    display: flex;
    align-items: center; /* vertically centers dropdowns */
    justify-content: space-between;
    position: fixed;
    top: 46px;
    left: 0;
    width: 100%;
    height: 32px;
    background-color: #eef3ff; /*#f7f7f7;*/
    border-bottom: #dfdfdf solid 1px;
    z-index: 10000; /* High z-index to stay above chart content */
}

.tree-stats {
    position: absolute;
    top: 5px;
    right: 20px;
}

/*.photo-modal-content table tbody td {
    margin: 4px;
}
.photo-modal-content table thead th {
    font-weight: normal !important;
}*/

#document-count-stat, #people-count-stat {
    margin-right: -5px;
}

#document-count-img, #photo-count-img {
    margin-top: -1px;
}
#document-count-img{
    margin-left:-3px !important;
}

.settings-icon, .filter-icon {
    height: 15px;
    /*filter: brightness(1.5);*/
    filter: grayscale(1) brightness(1.4);
    transform: translateY(3.5px);
    /*cursor: pointer;*/
}
/*.settings-icon:hover, .filter-icon:hover {
    filter: brightness(0.6);
}*/

#photo-count-stat {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      cursor: pointer;
      color: #5e5e5e;
      font-size: 11px;
      transition: filter 0.2s;
      filter: brightness(1.2);
}

#people-count-stat, #document-count-stat {
    filter: invert(0.6);
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #5e5e5e;
    font-size: 11px;
    transition: filter 0.2s;
}

#photo-count-stat:hover {
    filter: brightness(0.6);
}
#photo-count-stat.c-disabled {
    filter: invert(0.6);
    cursor: default;
}

#photo-count-stat.c-disabled:hover {
    filter: invert(0.6);
}
.stat-img {
    margin-left: -2px;
}

.navbar-icon {
    font-size: 12px;
    margin-left: 10px;
    margin-top: 16px;
    color: #777777;
}
.navbar-icon .icon-img {
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}

.navbar-icon .icon-img:hover {
  transform: scale(1.1);
  /*filter: brightness(1.2);*/
  opacity: 0.85;
}
.navbar-icon-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
    width: 170px;
}
.icon-img{
    /*left: 12px;*/
    position: absolute;
    /*top: 8px;*/
    top: 12px;
}
/*.logo-text-img {
    margin-left: 10px;
}*/
.display-selector {
    position: relative;
    padding-left: 10px; 
    z-index: 1;
}
.root-selector {
    position: relative;
    padding-left: 4px; 
    z-index: 1;
}
.filter-selector {
    position: relative;
    padding-left: 15px; 
    z-index: 1;
}
.chart-tab-inline-host {
    display: none;
}

body.showing-charts .display-selector {
    display: none;
}

body.showing-charts .nav-bar-2 {
    justify-content: flex-start;
    gap: 4px;
}

body.showing-charts .filter-selector {
    padding-left: 10px;
}

body.showing-charts .root-selector {
    padding-left: 2px;
}

body.showing-charts .chart-tab-inline-host {
    display: flex;
    align-items: center;
    min-width: 0;
    margin-left: 2px;
}

#root-selector:disabled {
    cursor: not-allowed;
    opacity: 0.6; /* optional, gives a nice dimmed effect */
}

#filter-selector, #display-selector, #root-selector {
    cursor:pointer;
    padding: 4px 4px;
    background: #ffffff;
    color: #6e6e6e;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 12px;
    /*margin-left: 4px;*/
}

#root-selector {
    width: 145px;
}

#filter-selector, #display-selector {
    width: 120px;
}

.navbar2-text {
    font-size: 11px;
    color: #888888;
}

.main-page input {
    font-size:14px !important;
}


.sidelines-group {
    display: flex;
    flex-direction: column;
    align-items: center;   /* centers label + icons horizontally */
    justify-content: center;
    margin-left: 6px;     /* keeps a bit of space before stats */
    margin-top: -2px;
}
/* Container for the label + both buttons */
.sidelines-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px; /* space between collapse & expand icons */
    margin-top: 2px;
    margin-right: 8px;
}

/* Small grey label for the control pair */
.sidelines-label {
    text-align: center;
    font-size: 9.5px;
    color: #777;
    margin-bottom: -2px; /* tight spacing */
    letter-spacing: 0.3px;
    padding-right: 7px;
}

.collapse-label, .expand-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.collapse-toggle:hover, .expand-toggle:hover {
    cursor: pointer;
    filter: brightness(0.6);
}

.collapse-toggle, .expand-toggle {
    cursor: pointer;
}

.expand-toggle{
    padding-top: 1px; /*clearly a tiny diff between expand and collapse icon that needed to be accounted for*/
}
.disabled-sideline-btn {
    opacity: 0.35;
    pointer-events: none;      /* disables clicks */
    cursor: default !important;
    filter: none !important;   /* disables your hover dimming */
}

.disabled-sideline-btn img {
    filter: grayscale(100%);
}

/* Binary ancestor tree checkbox toggle */
.binary-tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.binary-tree-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.binary-tree-label input[type="checkbox"] {
    width: 13px;
    height: 13px;
    cursor: pointer;
    accent-color: #5f73be;
}

.binary-tree-label-text {
    font-size: 9.5px;
    color: #777;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* ──── Binary ancestor tree ──── */

#binary-ancestor-tree {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    overflow: hidden;
    z-index: 2;
}

#binary-ancestor-tree .bat-canvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    cursor: grab;
}

#binary-ancestor-tree .bat-canvas:active {
    cursor: grabbing;
}

/* Raise edit form above the binary tree overlay */
body.binary-tree-active .bft-edit-form {
    z-index: 100 !important;
}
body.binary-tree-active .bft-edit-form-close {
    z-index: 101 !important;
}

/* --- Node card (matches Balkan 250×110 template) --- */
.bat-node {
    position: absolute;
    width: 250px;
    height: 110px;
    background: #fff;
    border-radius: 5px;        /* rx="5" ry="5" in Balkan SVG rect */
    border: 2px solid #ccc;
    overflow: visible;         /* cert circles peek below */
    cursor: pointer;
    font-family: Helvetica, 'Segoe UI', Arial, sans-serif;
}

/* Gender-specific border (matching .node.male/female>rect) */
.bat-node.bat-male    { border-color: #4495f7; }
.bat-node.bat-female  { border-color: #fd4a69; }

/* Hover: darken stroke like standard tree (no box-shadow) */
.bat-node.bat-male:hover    { border-color: #0068e5; }
.bat-node.bat-female:hover  { border-color: #d60025; }

/* Colored header strip – inner radius = outer 5px − 2px border = 3px */
.bat-header {
    height: 35px;
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b1b9be;
}

.bat-node.bat-male .bat-header    { background: #6aa3fc; }
.bat-node.bat-female .bat-header  { background: #f56f6f; }

/* Hover header colours (matching .node.male/female:hover .first_rect) */
.bat-node.bat-male:hover .bat-header    { background: #5093fd; }
.bat-node.bat-female:hover .bat-header  { background: #f35858; }

/* Separator line below header, coloured per gender (like Balkan <line y1="32">) */
.bat-node::after {
    content: '';
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    height: 2px;
    background: #b1b9be;
}
.bat-node.bat-male::after    { background: #4495f7; }
.bat-node.bat-female::after  { background: #fd4a69; }

/* Name – matches Balkan node_name: 18px, normal weight, white, centred */
.bat-name {
    color: #fff;
    font-size: 18px;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
    line-height: 35px;
    padding: 0 10px;
}

/* Body: photo + details side by side (mimics Balkan cx=45/cy=71 photo + x=100 text) */
.bat-body {
    display: flex;
    padding: 5px 8px 2px 8px;
    gap: 12px;
    height: 73px;
    box-sizing: border-box;
    align-items: flex-start;
}

/* Circular photo (Balkan clip-path circle r=30 → 60px diameter, centered at cy=71 → ~5px from body top) */
.bat-photo-wrap {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    margin-top: 1px;
}

.bat-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid;
    box-sizing: border-box;
    background: #b1b9be;
    display: block;
}

.bat-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bat-photo-empty::after {
    content: '?';
    font-size: 20px;
    color: #e0e0e0;
}

/* Text fields (match Balkan box1 at y=64 → ~10px into body, box2 at y=84 → ~30px) */
.bat-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    padding-left: 3px;
}

.bat-dob {
    font-size: 15px;
    color: #5e5e5e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bat-birthplace {
    font-size: 15px;
    color: grey;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
    display: flex;
    align-items: center;
}
.bat-bp-unknown {
    margin-left: 2px;
}

/* Flag icon inline with birthplace text (exact Balkan size: 28×21) */
.bat-flag {
    width: 28px;
    height: 21px;
    margin-right: 4px;
    flex-shrink: 0;
}

/* ── Additional node icons (camera, military-hat, boat, book) ── */
/* Right-aligned next to the cert circles so there's no gap with fewer icons */
.bat-icons {
    position: absolute;
    bottom: -14px;
    right: 90px;           /* just left of cert area (3×24 + 2×3 + 10 + 2 extra gap) */
    display: flex;
    gap: 2px;
    align-items: center;
}

.bat-icons img {
    width: 28px;
    height: 28px;
}

/* Newspaper icon – vertically centred on the right border */
.bat-newspaper {
    position: absolute;
    top: calc(50% + 6px);
    transform: translateY(-50%);
    right: -17px;
    width: 44px;
    height: 44px;
    opacity: 0.9;
}

/* Cert circles (b / m / d) – vertically centred on the node bottom edge */
.bat-certs {
    position: absolute;
    bottom: -12px;
    right: 10px;
    display: flex;
    gap: 3px;
}

.bat-certs svg {
    display: block;
}

/* SVG connector lines */
.bat-lines {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.bat-lines line {
    stroke: #aeaeae;
    stroke-width: 2;
    stroke-linejoin: round;
}

/* Hollow circle joint at spouse-bar midpoint (matches Balkan toggle--hollow) */
.bat-joint {
    fill: #fafafa;
    stroke: #b1b9be;
    stroke-width: 1.5;
}

#tree {
    position: relative !important;
    width: 100% !important;
    /*height: calc(100vh - 79px) !important;*/ /* fill remaining space under navbars */
    top: 79px !important; /* start below navbars - 79 total inc 1px border-bottoms*/
    left: 0 !important;
}

/*
 * Fullscreen: only #tree is promoted. Reset the normal `top: 79px` / panel height so #tree fills
 * the viewport (navbars are children of #tree but `position: fixed` to the window — see
 * `.bft-edit-form` rule below for z-index / offset).
 */
#tree:fullscreen {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: none !important;
}

/*in fullscreen mode the svg automatically takes 100% of viewport (going under the navbars) unless you overwrite here*/
#tree:fullscreen svg {
    margin-top: 79px;
    /*height: calc(100vh - 79px) !important;*/
    box-sizing: border-box;
}

#tree:fullscreen .tree-stats {
    margin-top: 79px;
    box-sizing: border-box;
}

/*
 * Navbars are inside #tree but `position: fixed; z-index: 10000`. Balkan `.bft-edit-form` is
 * `position: fixed; top: 0` with z-index ~1–100, so the top of the sheet (incl. the name) paints
 * underneath the navbars. In fullscreen this is obvious — start the form below the 79px stack.
 */
#tree:fullscreen .bft-edit-form {
    top: 79px !important;
    height: calc(100vh - 79px) !important;
    max-height: calc(100vh - 79px) !important;
    justify-content: flex-start !important;
}

/*
 * Fullscreen: the close SVG is `position: absolute` with `top` in normal mode; inside the tall
 * header (180px) that sits the icon oddly vs the padded title. Use a grid so row 1 is [spacer |
 * title | close] with align-items: center so the X lines up with the name.
 */
#tree:fullscreen .bft-edit-form-header {
    display: grid !important;
    grid-template-columns: 40px 1fr 40px;
    grid-template-rows: auto;
    /* Without this, a single `auto` row stretches to fill the fixed 180px height, vertically
       centering the title + close and leaving a huge gap above — while the avatar stays at top:70px,
       so it lands on top of the name. */
    align-content: start !important;
    align-items: center;
    column-gap: 4px;
    padding: 10px 6px 0 6px;
    box-sizing: border-box;
    height: 180px !important;
    position: relative !important;
}

#tree:fullscreen .bft-edit-form-close {
    position: static !important;
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    top: auto !important;
    right: auto !important;
    margin: 0 !important;
}

#tree:fullscreen .bft-edit-form-title {
    grid-column: 2;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    align-self: center;
}

/*
 * Avatar stays out of the grid (same as Balkan: absolute + centered). Do not use grid row 2 /
 * relative positioning here — that broke horizontal centering and vertical overlap vs normal mode.
 */
#tree:fullscreen .bft-edit-form-avatar {
    position: absolute !important;
    top: 70px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
}


/* Normal mode: tree takes the full panel height */
body:not(.showing-charts) #tree {
  height: calc(100vh - 79px) !important;
}
/* Same specificity + :fullscreen so height wins over the rule above when in fullscreen */
body:not(.showing-charts) #tree:fullscreen {
  height: 100vh !important;
  min-height: 100vh !important;
}
/* Charts mode: let #tree shrink to navbars only */
body.showing-charts #tree {
  height: 79px !important;
}
body.showing-charts #tree:fullscreen {
  height: 100vh !important;
  min-height: 100vh !important;
}
/* In charts mode, hide the Balkan SVG completely */
body.showing-charts #tree svg {
  display: none !important;
}
body.showing-charts #display-selector {
  pointer-events: none;
  opacity: 0.5;
}
body.showing-charts .sidelines-group,
body.showing-charts #collapse-sidelines-toggle {
  display: none !important;
}
body.showing-charts .zoom-slider-div {
  pointer-events: none;
  opacity: 0.5;
}
body.showing-charts .fullscreen-control {
  pointer-events: none;
  opacity: 0.5;
}
/* In charts mode, disable the chart icon */
body.showing-charts #open-charts-img, body.showing-charts #apy_toggle_btn {
    pointer-events: none;    
    opacity: 0.4;            
    cursor: default;         
}

/* In fullscreen mode, chart icon should also be disabled */
#tree:fullscreen #open-charts-img {
    pointer-events: none;
    opacity: 0.4;
    cursor: default;
}


.hover-heart {
  pointer-events: all;
  cursor: pointer;
}

/*.hover-heart.is-collapsed {
  filter: brightness(0) saturate(100%) invert(47%) sepia(100%) saturate(747%) hue-rotate(1deg) brightness(104%) contrast(108%);
}

.hover-heart:hover {
  filter: brightness(0) saturate(100%) invert(22%) sepia(90%) saturate(3381%) hue-rotate(347deg) brightness(99%) contrast(89%);
  cursor: pointer;
}*/
/* Collapsed (+) icon – soft grey instead of orange */

.hover-heart.is-collapsed {
  filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(90%) contrast(100%);
}

/* Hover – darker grey highlight, not orange */
.hover-heart:hover {
  filter: brightness(0) saturate(100%) invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(85%) contrast(100%);
  cursor: pointer;
}



.heart-plus {
  font-family: sans-serif;
  font-size: 18px;
  paint-order: stroke;
  stroke: black;
  stroke-width: 0.3;
}
.heart-minus {
  font-weight: bold;
  font-size: 18px;
}

.bft-edit-form {
    z-index:1;
    border-radius: 0em !important;
}

/* Fix edit form positioning in charts mode */
body.showing-charts .bft-edit-form {
    position: fixed !important;
    z-index: 10000 !important;
}


.bft-edit-form-title {
    font-size: 24px !important;
}

.bft-edit-form-instruments{
    min-height:10px !important; /*overwrite the default 70px because we've turned off the Edit, Share, To PDF buttons*/
    display: none;
}

.bft-edit-form-fields{
    padding-top: 20px;
}

.male .bft-edit-form-header, .male {
    background-color: #6aa3fc;
    border-radius: 0px;
}

.female .bft-edit-form-header, .female {
    background-color: #f56f6f;
    border-radius: 0px;
}

.node {
    cursor: pointer;
    pointer-events: auto;
}

.node * {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.node.male:hover .first_rect {
    fill: #5093fd !important; /*darker blue*/
}
.node.female:hover .first_rect {
    fill: #f35858 !important; /*darker red*/
}
.node.male:hover>rect {
    stroke: #0068e5 !important;
}
.node.female:hover>rect {
    stroke: #d60025 !important;
}

[data-ctrl-up-id] {
    --circle-color: #fff;  /* Default white background */
    --icon-color: #b1b9be; /* Default tree color */
    --border-color: #b1b9be; /* Default border */
}

[data-ctrl-up-id]:hover {
    --icon-color: #818282; /* Change tree to yellow on hover */
}

.node.male>rect {
    fill:#6aa3fc; 
    stroke: #4495f7;
}

.node.male>line {
    stroke: #4495f7;
}

.second_rect {
    fill: white !important;
}

.node.female>rect {
    fill:#f56f6f; 
    stroke: #fd4a69;
}

.node.female>line {
    stroke: #fd4a69;
}

.occupation-li {
    margin-bottom: 5px;
    margin-right: 4px;
    background: #fff1a3;
    border-radius: 2em;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 2px;
    padding-bottom: 2px;
    list-style-type: none;
    display: inline-block;
    color: #757575;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
}

.cause-of-death-li {
    margin-bottom: 5px;
    margin-right: 4px;
    background: #fcdddd;
    border-radius: 2em;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 2px;
    padding-bottom: 2px;
    list-style-type: none;
    display: inline-block;
    color: #757575;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 95%;
}

.timeline-li {
    margin-bottom: 14px;
    margin-right: 4px;
    padding-top: 2px;
    padding-bottom: 2px;
    list-style-type: none;
    color: #757575;
}

.timeline-date-age-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
}

.timeline-span {
    background: #ebebea;
    border-radius: 2em;
    padding-left: 4px;
    padding-right: 4px;
    padding-top: 2px;
    padding-bottom: 2px;
    color: #757575;
    display: inline-block;
}

.timeline-age-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: default;
    vertical-align: middle;
}

.timeline-age-hint:focus {
    outline: none;
}

.timeline-age-hint:focus-visible .timeline-age-tag {
    box-shadow: 0 0 0 2px rgba(117, 117, 117, 0.35);
}

.timeline-age-tag {
    background: #f3f3f2;
    border-radius: 2em;
    padding: 1px 7px 2px;
    font-size: 11px;
    line-height: 1.35;
    color: #9a9a9a;
    white-space: nowrap;
}

.timeline-age-tooltip {
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(-4px);
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.3;
    color: #fafafa;
    background: rgba(58, 58, 58, 0.9);
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease-out, visibility 0.12s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 100;
}

.timeline-age-hint:hover .timeline-age-tooltip,
.timeline-age-hint:focus .timeline-age-tooltip {
    opacity: 1;
    visibility: visible;
}

.sub_fact_ul {
    margin-top: 5px; 
    padding-left: 20px;
    font-size: 12px;
}

/*reposition the icons that allow you to switch between the ancestors of 2 siblings*/
g[data-ctrl-up-id] > use:first-of-type {
    transform: scale(0.8) translate(69px, 0px);
}

.notes-text-area{
    width: 100%;          
    height: 150px;        
    resize: none;         
    font-family: Arial, sans-serif; 
    font-size: 14px;      
    padding: 10px;        
    border: 1px solid #ccc; 
    box-sizing: border-box; 
    margin-top: 30px;
}

#loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid rgba(0, 0, 0, 0.1);
    border-top: 6px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

.spinner.small-spinner {
    width: 30px;
    height: 30px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

body.modal-open {
    overflow: hidden;
}

.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px; 
    overflow: hidden; 
}

.photo-modal-content {
    position: relative;
    display: flex;
    flex-direction: column; /* Ensures vertical stacking */
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 20px;
    max-width: 80%;
    max-height: 90vh; /* Ensures modal does not exceed viewport height */
    border-radius: 8px;
    text-align: center;
    z-index: 100000;
    overflow: hidden; /* Prevents content from overflowing */
}

#map-iframe {
    width: 55vw;
    height: 35vw;
    border: 0;
    pointer-events: auto;
}

.map-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 20px;
    max-width: 80%;
    max-height: 90vh; 
    border-radius: 8px;
    text-align: center;
    z-index: 100000;
    overflow: auto; 
}

.admin-activity-modal-content {
    background: #fff;
    border-radius: 10px;
    width: min(1200px, 92vw);
    max-height: 82vh;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    padding: 12px 12px 14px 12px;
}

.admin-activity-title {
    margin: 2px 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #444;
}

.admin-activity-note {
    font-size: 11.5px;
    color: #666;
    margin: -2px 0 10px 0;
}

.admin-activity-note code {
    font-family: Menlo, Consolas, monospace;
    font-size: 11px;
    color: #555;
    background: #f2f2f2;
    padding: 1px 4px;
    border-radius: 4px;
}

.admin-activity-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 8px;
}

#admin-activity-user-filter {
    min-width: 140px;
    max-width: 220px;
    font-size: 12px;
    color: #555;
    border: 1px solid #d3d3d3;
    border-radius: 5px;
    background: #fff;
    padding: 3px 6px;
}

.admin-activity-date-filters {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

.admin-activity-copy-btn {
    margin-left: auto;
    border: 1px solid #d3d3d3;
    background: #fff;
    color: #555;
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 9px;
    cursor: pointer;
    white-space: nowrap;
}

.admin-activity-copy-btn:hover {
    background: #f5f7fc;
}

.admin-date-btn {
    border: 1px solid #d2d5e2;
    background: #fff;
    color: #666;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
}

.admin-date-btn:hover {
    background: #f5f7fc;
}

.admin-date-btn.active {
    border-color: #5f73be;
    background: #5f73be;
    color: #fff;
}

.admin-activity-table-wrap {
    max-height: calc(82vh - 90px);
    overflow: auto;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
}

.admin-activity-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
    color: #444;
}

.admin-activity-table thead th {
    position: sticky;
    top: 0;
    background: #f5f7fb;
    z-index: 1;
    font-weight: 500;
}

.admin-activity-table th,
.admin-activity-table td {
    text-align: left;
    border-bottom: 1px solid #ececec;
    padding: 6px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-activity-table th:nth-child(1), .admin-activity-table td:nth-child(1) { width: 10%; }
.admin-activity-table th:nth-child(2), .admin-activity-table td:nth-child(2) { width: 13%; }
.admin-activity-table th:nth-child(3), .admin-activity-table td:nth-child(3) { width: 13%; }
.admin-activity-table th:nth-child(4), .admin-activity-table td:nth-child(4) { width: 13%; }
.admin-activity-table th:nth-child(5), .admin-activity-table td:nth-child(5) { width: 8%; }
.admin-activity-table th:nth-child(6), .admin-activity-table td:nth-child(6) { width: 12%; } /* Host */
.admin-activity-table th:nth-child(7), .admin-activity-table td:nth-child(7) { width: 10%; } /* IP */
.admin-activity-table th:nth-child(8), .admin-activity-table td:nth-child(8) { width: 21%; } /* User Agent */

.admin-activity-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.admin-activity-pagination button {
    border: 1px solid #d3d3d3;
    background: #fff;
    color: #555;
    border-radius: 6px;
    font-size: 12px;
    padding: 3px 8px;
    cursor: pointer;
}

.admin-activity-pagination button:disabled {
    opacity: 0.5;
    cursor: default;
}

#admin-activity-page-info {
    font-size: 11.5px;
    color: #666;
    min-width: 86px;
    text-align: center;
}

.map-modal-description {
    margin-top: 12px;
    text-align: left;
    max-height: 160px;
    overflow-y: auto;
}

.photo-nav-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    background: rgb(190 190 190 / 70%);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 100000; /* Ensures it appears above everything */
    border-radius: 50%;
}
.photo-nav-btn:hover {
    background: grey;
}

.prev-btn {
    left: 5%;
    display:none;
}

.next-btn {
    right: 5%;
    display:none;
}

.photo-modal-img {
    max-width: 100%;
    max-height: calc(80vh - 100px); /* Prevents the image from overflowing modal */
    display: block;
    border-radius: 5px;
    object-fit: contain; /* Maintains aspect ratio without cropping */
}

.logout-button:disabled {
    background-color: #ccc !important;  
    color: #666 !important;             
    cursor: not-allowed !important;     
    border: 1px solid #999 !important;  
    opacity: 0.6; 
}

.photo-counter {
    font-size: 15px;
    color: grey;
    padding-bottom: 5px;
    transform: translateY(-4px);
    max-width: 100%;
    word-wrap: break-word;
}
.photo-details-txt {
    font: 13px / 28px Helvetica, "Segoe UI", Arial, sans-serif;
    overflow-y: auto;
    text-align: left;
    width:0;
    min-width:100%;
    max-width:100%;
    padding-left: 2px;
    padding-right: 2px;
}
.photo-people{
    color: #5d5d5d;
    margin-top: -2px;
}
.photo-date{
    color: #5d5d5d;
    margin-top: 5px;
}

.photo-description{
    color: #5d5d5d;
    width: 0;
    min-width: 100%;
    max-height: 120px;
    font-size: 13px;
    display: block;
    line-height: 1.8em;
}
/*when it's the only descriptor appearing on the modal we want to ensure it's not too tight to the photo*/
.photo-description.spaced {
    margin-top: 10px;
}

.photo-details-txt::-webkit-scrollbar, .photo-modal-content::-webkit-scrollbar-track  {
    width: 5px; /* Thin scrollbar */
}

.photo-details-txt::-webkit-scrollbar-track, .photo-modal-content::-webkit-scrollbar-track {
    background: #f1f1f1; /* Light grey track */
    border-radius: 10px;
}

.photo-details-txt::-webkit-scrollbar-thumb, .photo-modal-content::-webkit-scrollbar-thumb {
    background: #888; /* Darker grey scrollbar */
    border-radius: 10px; /* Rounded edges */
    transition: background 0.3s;
}

.photo-details-txt::-webkit-scrollbar-thumb:hover, .photo-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555; /* Darker on hover */
}

.external-link-icon {
    width: 25px;
    height: 25px;
    filter: invert(1); /*white*/
}
.download-doc-icon {
    width: 25px;
    height: 25px;
    filter: invert(1); /*white*/   
}
.download-doc-btn {
    position: fixed;
    top: 12px;
    right: 55px;
    padding: 10px;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.download-doc-btn:hover {
    filter: invert(0.3);
}
.external-link-btn {
    position: fixed;
    top: 15px;
    right: 95px;
    padding: 10px;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.external-link-btn:hover {
    filter: invert(0.3);
}

.close-modal-btn {
    position: fixed;
    top: 10px;
    right: 15px;
    padding: 10px;
    cursor: pointer;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-in-out;
}

.close-modal-icon {
    width: 34px;
    height: 34px;
    filter: invert(1);
}

.close-modal-btn:hover {
    filter: invert(0.3);
}     

.newspaper-edit-form {
    margin-top: -9px;
    margin-bottom: -9px;
} 
.war-edit-form {
    margin-top: -5px;
    margin-bottom: -5px;
} 
.letter-edit-form {
    margin-bottom: -7px;
    margin-top: -10px;
}
.camera-edit-form {
    margin-bottom: -4px;
    margin-top: -4px;
    margin-left: 4px;
}
.crew-list-edit-form {
    margin-bottom: -2px;
}
.family-story-edit-form {
    margin-bottom: -8px;
    margin-top: -8px;
}
.prison-edit-form {
    margin-top: -5px;
    margin-bottom: -5px;
}
.edit-page-tags {
    margin-left: 9px;
    margin-bottom: 10px;
}
.edit-page-tags:empty {
    display: none;
}
.speculative, .inquest {
    font-size: 11px;
    font-weight: normal;
    margin-left: 6px;
    color: white;
    padding: 2px 4px 2px 4px;
    border-radius: 2em;
    position: absolute;
}
.speculative{
    background: #f4ae57;
}
.inquest{
    background: #fb7676;
}

/*hide default library zoom/full-screen controls*/
.bft-toolbar-container {
    position: absolute;
    right: 20px;
    bottom: 20px;
    background: none;
    border: none;
}

.bft-toolbar-container svg {
    display: none !important;
}

.library-controls {
    /*position: absolute;
    right: 15px;*/
    display: flex;
    align-items: center;
    margin-left: auto;
    /*gap: 15px;*/
}
.stat-controls{
    display: flex;
    align-items: center;
    gap: 15px;
    border-right: 1px #cacaca solid;
    padding-right: 6px;
    align-self: stretch;
}
.fullscreen-control{
    display: flex;
    align-items: center;
    padding-right: 7px;
}
.fullscreen-control-exit{
    display: flex;
    align-items: center;
    padding-right: 7px;
}
.zoom-slider-div {
    display: flex;
    align-items: center;
    padding-left: 6px;
    padding-right: 6px;
}

.zoom-slider {
    width: 100px;
    cursor: pointer;
    background: #ddd;
    accent-color: #5f73be;
    border-radius: 5px;
    outline: none;
}

#fullscreen-button {
    filter: invert(0.5); 
    width: 28px;
    height: 28px;
    cursor: pointer;
}
#fullscreen-button:hover {
    filter: invert(0.2); 
}

#exit-fullscreen-button {
    filter: invert(0.5);
    width: 18px;
    height: 18px;
    cursor: pointer;
}
#exit-fullscreen-button:hover {
    filter: invert(0.2); 
}
/*overwrite dynamically added font or it will mess positioning up of navbar on fullscreen*/
.bft-light {
    font: inherit !important;
}
/*apply to the input buttons specifically*/
.bft-input {
    font: 13px / 28px Helvetica, "Segoe UI", Arial, sans-serif;
}

/*overwrite the original svg shape to close the edit page which was clunky and replace with the other close icon I'm using throughut the site*/
.bft-edit-form-close {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16 16L12 12M12 12L8 8M12 12L16 8M12 12L8 16" stroke="%23000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: block;
    right: 8px !important;
    top: 9px !important;
    width: 34px;
    height: 34px;
    filter: invert(1);
}
.bft-edit-form-close:hover {
    filter: invert(0.2);
}

/* hide the default edit page close icon */
.bft-edit-form-close path {
    display: none !important;
}

.bft-edit-form-header {
    height: 180px !important;
}

.bft-edit-form-avatar {
    width: 135px !important;
    height: 135px !important;
    top: 70px !important;
    z-index: 2;
}

/*hide navbar components as losing browser width*/
@media (max-width: 859px) {
  #people-count-stat, #document-count-stat, #photo-count-stat {
    display: none;
  }
}

@media (max-width: 720px) {
  #zoom-slider {
    display: none;
  }
}

@media (max-width: 600px) {
  #fullscreen-button {
    display: none;
  }
}

@media (max-width: 570px) {
  .navbar2-text {
    display: none;
  }
}

.cvd-key {
  font-size: 10px;
  color: #7a7a7a;
  margin-left: 118px;
  transform: translateY(-2px); 
}

.cvd-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  margin-right: 5px;
}

.cvd-icon {
  vertical-align: middle;
}

/* --- SOLID toggles (parents/partners with children) --- */
.toggle:not(.toggle--hollow) circle {
  fill: #b1b9be;
  transition: fill 0.15s ease;
}
.toggle.collapsed:not(.toggle--hollow) circle {
  fill: #f8c733;           /* orange base */
}
.toggle:not(.toggle--hollow):hover circle {
  fill: #9ea5aa;           /* darker grey on hover */
}
.toggle.collapsed:not(.toggle--hollow):hover circle {
  fill: #FF9800;           /* brighter orange on hover */
}

/* --- Cursor --- */
.toggle { cursor: pointer; }
.toggle.toggle--disabled { cursor: default; }

/* --- HOLLOW spouse dots (no children) --- */
/* We draw TWO circles in JS for hollow:
   1) .toggle-mask  (fills background to hide the line)
   2) .toggle-ring  (stroke-only ring) */
.toggle.toggle--hollow .toggle-mask {
  fill: #fff !important;   /* match your light bg; change if dark mode */
}
.toggle.toggle--hollow .toggle-ring {
  fill: none !important;
  stroke: #b1b9be;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.toggle.toggle--hollow:hover .toggle-ring {
  stroke: #9ea5aa;
}

/* --- Symbol text --- */
.toggle-symbol {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 600;
}
