:root {
    --bg: #ffffff;
    --text: #000000;

    /* Accent: Cornflower / Indigo Blue */
    --icon-color: #4F8CFF;            /* Lively blue for icons */
    --button-color: #4F8CFF;          /* Main accent */
    --button-color-hover: #3a6fd8;    /* Slightly darker for hover */
    --button-text: #ffffff;

    --form-color: #ffffff;
}

body.light-mode {
    --bg: #ffffff;
    --text: #000000;

    --bubble-bg: #f5f8fc;             /* Cool soft background */
    --key-bubble-bg: #e6ecff;         /* Slight blue tint */
    --hyperlinkedcell: #1a73e8;       /* Vivid link color */
    --border-color: #ccd3e0;          /* Muted cool border */
    --menu-hover-color: #e0e7ff;      /* Hover with light blue */
}

body.dark-mode {
    --bg: #121212;
    --text: #e0e0e0;

    --bubble-bg: #1e1e2f;             /* Slight purple/blue tone */
    --key-bubble-bg: #2c3356;         /* Indigo-tinted for contrast */
    --hyperlinkedcell: #82aaff;       /* Softer blue for links */
    --border-color: #3c4560;
    --menu-hover-color: #2a3050;
}


body {
    background-color: var(--bg);
    color: var(--text);
    font-family: sans-serif;
    letter-spacing: -0.4px;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

a,
a:visited,
a:hover,
a:active {
    color: inherit;
    text-decoration: none;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg);
    padding: 2rem, 0;
    position: relative;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
    /* justify-content: center;
    /* Center the title horizontally */
}

footer {
    text-align: center;
    font-size: small;
    font-style: italic;
}

h2 {
    text-align: center;
}

main {
    /* max-width: 1200px; */
    margin: 0 auto;
    padding: 0rem 1rem;
    box-sizing: border-box;
    text-align: center;
}


form {
    max-width: 600px;
    margin: 1rem auto;
    font-family: Arial, sans-serif;
}

form .form-row {
    display: flex;
    align-items: center;
    /* vertically center label + input */
    margin-bottom: 15px;
}

form label {
    flex: 0 0 200px;
    /* fixed width for label */
    font-weight: bold;
    margin-right: 10px;
    text-align: right;
}

form input[type="text"],
form input[type="email"],
form input[type="url"],
form input[type="date"],
form input[type="file"],
form textarea {
    flex: 1;
    /* input takes remaining width */
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

form textarea {
    resize: vertical;
    min-height: 80px;
}

form select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

form select.narrow-select {
    width: 150px;
    /* adjust width as needed */
    text-align: center;
    /* centers the text in most browsers */
    padding: 8px 10px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    appearance: none;
    /* optional: remove native styling */
    background-color: var(--form-color);
}


form .submit-button {
    padding: 8px 16px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    border: 1px solid var(--button-color);
    border-radius: 8px;
    background-color: var(--button-color);
    color: var(--button-text);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

form .submit-button:hover {
    background-color: var(--button-color-hover);
    border-color: var(--button-color-hover);
}

.xtitle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    /* Center horizontally */

    display: flex;
    align-items: center;
    /* Vertically align image and text */
    font-size: 1.5rem;
}

.title {
    position: absolute;
    left: 50%;
    top: 1rem;
    /* adjust vertical position */
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    white-space: nowrap;
    /* prevent wrapping */
}


.title a {
    display: flex;
    align-items: center;
    /* Ensure vertical alignment inside link too */
    text-decoration: none;
    color: inherit;
}

.title img {
    height: 50px;
    /* Keep image size fixed */
    margin-right: 0.5rem;
    /* Spacing between image and text */
}

/* Container for buttons aligned right */
.xheader-buttons {
    margin-left: auto;
    /* Push to right */
    display: flex;
    align-items: center;
    position: relative;
}

.header-buttons {
    position: relative;
    /* add this */
    margin-top: 70px;
    /* from earlier */
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Buttons styling */
#theme-toggle,
#public-menu-toggle,
#private-menu-toggle {
    color: inherit;
    /* font-size: 1.5rem; */
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 1rem;
}

.menu-wrapper {
    position: relative;
    display: inline-block;
    /* keep buttons side by side */
}

#public-menu,
#private-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    /* directly below the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 120px;
    white-space: nowrap;
}

#public-menu.hidden,
#private-menu.hidden {
    display: none;
}

#public-menu a,
#private-menu a {
    text-decoration: none;
    color: var(--text);
    padding: 0.5rem;
    white-space: nowrap;
}

#public-menu a:hover,
#private-menu a:hover {
    background-color: var(--menu-hover-color);
}

/* @media (max-width: 768px) {
    #menu-toggle {
        display: inline-block;
    }

    #menu-public, #menu-private{
        flex-direction: column;
    }
} */

.table-container {

    max-width: 100%;
    overflow-x: auto;
}


.table-container table {
    /* width: 100%; */
   border-collapse: collapse;
    /* let table shrink to fit content */
    table-layout: auto;
    /* size columns based on content */

}

.table-container td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: center;
}



/* Status Table styles */
.status-table table {
    border-collapse: separate;
    border-spacing: 2px 2px;
    /* width: 100%;
    table-layout: fixed; */
    border-radius: 12px;
    margin: 0 auto; 
    /* center the table */
    min-width: 1000px;
}

.status-table th,
.status-table td {
    background: var(--bubble-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: visible;
    color: var(--text);
    width: auto;
    /* Let width fit content */
    height: auto;
    /* Let height fit content */
    box-sizing: border-box;
    /* Include border & padding in size */

}

.sticky-column {
    position: sticky;
    left: 0; 
    background-color: var(--bg);
    /* Match the rest of the table */
    z-index: 1;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    /* Optional visual separation */
}

td.hyperlinked {
    border: 2px solid var(--hyperlinkedcell);
    color: var(--text);
    /* Bright white border */
}

.status-table th {
    background: var(--bubble-bg);
    font-weight: bold;
    color: var(--text);
}

/* Key Table styles */
.key-table table {
    border-collapse: separate;
    border-spacing: 6px 6px;
    width: auto;
    table-layout: auto;
    border-radius: 12px;
    margin: 0 auto;
    /* center the table */
}

.key-table th,
.key-table td {
    background: var(--key-bubble-bg);
    border: 1px solid #999;
    border-radius: 6px;
    padding: 2px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.key-table th {
    background: var(--key-bubble-bg);
    font-weight: bold;
    color: var(--text);
}

/* Icons inside Key Table can have neutral color */
.key-table td i.fa-solid {
    /*color: #666; */
    /* font-size: 1.3rem;*/
    vertical-align: middle;
}

.notes-panel {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    margin: 0.5rem  auto;
    max-width: 700px;
    border-radius: 10px;
    background-color: var(--bubble-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.note-entry {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: box-shadow 0.2s ease;
}

.note-entry:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}


.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    gap: 0.25rem;
    color: var(--text);
}

.note-header .note-date {
    font-weight: 200;
}

.note-text {
    margin: 0;
    /* padding-left: 1.25rem; /* or 1rem if you want less */
     text-align: left;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
}

.panel {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.panel-header {
    background: var(--bubble-bg);
    padding: 4px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.minimize-btn {
    color: inherit;
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
}

.panel-content {
    padding: 2px;
}

.nav-buttons-container {
    text-align: center;
    margin: 20px 0;
}

.nav-btn {
    font-size: 16px;
    padding: 8px 12px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* space between icon and text */
    text-decoration: none;
    user-select: none;
}

.nav-btn i {
    font-size: 18px;
}

/* Optional: hover effects */
.nav-btn:hover {
    opacity: 0.85;
}

.icon {
    color: var(--icon-color);
}

.arrowicon {
    color: var(--text);
}

.icon-locked {
    color: #6cc24a;
}

.icon-partial {
    color: #db3dce;
}

.icon-unlocked {
    color: #e04444;
}

.icon-clock {
    color: #f4a261;
}

.icon-xmark {
    color: #56a8e6;
}

.icon-broken {
    color: #9d4edd;
}

.icon-target {
    color: #800080;
}