html, body {
    font-family: Arial, sans-serif;
    font-size: 0.95em;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-width: 0;
    height: 100%;
    color: #eee;
    overflow: hidden;
}

body {
    background-color: #977B5B;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25' viewBox='0 0 1200 800'%3E%3Cdefs%3E%3CradialGradient id='a' cx='0' cy='800' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2373675c'/%3E%3Cstop offset='1' stop-color='%2373675c' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='b' cx='1200' cy='800' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23786d4d'/%3E%3Cstop offset='1' stop-color='%23786d4d' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='c' cx='600' cy='0' r='600' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2345554e'/%3E%3Cstop offset='1' stop-color='%2345554e' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='d' cx='600' cy='800' r='600' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23977B5B'/%3E%3Cstop offset='1' stop-color='%23977B5B' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='e' cx='0' cy='0' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%233D4D5C'/%3E%3Cstop offset='1' stop-color='%233D4D5C' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='f' cx='1200' cy='0' r='800' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%234D5C3D'/%3E%3Cstop offset='1' stop-color='%234D5C3D' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect fill='url(%23a)' width='1200' height='800'/%3E%3Crect fill='url(%23b)' width='1200' height='800'/%3E%3Crect fill='url(%23c)' width='1200' height='800'/%3E%3Crect fill='url(%23d)' width='1200' height='800'/%3E%3Crect fill='url(%23e)' width='1200' height='800'/%3E%3Crect fill='url(%23f)' width='1200' height='800'/%3E%3C/svg%3E");
    background-attachment: fixed;
    background-size: cover;
}

h1 {
    text-align: center;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.5);
    background-color: rgba(0,0,0,0.2);
    padding: 8px;
    margin: 20px;
    border-radius: 8px;
}

h2 { 
    padding: 8px 0; 
    margin: 0px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

summary {
    cursor: pointer;
    font-weight: bold;
    color: #d0d0d0;
    margin: 12px 0px;
    font-size: 1.2em;
}

p { 
    color: #aaa; 
    margin: 12px 0px;
}

svg { 
    overflow: visible; 
    cursor: move;
}

.container {
    display: flex;
    gap: 20px;
    margin: 0 20px;
    height: calc(100% - 130px);
}

.left-column {
    flex: 0 0 350px; /* fixed width */
    max-width: 350px;
    min-width: 350px;
    padding: 2px 20px 20px;
    background-color: #303030;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: scroll;
}

.left-column::-webkit-scrollbar {
    width: 6px;
}
.left-column::-webkit-scrollbar-track {
    background: transparent;
}
.left-column::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.25);
    border-radius: 3px;
}
.left-column::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.45);
}

.left-column-wrapper {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
    display: flex;
    height: 100%;
}

.right-column {
    flex: 1 1 0%; /* take remaining space */
    padding: 2px 20px 20px;
    background-color: #303030;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
}

.about {
    position: absolute;
    top: 30px;
    right: 40px;
}

.about a {
    color: hsl(210, 50%, 70%);
}

.section-header {
    padding: 0px 12px 0px;
    border-radius: 6px 6px 0 0;
    background-color: hsl(210, 20%, 30%);
    background-color: hsl(210, 33%, 33%);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
    margin: 24px 0px 0px;
}

.input-section {
    padding: 2px 12px 12px;
    background-color:#383838;
    border-radius: 0 0 6px 6px;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
    margin: 0px 0px 1px;
}

/* Filter input and clear button styling moved from index.html */
.filter-container {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input {
    flex: 1;
    padding-right: 2em;
}

.clear-filter-button {
    position: absolute;
    right: 0.3em;
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
}

.right-shortcut {
    display: inline-block;
    vertical-align: middle;
    font-size: 0.7em;
    padding-top: 0.1em;
    padding-left: 4px;
}

.preset-button-disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: default;
}

#family-tree-div {
    background-color: #303030;
    width: calc(100% - 24px);
    height: calc(100% - 96px - 44px);
    padding: 12px;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.2);
    overflow: hidden;
}

#status-bar-div {
    height: 24px;
    max-height: 24px !important;
    padding: 12px;
    color: #aaa;
    background-color: #202020;
    border-radius: 0 0 6px 6px;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
    overflow-x: hidden;
    overflow-y: hidden;
}

#individual-select, #connection-select {
    width: 100%;
    margin-top: 8px;
}

#individual-select::-webkit-scrollbar,
#connection-select::-webkit-scrollbar {
    width: 6px;
}
#individual-select::-webkit-scrollbar-track,
#connection-select::-webkit-scrollbar-track {
    background: transparent;
}
#individual-select::-webkit-scrollbar-thumb,
#connection-select::-webkit-scrollbar-thumb {
    background-color: rgba(255,255,255,0.25);
    border-radius: 3px;
}
#individual-select::-webkit-scrollbar-thumb:hover,
#connection-select::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.45);
}

#preset-select {
    width: 50%;
}

#individual-filter-text {
    width: calc(100% - 12px);
}

/* Styling for file name display */
#file-name {
    display: inline;
    color: #aaa;
    vertical-align: middle;
}

#root-name {
    --root-name-text-color: hsl(120, 25%, 75%);
    color: var(--root-name-text-color);
}

#node-count { 
    color: #aaa; 
    margin-left: 16px;
}

label {
    display: inline-block;
    vertical-align: middle;
    color: #aaa;
}

input[type="checkbox"] + label {
    cursor: pointer;
}

input:disabled + label {
    color: #555;
    cursor: not-allowed;
}

input.range-value[type="number"] {
    width: 40px;
}

input[type="number"], #individual-select, #individual-filter-text, #preset-select, #text-align-select, #highlights-select, #connection-select, #connection-filter-text {
    display: inline-block;
    vertical-align: middle;
    background-color: #202020;
    color: #aaa;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 1em;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input-wrapper {
    display: inline-flex;
    vertical-align: middle;
    align-items: stretch;
}

.number-input-wrapper input[type="number"] {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.number-stepper-controls {
    display: inline-flex;
    flex-direction: column;
}

.number-stepper-button {
    width: 24px;
    min-width: 24px;
    height: 16px;
    padding: 0;
    border: 1px solid #444;
    border-left: none;
    background-color: #2a2a2a;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    font-size: 0.75em;
}

.number-stepper-button:first-child {
    border-top-right-radius: 6px;
    border-bottom: none;
}

.number-stepper-button:last-child {
    border-bottom-right-radius: 6px;
}

.number-stepper-button:hover {
    background-color: #333;
}

.number-stepper-button:active {
    background-color: #3a3a3a;
}

.number-stepper-button:focus-visible {
    outline: 1px solid hsl(210, 50%, 70%);
    outline-offset: -1px;
    z-index: 1;
}

input[type="checkbox"] { margin: 0px 8px 0px 4px; }
input[type="radio"] { margin: 0px 8px 0px 4px; }

input[type="checkbox"],
input[type="radio"],
label[for="beside-inlaws-checkbox"],
label[for="show-names-checkbox"],
label[for="show-years-checkbox"],
label[for="show-places-checkbox"],
label[for="show-childless-inlaws-checkbox"],
label[for="text-shadow-checkbox"],
label[for="transparent-bg-rect-checkbox"],
label[for="pedigree-only-checkbox"],
label[for="color-picker"],
label[for="layout-vertical"],
label[for="layout-horizontal"],
label[for="save-format-svg"],
label[for="save-format-png"] {
    cursor: pointer;
}

input[type="color"] {
    display: inline-block;
    vertical-align: middle;
    /* For WebKit browsers (Chrome, Safari, Opera) */
    -webkit-appearance: none;
    appearance: none;
    border: none;
    /* Ensure no default background color is applied */
    background-color: transparent; 
    width: 20px; /* Adjust width as needed */
    height: 20px; /* Adjust height as needed */
    padding: 0; /* Remove default padding */
    margin: 0px 8px 0px 0px;
    cursor: pointer;
}

input[type="color"]:disabled {
    cursor: not-allowed;
}

/* Target the internal swatch wrapper for WebKit */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    margin: 0px 8px 0px 0px;
}

/* Target the internal swatch for WebKit */
input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%; /* Optional: style the color swatch itself */
}

/* For Firefox (requires an alternative approach as pseudo-elements are less supported) */
/* Firefox generally provides a more standard box model for the input, so basic CSS works well */
input[type="color"] {
    -moz-appearance: none; /* vendor prefix for Firefox */
    appearance: none;
    border: none;
    background-color: transparent; 
    padding: 0;
    margin: 0px 8px 0px 0px;
}

/* General styles */
input[type="color"]:focus {
    outline: none; /* Optional: remove default focus outline */
}

.icon-button, .icon-button-left {
    margin: 8px 8px 8px 0px;
    height: 30px;
    width: 30px;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
}

.icon-button {
    margin: 8px 0px 8px 8px;
    float: right;
}

.icon-button-bare {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
}

.icon-button-bare .icon-button-left {
    margin: 8px 8px 8px 0px;
}

#file-input-button {
  display: none;
}

#options-menu-button {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1002;
    display: none;
    background-color: black;
}

#mobile-menu-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: rgba(0,0,0);
    z-index: 1001;
}

/* Modal background and content */
.modal-bg {
    position: fixed;
    z-index: 3000;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #222;
    padding: 24px 32px;
    border-radius: 10px;
    box-shadow: 0 4px 24px #000;
    min-width: 260px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-label {
    color: #eee;
    font-size: 1.1em;
    margin-bottom: 8px;
}

.modal-radio-group {
    margin-bottom: 16px;
}

.modal-input {
    width: 200px;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background: #181818;
    color: #eee;
    margin-bottom: 16px;
}

.modal-buttons {
    display: flex;
    gap: 16px;
}

.modal-ok {
    padding: 6px 18px;
    border-radius: 5px;
    background: #4caf50;
    color: #fff;
    border: none;
    cursor: pointer;
}

.modal-cancel {
    padding: 6px 18px;
    border-radius: 5px;
    background: #888;
    color: #fff;
    border: none;
    cursor: pointer;
}

.online-gedcom-modal-content {
    min-width: 320px;
    max-width: 500px;
    align-items: stretch;
}

#online-gedcom-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    width: 100%;
}

#online-gedcom-list li {
    width: 100%;
}

.online-gedcom-item {
    display: block;
    width: 100%;
    background: #333;
    border: 1px solid #555;
    color: #eee;
    padding: 8px 14px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 1em;
    transition: background 0.15s;
}

.online-gedcom-item:hover:not(:disabled) {
    background: #4a4a4a;
}

.online-gedcom-item:disabled {
    opacity: 0.5;
    cursor: default;
}

#online-gedcom-status {
    color: #f88;
    margin-bottom: 12px;
    font-size: 0.95em;
    text-align: center;
}

.add-preset-modal-content {
    min-width: 400px;
    max-width: 640px;
    align-items: stretch;
}

.add-preset-settings {
    overflow-y: auto;
    max-height: 50vh;
    margin-bottom: 16px;
    width: 100%;
}

.add-preset-group {
    margin-bottom: 8px;
}

.add-preset-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #aaa;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 3px;
    border-bottom: 1px solid #444;
    margin-bottom: 4px;
}

.add-preset-group-toggles {
    display: flex;
    gap: 6px;
}

.add-preset-group-toggle {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.85em;
    padding: 0;
    text-decoration: underline;
    text-transform: none;
    letter-spacing: normal;
}

.add-preset-group-toggle:hover {
    color: #eee;
}

.add-preset-group-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    padding: 4px 0;
}

.add-preset-group-items label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #eee;
    font-size: 0.95em;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.about-modal-content {
    min-width: 300px;
    max-width: 480px;
    align-items: center;
    text-align: center;
}

.about-modal-description {
    color: #ccc;
    font-size: 0.95em;
    margin-bottom: 16px;
    line-height: 1.5;
}

.about-modal-versions {
    margin-bottom: 16px;
    color: #eee;
    font-size: 0.95em;
}

.about-modal-versions p {
    margin: 4px 0;
}

.about-modal-link {
    color: #7aade8;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 0.95em;
}

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