/* Copyright © 2025 Deerhoof Gardens LLC */

html, body {
    /* Make the page at least fill the window. */
    height: 100%;
    /* Bump the default font size a bit. */
    font-size: 1.5em;
    overflow: auto;
    touch-action: manipulation;
}

#flex-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
}

/* Container for the main page content */
.page-content {
    flex: 1 0 auto;
    padding: 2dvh;
}

p.error-message {
    color: #cf142b;
}

h1.apptitle {
    font-size: 2em;
    text-align: center;
    margin: 1.4ex 0 0 0;
}

h2 {
    font-size: 1.4em;
    font-weight: 700;
}

button {
    margin: 0.8ex 0.4ch;
}

button.row-button {
    margin: 0.2ex 0.1ch;
    font-size: 1.5em;
}

button.remove-button {
    color: red;
}

select, input {
    box-sizing: border-box;
    margin: 0;
}

input[type="checkbox"] {
    width: 1.6ch;
    height: 1.6ex;
}

input[readonly] {
    background-color: #dfdfdf;
}

td {
    vertical-align: top;
}

div.lookup-block {
    padding: 0.5ex 0;
}

.flex-form {
    display: flex;
    flex-direction: row;
    padding: 1%;
}

.flex-form-column {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.flex-form-row {
    display: flex;
    flex-direction: row;
    flex: 1 0 auto;
}

.flex-cell {
    display: flex;
    flex-direction: row;
    flex: 1 0 0%;
    flex-wrap: nowrap;
    padding: 0.2ex 0.4ch;
    align-items: center;
}

.flex-cell.form-left-col {
    justify-content: flex-end;
}

.flex-cell label {
    padding: 0.2ex 0.2ch;
}

.form-final {
    text-align: center;
}

.search-label {
    text-align: right;
    vertical-align: middle;
    padding-right: 1ch;
}

a {
    text-decoration: none;
}

p {
    margin: 0.6ex 0
}

p.message {
    font-size: 0.8em;
    margin: 1.6ex 0;
}

#main-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    clear: both;
}

.menu-link {
    display: block;
    margin: 0.5ex 0.8ch;
}

.menu-button {
    margin: 0;
    padding: 0.25ex 0.4ch;
    cursor: pointer;
}

.menu-button.this-page {
    background-color: white;
    color: blue;
    border-radius: 4px;
}

#user-menu {
    display: flex;
    flex-grow: 10;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

#menu-username {
    display: inline-block;
    font-weight: bold;
    padding: 0.25ex 0 0.25ex 1.5ch;
    margin: 0.5ex 0.8ch;
}

#menu-link-logout {
    display: inline-block;
    margin: 0.5ex 0.8ch;
}

p#logindisplay {
    text-align: center;
    margin-top: -0.4ex;
    font-size: 0.7em;
}

details.login-box {
    margin-top: 4ex;
}

details.login-box summary {
    font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    font-size: 1.4em;
    font-weight: 700;
}

form.query-form {
    margin: 0.5ex 0.9ch;
}

.message-list {
    font-size: 0.7em;
}

.loader {
    margin: 0.3ex 0 0.1ex 0.4ch;
    height: 1.6ex;
    width: 1.6ex; /* Intentionally based on ex to ensure circularity */
    border: 2px solid white; /* Initial state; color changed when active */
    border-radius: 100%;
    animation: spinner 2s linear infinite;
    pointer-events: none; /* don't capture clicks */
}
.loader.paused {
    -webkit-animation-play-state: paused;
    -moz-animation-play-state: paused;
    -o-animation-play-state: paused;
    animation-play-state: paused;
}

.aqloader {
    position: absolute;
    top: 0.4ex;
    right: 0.3ch;
}

.qlimit-block, .qconfig-block {
    float: right;
}

.qpartial-cell {
  flex: 1 0 auto;
}

td .loader {
    float: left;
}

button .loader {
    float: right;
}

@keyframes spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


input.adate {
    width: 13ch;
}

.position-container {
    position: relative;
    right: 0;
    top: 0;
}

.sameforall-box {
    position: absolute;
    top: 0.4ex;
    right: 0.3ch;
}

.entry-table {
    /* Give some scroll space past end of field */
    padding-right: 12vw;
}

.result-table {
    margin-top: 3ex;
    border-collapse: collapse;
}

.result-table td {
    padding: 0.2ex 0.4ch;
    border: 1px solid black;
}

.result-table td.group-header {
    vertical-align: middle;
}

.result-table td.stretch {
    background-color: white;
    border: 0;
}

.td-selectall label {
    vertical-align: middle;
}

.select-all-checkbox {
    vertical-align: middle;
    margin-right: 0.8ch;
}

tr.selected {
    background-color: #dfefff;
}

th {
    font-size: 0.9em;
    vertical-align: bottom;
}

th label {
    white-space: pre-wrap;
}

.result-table th {
    padding: 0.2ex 0.4ch;
    border-left: 1px solid black;
    border-right: 1px solid black;
}

.result-table th.th-first {
    border-left: 0;
}

.result-table th.th-last {
    border-right: 0;
}

.result-table .blank-cell {
    border: 0;
    background-color: white;
}

.result-table .table-title {
    font-weight: bold;

}

.result-table .group-header {
    border-top: 0;
    border-left: 0;
    border-right: 0;
    padding-top: 0.6ex;
    font-weight: bold;
    text-align: left;
}

.totals-header {
    font-weight: bold;
    text-align: right;
}

.total-cell {
    font-weight: bold;
}

/* Hide with 0 opacity to maintain accessibility. */
input[type="file"] {
    opacity: 0;
    height: 0;
    width: 0;
    display: inline;
}

label.active-picker img {
    margin-top: -0.3em;
}

.image-button {
    display: inline;
}

.image-button img {
    height: 3ex;
    vertical-align: middle;
}

.add-image {
    pointer-events: none;
}

.thumbnail {
    height: 12ex;
}

.password-show {
    margin-left: 1em;
}

.search-column {
    flex: 0 0 auto;
}

.search-box {
    margin: 0.5ex 0.9ch;
    padding: 0.5ex 0.4ch;
    border: 1px solid #c0c0c0;
}

.exclusive-search summary {
    padding: 0.5ch 0.5ex;
    margin-bottom: 0.5ch;
}

.qeventkind-block {
    flex: 0 1 auto;
}

.recordkind-row {
    flex: 0 1 auto;
    flex-wrap: wrap;
}

.recordkind-row {
    flex: 0 0 auto;
}

.groupby-row {
    padding-top: 1.0ex;
    align-items: start;
    flex: 1 1 auto;
}
