/**********************
** 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;
}

.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;
}


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

.website-text {
    left: 46px;
    top: 17px;
    position:absolute;
}

.nav-bar {
    position: fixed; /*absolute;*/
    top: 0;
    left: 0;
    width: 100%;
    height: 45px; 
    background-color: #f8fafd; 
    border-bottom: #dfdfdf solid 1px;
    z-index: 1; 
}
.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: 1;
}

.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;
}

#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);
}

.stat-img {
    margin-left: -2px;
}

.navbar-icon {
    font-size: 12px;
    margin-left: 10px;
    margin-top: 16px;
    color: #777777;
}
.navbar-icon-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: pointer;
    width: 170px;
}
.icon-img{
    left: 12px;
    position: absolute;
    top: 8px;
}
/*.logo-text-img {
    margin-left: 10px;
}*/
.display-selector, .filter-selector, .root-selector {
    position: relative;
    padding-left: 15px; 
    z-index: 1;
}

#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;
}

#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;
}

/*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;
    /*height: calc(100vh - 79px);
    box-sizing: border-box;*/
}

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

.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;
}
.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;
}

.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-span {
    background: #ebebea;
    border-radius: 2em;
    padding-left: 4px;
    padding-right: 4px;
    padding-top: 2px;
    padding-bottom: 2px;
    margin-bottom: 7px;
    color: #757575;
    display: table; /*make the fact description appear on next row without the fact date taking up the whole row*/
}

.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: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.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;
    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: hidden; 
}

.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;
} 
.camera-edit-form {
    margin-bottom: -4px;
    margin-top: -4px;
    margin-left: 4px;
}
.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;
    padding-right: 15px;
    gap: 15px;
}

.zoom-slider {
    width: 100px;
    cursor: pointer;
    background: #ddd;
    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;
  }
}