/* Shared definitions */
:root {

  /* Light blueish */
  --base-color: #bebeda;
  --base-color-darker1: lch(from var(--base-color) calc(l - 20) c h);
  --base-color-darker2: lch(from var(--base-color) calc(l - 30) c h);
  --base-color-darker3: lch(from var(--base-color) calc(l - 40) c h);
  --base-color-lighter1: lch(from var(--base-color) calc(l + 20) c h);
  --base-color-lighter2: lch(from var(--base-color) calc(l + 30) c h);
  --base-color-lighter3: lch(from var(--base-color) calc(l + 40) c h);
  /* Accent 1: Shift hue +30 degrees */
  --accent1-color: hsl(from var(--base-color) calc(h + 30) s l);
  --accent1-color-darker: lch(from var(--accent1-color) calc(l - 20) c h);
  --accent1-color-lighter: lch(from var(--accent1-color) calc(l + 20) c h);
  /* Accent 2: Shift hue -30 degrees */
  --accent2-color: hsl(from var(--base-color) calc(h - 30) s l);
  --accent2-color-darker: lch(from var(--accent2-color) calc(l - 20) c h);
  --accent2-color-lighter: lch(from var(--accent2-color) calc(l + 20) c h);

  /* Reddish */
  --complement1-color: hsl(from var(--base-color) calc(h + 120) s l);
  --complement1-color-darker: lch(from var(--complement1-color) calc(l - 20) c h);
  --complement1-color-lighter: lch(from var(--complement1-color) calc(l + 20) c h);

  /* Yellowish */
  --complement2-color: hsl(from var(--base-color) calc(h - 120) s l);
  --complement2-color-darker: lch(from var(--complement2-color) calc(l - 20) c h);
  --complement2-color-lighter: lch(from var(--complement2-color) calc(l + 20) c h);

  /* The matte used in non-interactive / background areas */
  --background-matte-color: var(--base-color-lighter1);
  /* The matte used in interactive / card / content areas */
  --content-matte-light: white;
  --content-matte-light2: var(--base-color-lighter2);
  --content-matte-light3: var(--base-color-lighter3);
  --content-matte-dark: var(--base-color);
  --content-matte-dark2: var(--base-color-darker1);
  --content-matte-dark3: var(--base-color-darker2);
  --content-matte-dark4: var(--base-color-darker3);
  /* The font color contrasting with the matte colors */
  --dark-font-color: #2c5a5e;
}

/* Universal page themes */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--background-matte-color);
  color: var(--dark-font-color);
}

input,
textarea {
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.multiline-friendly {
  white-space: pre-wrap;
}

.lib-card-header {
  margin: 0.25em 0;
}

.lib-card-qr {
  width: 128px; 
  height: 128px;
}

.library-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.2em;
}
.icon-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
}
.library-icon {
  height: 1.5em;
  width: 1.5em;
  /* vertical-align: middle; */
  display: block;
}
.library-icon-placeholder {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
}

.wide-card .img-banner {
  width:100%; 
  max-width: 800px;
}

.no-text-decoration {
  text-decoration: none;
}

.error-text-color {
  color:red;
}

.radio-label {
  margin-right: 1.5em;
}

/* Applied to a div or other full-width container, this limits the 
   width to avoid awkwardly wide cards */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.container hr {
  margin: 1.5em 0;
}

/* A thin border, intended for images */
.fine-border {
  border: 1px solid var(--dark-font-color);
}

/* A slightly thicker border, intended for images */
.med-border {
  border: 5px solid var(--dark-font-color);
}

/* Centers inline content (text h1/h2, or span), e.g.,
   the inner text of the stylized element */
.center-aligned {
  text-align: center;
}

.right-aligned {
  text-align: right;
}

.icon-row {
  position: absolute;
  top: 20px;
  right: 20px;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Center a non-text element with definite width.
   If the centered-element does not have a definite
   width, centering will not work (the element will
   expand to fill the block) */
.centered-element {
  display: block;
  margin: auto;
}

.right-element {
  display: block;
  /* Note: float: right is problematic - the trailing element is drawn in the padding */
  margin-left: auto;

  /* Positions the element relative to its container */
  /* position: absolute; */
  /* Matches the container's bottom padding */
  /* bottom: 20px; */
  /* Matches the container's right padding */
  /* right: 20px; */
}

/* Contents are floated over the center of the container.
   For example, the static map pin.
*/
.centered-float {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* Prevents the marker from interfering with map events */
}

/* Identifies a div or other container as the focal point
   of the entire page. Intended to work with sub styles. */
.hero {
  text-align: center;
  /* padding: 60px 20px; */
  background-color: var(--content-matte-dark);
  /* margin-bottom: 30px; */
}

/* H1-level text content within a hero container.
   Big and with a distinct buffer zone from 
   subsequent content. 
   TODO: Review sizes & dimensions for px vs. (r)em
   https://www.joshwcomeau.com/css/surprising-truth-about-pixels-and-accessibility/ 
*/
.hero h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

/* Otherwise undecorated paragraph text content within 
   a hero container */
.hero p {
  font-size: 1.2em;
  /* margin-bottom: 30px; */
}

/* Responsive nav/app-title text/icon */
.app-title-short {
  display: none;
}

.app-title-long {
  display: inline;
}

.nav-short {
  display: none;
}

.nav-long {
  display: inline;
}

/* Nav icon normalization */
.nav-icon {
  display: none;
  height: 2.0em;
  width: 2.0em;
  vertical-align: middle;
  margin-left: 0.2em;
}


.inactive-option-color {
  color: var(--base-color);
}

.active-option-color {
  color: var(--base-color-darker3);
}


/* A button that expands to most of its container's width.
   Good for mobile-friendly single-action forms */
.big-button {
  display: inline-block;
  padding: 12px 24px;
  background-color: var(--content-matte-dark2);
  color: var(--content-matte-light);
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
  font-size: 1.1em;
  min-width: 110px;
}

/* Upon hover, a big-button will transition to a deeper 
   color */
.big-button:hover {
  background-color: var(--content-matte-dark3);
}

/* The navbar is shared across most pages.
*/
.navbar {
  background: var(--content-matte-dark4);
  color: var(--content-matte-light);
  padding: 0.5em 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.5em;
  font-weight: bold;
  color: var(--content-matte-light);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.navbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5em;
  align-items: center;
}

.navbar-nav li {
  display: inline;
}

.navbar-nav .navlink {
  color: var(--content-matte-light);
  text-decoration: none;
  padding: 0.25em 0.5em;
  border-radius: 8px;
  transition: background 0.2s;
  display: inline-block;
  text-align: center;
}

.navbar a.active,
.navbar a:hover {
  text-shadow: 0 0 1em var(--content-matte-light);
}


.wide-card {
  background: var(--content-matte-light);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 2em 2em;
  /* 'auto' is used to center the card by distributing margin evenly on either side */
  margin: 2em auto;
  position: relative;
}

.wide-card h2 {
  margin-top: 0;
  color: var(--content-matte-dark3);
}

.wide-card ul {
  padding-left: 1.2em;
}

.wide-card li {
  margin-bottom: 1em;
}

/* TODO Use a footer in the templates? */
/* .footer {
  background: #2d3e50;
  color: var(--content-matte-light);
  text-align: center;
  padding: 1em 0;
  font-size: 0.95em;
  position: relative;
  bottom: 0;
  width: 100%;
} */

/* New CSS for form styling */
.narrow-card {
  background: var(--content-matte-light);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  /* Relaxed padding */
  padding: 2em 2em;
  /* Centered with vertical spacing */
  margin: 2em auto;
  /* Limit form width */
  max-width: 600px;
  position: relative;
}

.narrow-card h2 {
  color: var(--content-matte-dark3);
  margin-bottom: 1.5em;
  text-align: center;
}

.form-group {
  margin-bottom: 1.5em;
  /* Relaxed spacing between form groups */
}

.form-group label {
  display: block;
  margin-bottom: 0.6em;
  color: var(--content-matte-dark4);
  font-weight: bold;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.9em;
  /* Slightly larger padding for inputs */
  border: 1px solid var(--content-matte-dark);
  border-radius: 5px;
  /* Slightly rounded corners */
  box-sizing: border-box;
  /* Include padding in width */
  font-size: 1em;
}

.form-group textarea {
  resize: vertical;
  /* Allow vertical resizing of textarea */
  min-height: 100px;
}

.form-actions {
  text-align: center;
  margin-top: 2em;
}

.form-actions .big-button {
  width: 100%;
  /* Make button full width of form */
  padding: 15px;
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.marker-overlay {
  position: relative; 
  top: -6px;
}

.location-desc {
  text-align: center; 
  margin: 0px;
}

.long-desc {
  margin-bottom: 3em;
}

.button-disabled-annotation {
  text-align: center; 
  margin: 5px;
}

.thin-bottom-margin {
  margin-bottom: 0.15em;
}

.btn-logout-conf {
  margin-left:1em;
  cursor:pointer;
}
.map-container {
  position: relative;
  border: solid;
  border-width: 1px;
  box-sizing: border-box;
}

.map-container-static {
  width: 256px;
  height: 256px;
}

.map-container-dynamic {
  width: 100%;
  /* max-width: 480px; */
  height: 360px;
}
.profile-disabled-input {
  background: #f3f3f3;
  color: #888;
  border: 1px solid #ddd;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
  outline: none;
  box-shadow: none;
}

.profile-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-overlay-content {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  padding: 2em 2.5em;
  text-align: center;
  min-width: 260px;
}

.profile-overlay-content button {
  margin-top: 1.5em;
  min-width: 120px;
}

.fill-container {
  width: 100%;
  height: 100%;
}

#key-display-wrapper {
  margin-top: 2em;
}

/* Wraps the api key post-creation display */
.input-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Api key post-creation display */
.read-only-frame {
  border: 1px solid #ccc;          /* Custom border */
  background-color: #f9f9f9;      /* Light background */
  padding: 15px;                   /* Inner spacing */
  font-family: inherit;           /* Match text style */
  font-size: 1em;                 /* Consistent size */
  width: 100%;                    /* Adjust as needed */
  outline: none;                  /* Remove focus outline */
  box-sizing: border-box;
} 

/* Inline button in the user profile API key result */
.embedded-btn {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  padding: 0 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
}

/* Inline button in the user profile API key result */
.copy-btn {
  right: 0;
}

/* Inline button in the user profile API key result */
.dl-btn {
  right: 32px;
}

.input-annotation-img {
  width: 20px;
  height: 20px;
}

/* BEGIN API_KEY */
.api-key-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  margin-top: 0.5em;
}

.api-key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 12px;
  border: 1px solid var(--base-color-darker2);
  border-radius: 6px;
  background-color: var(--base-color-lighter1);
}

.api-key-info {
  flex: 1;
}

.api-key-info code {
  font-family: monospace;
  font-size: 14px;
  color: var(--base-color-darker3);
  margin-top: 4px;
  display: block;
}

.revoke-btn {
  padding: 8px 12px;
  background: var(--complement1-color-darker);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.revoke-btn:hover {
  background: var(--complement2-color-darker);
  font-weight: bold;
}   
/* END API_KEY */


/* Layout for map and QR code side-by-side */
.map-qr-wrapper {
  display: flex;
  gap: 2em;
  justify-content: center;
  align-items: flex-start;
  margin: 2em 0;
}

.centered-row-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 16px;
}

.centered-container {
  display: flex;
  justify-content: center;
}

/* Modal overlay for logout confirmation */
.modal-toggle:checked~.modal-overlay {
  display: block;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.profile-overlay-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.profile-overlay-content {
  color: var(--dark-font-color);
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  padding: 2em 2.5em;
  text-align: center;
  min-width: 260px;
}

.logout-modal-label {
  cursor: pointer;
  display: inline-block;
}


/* When speculatively on a small-factor device 
   (< 600 pixels wide), change some styles. 
   In this case, the hero font sizes are reduced 
*/
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2em;
  }

  .hero p {
    font-size: 1.1em;
  }

  /* FIXED: Increased specificity to override '.navbar-nav .navlink' display style */
  .navbar-nav .nav-long {
    display: none;
  }

  .nav-icon {
    display: inline-block;
    /* Increased hit area for mobile usability */
    padding: 4px;
  }

  .navbar-nav {
    gap: 0.8em;
  }

  .app-title-long {
    display: none;
  }

  .app-title-short {
    display: inline;
    font-size: 2.0em;
    vertical-align: middle;
  }

  .nav-short {
    display: inline;
  }
}

/* Stack vertically on smaller screens */
@media (max-width: 800px) {
  .map-qr-wrapper {
    flex-direction: column;
    align-items: center;
  }
}

/* Styles the container, and anything in it (unless overridden) */
.chip-container {
  font-size: 10px;
  font-family: sans-serif;
}

.chip {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px;
  background-color: var(--content-matte-light2);
  color: var(--content-matte-dark4);
  border-radius: 50px;
  /* font-size: 14px; */
  font-family: sans-serif;
  text-align: center;
}

.chip:hover {
  background-color: var(--content-matte-light3);
  cursor: pointer;
}

.map-search-box {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 72px;   /* leave room for expand button */
  z-index: 5;
  box-sizing: border-box;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  border-radius: 2px;
}

/* PlaceAutocompleteElement renders as a custom element; ensure it stretches */
#map-search-input {
  display: block;
}


/**********************************************/
/*
The tag selector is a fly-out button panel.
Consider adding
  <script>
    document.addEventListener('click', function (event) {
      const tagSelector = document.querySelector('.tag-selector');
      if (tagSelector && !tagSelector.contains(event.target)) {
        // If the click is outside the tag selector, remove focus
        document.activeElement.blur();
      }
    });
  </script>
*/

/* This just styles the div containing the 'Add Tag' button and the fly-out panel */
.tag-selector {
  position: relative;
  /* display: inline-block; */
}

/* This styles the fly-out panel itslf */
.tag-list {
  /* Position above the button */
  position: absolute;

  /* Fly-up */
  /* bottom: 100%;
  left: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  padding: 8px; */

  /* Fly-right */
  bottom: 100%;
  top: 0;
  left: 120px;
  display: flex;
  flex-direction: row;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  margin: 0;
  padding: 0;

  opacity: 0;
  /* Hidden by default */
  visibility: hidden;
  z-index: 1000;
  /* no bullets */
  list-style: none;

  gap: 10px;

  border-radius: 24px;
  /* box-shadow: inset 0 0px 16px var(--dark-font-color);
  border: 1px solid var(--dark-font-color);
  background-color: var(--content-matte-light);
  min-width: 150px; 
  */
}

.tag-list li {
  list-style: none;
}

/* This will be applied to the container when a child element is focused */
.tag-selector:focus-within .tag-list,
.tag-selector:hover .tag-list {
  opacity: 1;
  /* Make visible */
  visibility: visible;
  transform: translateY(0);
  /* "Fly up" to position */
}

.tag-btn,
.tag-list-item button {
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background-color: var(--content-matte-light);
  cursor: pointer;
  font-family: inherit;
  /*
  margin-top: 8px;
  margin-bottom: 8px;
  */
  min-width: 100px;
  /* Space between options */

  /* x-off, y-off, blur, color */
  /* box-shadow:
    0px 0px 16px rgba(255, 255, 255, 1),
    0px 0px 16px rgba(255, 255, 255, 1),
    0px 0px 16px rgba(255, 255, 255, 1) 
  */
}

.tag-list-item button {
  box-shadow:
    0 0px 4px var(--background-matte-color),
    0 0px 8px var(--background-matte-color),
    0 0px 16px var(--background-matte-color),
    0 0px 16px var(--background-matte-color);
}

/* Button fill: #EFF1F8 
   Border     : #616E9F
   Text       : #616E9F
*/

/* https://paletton.com/#uid=53n0u0k1lYm00++00++5NMpebto */
.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 12px;
  font-size: 1.2em;
  font-weight: bold;
  border: 2px solid;
  background-color: var(--accent1-color-lighter);
  cursor: pointer;
  border-color: var(--accent2-color-darker);
  color: var(--accent1-color-darker);
}

.action-button:hover {
  background-color: var(--accent1-color);
  color: white;
  /* transform: scale(1.1); */
}

.action-button:disabled {
  /* pointer-events: none; */
  background-color: lightgray;
  border-color: darkgray;
  color: var(--accent1-color-darker);
}

/* Banner style for pending reactions */
.reaction-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  margin-bottom: 10px;
  background-color: var(--complement2-color-lighter);
  border: 2px solid var(--complement2-color-darker);
  border-radius: 5px;
  color: var(--accent1-color-darker);
  font-weight: bold;
  position: relative;
}

.reaction-banner .banner-text {
  flex-grow: 1;
  font-size: 1.1em;
  /* Allow this container to shrink and its text to wrap */
  flex-shrink: 1;
  min-width: 0;
}

/* The following styles center the annotation in the space to the right of the button
.banner-text {
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
*/

.resolve-btn {
  background: var(--accent1-color-lighter);
  border: 1px solid var(--accent1-color-darker);
  border-radius: 6px;
  color: var(--accent1-color-darker);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.2em;
  transition: transform 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;

  /* This is determined purely by the current strings used in the resolve buttons.
     It will need to be tuned if changes are made to those string. */
  min-width: 160px;

  /* The following attempt to prevent wrapping in the button, while allowing wrapping in the annotation text */
  /* Prevent the text inside the button from wrapping */
  white-space: nowrap;
  /* Ensure the button does not shrink smaller than its content */
  flex-shrink: 0;
  margin-right: 10px;
}

.resolve-btn:hover {
  background-color: var(--accent1-color);
  color: white;
  /* transform: scale(1.1); */
}

/* My Libraries */
.card-title {
  font-size: 1.4em;
  font-weight: bold;
  width: fit-content;
  margin: 0 auto;
}

.clickable {
  cursor: pointer;
}

.library-container {
  display:flex;
  justify-content: left;
  gap: 1em;
}

.vertical-stack {
  display:flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.5em;
}

.map-thumbnail {
  width: 128px;
  height: 128px;
}

.library-title {
  font-size: 1.2em;
  font-weight: bold;
}

.library-location {
  font-size: 1.0em;
  font-style: italic;
}
/* END My Libraries */


/* notes
https://css-loaders.com/spinner/
*/

.loader {
  width: 48px;
  height: 48px;
  display: none;
  z-index: 10;
}

.loader.visible {
  display: block;
}

.loader::after,
.loader::before {
  content: '';
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--base-color-darker3);
  /* ensure the delayed .loader::after is invisible prior to animation */
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  animation: animloader 2s linear infinite;
}

.loader::after {
  animation-delay: 1s;
}

@keyframes animloader {
  0% {
    transform: scale(0);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.printable-card {
  width: fit-content;
  padding: 0.5em;
  border-radius: 8px;
  border-style: solid;
  border-color: black;
  border-width: 1px;
}

.small-icon {
  width: 24px;
  height: 24px;
}

.title-block h2 {
  margin-bottom: 0.25em;
}

.title-block {
  margin-bottom: 1.5em;
}

@media print {
  :root {
    /* The matte used in non-interactive / background areas */
    --background-matte-color: none;
    /*
  --content-matte-light: white;
  --content-matte-light2: #e0e0e0;
  --content-matte-light3: #d0d0d0;
  --content-matte-dark: #b8e0e5;
  --content-matte-dark2: #48919b;
  --content-matte-dark3: #367279;
  --content-matte-dark4: #2d3e50;
  --dark-font-color: #2c5a5e; 
*/
  }


  .no-print {
    display: none
  }

  .printable-card {
    background: none;
    box-shadow: none;
    margin: 0px;
  }

  .wide-card {
    box-shadow: none;
  }

  .narrow-card {
    box-shadow: none;
  }
}