

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100vw; 
  overflow: hidden;
  font-family: 'Avenir', sans-serif;
  background: #f2f2f2;
  touch-action: manipulation;
  -ms-touch-action: manipulation; 
}

html {
  transform: translateZ(0); /* triggers GPU rendering */
}

@supports not (height: calc(var(--vh) * 100)) {
  #map {
    height: 100vh;
  }
}

/***************** LANDING PAGE STYLES *****************/

body.landing-page {
  background: #131B1E;
  color: white;
  overflow-y: auto;
  overflow-x: hidden;
}

.landing-container {
  position: relative;
  width: 100%;
  min-height: 100vh; /* Changed from height to min-height for scrolling */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0px 14px 0px; /* top right bottom */;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
}

.hero-image {
  position: absolute;
  top: 80px;
  left: 0;
  width: 100%;
  height: 50vh; 
  object-fit: cover;
  z-index: 1;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.3) 50%,
    rgba(0,0,0,0.7) 100%
  );
  z-index: 2;
}

.content {
  position: relative;
  z-index: 3;
  min-height: 100vh; /* Changed to min-height */
  /*display: flex;*/
  flex-direction: column;
  /*justify-content: space-between;*/
  gap: 0px; 
  box-sizing: border-box;
  /*padding-bottom: 0px;*/
  padding: 0px;
}

.tagline {
  background: rgba(222, 168, 223, 0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 500;
  display: inline-block;
  align-self: flex-start;
  margin-top: 20px;
}

.title-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  margin-top: -100px;
  margin-bottom: 20px;

}

.main-title {
  font-size: clamp(60px, 15vw, 120px);
  line-height: 0.9;
  font-weight: 300;
  margin-top: 200px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.subtitle {
  background: rgba(222, 168, 223, 0.9);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  margin-bottom: 30px;
  display: inline-block;
  align-self: flex-end;
}

.description {
  padding: 0px;
  margin: 7px 0px 7px;
  max-width: 500px;
  font-size: 16px;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.get-started {
  display: block;
  text-align: right;

  font-weight: bold;
  /*font-size: 20px;*/
  color: white;
  cursor: pointer;
  text-decoration: none;

  line-height: 1.2;

  transition: opacity 0.2s ease;
}

#language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

#lang-btn {
  width: 64px;
  height: 64px;
  background: rgba(200, 200, 200, 0.5); /* translucent white */
  color: black;
  font-size: 20px;
  font-weight: bold;
  border-radius: 50%;
  border: none;
  backdrop-filter: blur(8px); /* softens what’s behind */
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

#lang-btn:hover {
  background: rgba(200, 200, 200, 0.5); /* translucent white */
}


/* Mobile optimizations for landing page */
@media (max-width: 768px) {
  .landing-container .content {
    padding: 20px 16px 40px;
  }

  .landing-container .get-started {
    font-size: 24px;
    margin-top: 20px;
    align-self: stretch; /* Full width on mobile */
  }

  .landing-container .title-section {
    margin-top: -20px; /* Reduced negative margin on mobile */
    padding: 40px 0;
  }

  .hero-image {
    height: 40vh; /* Slightly smaller on mobile */
  }
}

/* Landscape mobile for landing page */
@media (max-height: 500px) {
  .landing-container .title-section {
    margin-top: -30px;
    padding: 20px 0;
  }
  
  .landing-container .main-title {
    font-size: clamp(32px, 8vw, 48px);
  }
  
  .landing-container .content {
    padding: 16px 16px 24px;
  }

  .hero-image {
    height: 35vh; /* Even smaller in landscape */
  }
}

/***************** /*INSTRUCTIONS OVERLAY*/

#instr-screen {
  position: fixed;
  inset: 0;
  background: #dea8df;
  color: white;
  z-index: 10002;
  /*display: flex;*/
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  font-family: 'Avenir', sans-serif;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Simple visible state instead of fade-in/fade-out classes */
#instr-screen.visible {
  opacity: 1;
  pointer-events: auto;
  display: flex;
}

.step-1 h2, .step-3 h2 {
  font-size: 26px;
  text-align: left;
  margin: 0 0 0px;  
  padding-bottom: 6px;
}
.step-2 h2, .step-4 h2 {
  font-size: 26px;
  text-align: right;
  margin: 0 0 0px;  
  padding-bottom: 6px;
}

.step-1 p, .step-3 p {
  font-size: 16px;
  text-align: left;
  margin: 0 0 0px;  
  padding-top: 10px;
}
.step-2 p, .step-4 p {
  font-size: 16px;
  text-align: right;
  margin: 0 0 0px;  
  padding-top: 10px;
}

.instr-step {
  margin-bottom: 15px;
  text-align: left;
}

.instr-step img {
  width: 90%;
  display: block;
  margin: 0 0 0px;  
}

.step-2 img, .step-4 img {
  display: block;
  margin-left: auto;
  margin-right: 0;
}

.instr-wrapper {
  max-width: 500px;
  padding: 60px 24px 40px;
  width: 100%;
  box-sizing: border-box;
}

.instr-wrapper h1 {
  font-size: 60px;
  line-height: 0.9;
  margin-bottom: 50px;
  font-weight: bold;
}

#instr-close {
  position: absolute;
  top: 15px;
  right: 24px;
  font-size: 60px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

#instr-back {
  font-weight: bold;
  font-size: 24px;
  text-align: right;
  color: white;
  cursor: pointer;

  margin-top: 80px;
  margin-right: 0;
  padding-bottom: 15px;
  align-self: flex-end;
  line-height: 1.2;

  transition: opacity 0.2s ease;
}


/***************** /*MAIN MAP*/

#map {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  height: calc(var(--vh) * 100);
  width: 100%;
  background-color: white;
  /*transition: background-color 0.5s ease; */*/
}

#connectionCanvas {
  position: absolute;
  opacity: 0;
  transition: opacity 0.4s ease;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;  /* Let clicks pass through */
  z-index: 2; /* Just above map, below UI */
}

.mapboxgl-marker {
  position: absolute;
  z-index: 10; /* ABOVE canvas */
}

.lichen-marker {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid black;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  cursor: pointer;
  /*transition: background 0.2s ease;*/*/
}

.lichen-marker.active .lichen-inner {
  background-color: #dea8df;
  background-image: none !important;
}

.lichen-marker.found-marker {
  width: 56px;
  height: 56px;
  border: 3px solid #dea8df; 
  outline: 2px solid #dea8df;
  animation: outlinePulse 2s ease-in-out infinite;
}

@keyframes outlinePulse {
  0%, 100% {
    outline-width: 2px;
    outline-color: #dea8df;
  }
  50% {
    outline-width: 8px;
    outline-color: #f2d1f3;
  }
}

.lichen-marker.found-marker .lichen-inner {
  transform: scale(1.5);
}

body.gallery-mode .lichen-marker {
  width: 100px;
  height: 100px;
  transition: width 0.3s ease, height 0.3s ease;
}

.lichen-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease;
}

#back-home {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 64px;
  height: 64px;
  background-color: transparent;
  color: black;
  font-size: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10001;
  /*transition: background 0.3s ease;*/
}

/*#back-home:hover {
  background-color: #dea8df;
}*/

#top-ui {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.top-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

#add-btn {
  position: fixed;
  z-index: 10001;
  top: 20px;
  left: 20px;
  background: #111;
  color: white;
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  font-size: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

#add-btn.rotated {
  transform: rotate(45deg); /* '+' turns into '×' visually */
}

#help-btn {
  background: #e8bce4; /* ✨ change this to your desired color */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  /*box-shadow: 0 4px 12px rgba(0,0,0,0.2);*/
}

#gallery-btn {
  background: #111; /* charcoal black */
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}


/***************** /*NEW LICHEN FORM*/

#form-container {
  position: absolute;
  z-index: 1000;
  top: 0px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  border-radius: 28px;
  padding: 20px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow-y: auto;
  max-height: 90vh;
}

#form-container.show {
  opacity: 1;
  pointer-events: auto;
}

#form-container h2 {
  font-size: 36px;
  margin-bottom: 0px;
}

#form-container .subhead {
  font-size: 16px;
  color: #ccc;
  margin-bottom: 12px;
  line-height: 1.2;
}

#form-container label {
  display: block;
  margin-bottom: 10px;
}

#form-container input[type="text"] {
  width: 97%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #aaa;
  padding: 10px 4px;
  font-size: 16px;
  color: white;
  outline: none;
}

#form-container input::placeholder {
  color: #aaa;
}

#location-form {
  padding-top: 45px; 
}

#location-form label {
  display: block;
  margin-bottom: 10px;
}

#location-form input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: none;
  border-bottom: 2px solid #ccc;
  background: transparent;
  outline: none;
  transition: border 0.2s;
}

#location-form input:focus {
  border-bottom-color: #222;
}

#location-form button {
  width: 100%;
  padding: 12px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}


.submit-button {
  display: block;
  width: 100%;
  background: #dea8df;
  color: black;
  font-weight: bold;
  font-size: 18px;
  border: none;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s ease;
}

.submit-button:hover {
  background: #e8bce4;
}

/***************** INFO CARD OVERLAY *****************/

#info-card {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2d2f30;              
  color: black;                    
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  z-index: 15;
  max-height: 90%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  
  /* Smoother, more consistent transition */
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translateY(100%);
  
  /* Ensure consistent state */
  opacity: 1;
  visibility: visible;
}

#info-card.visible.collapsed {
  transform: translateY(20px); /* Partially visible, image clipped */
}

#info-card.visible.expanded {
  transform: translateY(0%); /* Fully visible */
/*  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.2),
    0 -8px 30px rgba(0, 0, 0, 0.2);*/
}

#info-card.collapsed {
  /* When collapsed, the card sits lower, clipping the bottom of the image */
  border-radius: 20px 20px 0 0; /* Keep only top corners rounded */
}

#info-card.expanded {
  border-radius: 20px 20px 0 0; /* Keep only top corners rounded */
  box-shadow: 
    0 8px 30px rgba(0, 0, 0, 0.2),   /* Shadow below */
    0 -8px 30px rgba(0, 0, 0, 0.2);  /* Shadow above */
}

#info-card.collapsed .info-layout {
  max-height: 0;
  opacity: 0;
  padding-bottom: 0;
}

#info-card.expanded .info-layout {
  max-height: calc(100dvh - 275px);
  opacity: 1;
  padding-bottom: 24px; 
}

#info-card.hidden {
  transform: translateY(100%);
  /* Add a slight delay to prevent flash */
  transition-delay: 0.1s;
}

.hidden {
  display: none !important;
}

.info-layout {
  width: 100%;
  padding: 0 24px 0px; /* Start with 0 bottom padding */
  box-sizing: border-box;
  overflow-y: auto;
  
  /* Smooth transition for height and opacity */
  transition: 
    max-height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 0.3s ease 0.1s,
    padding 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    
  max-height: 0;
  opacity: 0;
  padding-bottom: 0;
}

.info-text {
  color: white;
  text-align: left;
  font-size: 16px;
  line-height: 1.5;
  margin-top: 50px;
}

.info-text h2 {
  font-size: 25px;
  font-weight: bold;
  margin-bottom: 8px;
  margin-top: 0;
}

.info-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.info-image-gallery img {
  max-width: 100%;
  /*border-radius: 12px;*/
  object-fit: cover;
}

.info-image-wrapper {
  position: relative;
  width: 100%;
}

.info-text p {
  margin-bottom: 12px;
}

#info-image {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); 
  margin-bottom: -20px; /* Extend the image down so it gets clipped */
  /*transition: box-shadow 0.4s ease, opacity 0.3s ease;*/
  position: relative; /* Add this to prevent z-index conflicts */
  z-index: 5; 

  transition: opacity 0.4s ease, box-shadow 0.3s ease;
  opacity: 0; /* Start invisible */
}

#info-image.loaded {
  opacity: 1; /* Fade in when loaded */
}

/* Enhanced shadow when expanded */
#info-card.expanded #info-image {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#info-name {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
}

#info-desc, #info-personality {
  margin-bottom: 12px;
}

.info-info-image {
  width: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  position: relative;
  z-index: 0; /* Keep other images below the main image */
}

#toggle-info {
  position: absolute;
  bottom: 40px;
  right: 24px;
  background: #d2a2d3;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  z-index: 6;
  transition: opacity 0.2s ease;
}

/*#close-info {
  position: absolute;
  top: 10px;
  right: 20px;
  color: black;
  font-size: 60px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 6;
  line-height: 1;
  transition: opacity 0.2s ease;
}*/

/* FOUND BUTTON STYLES - this was missing! */
#found-button {
  font-weight: 800;
  font-size: 28px;
  text-align: right;
  color: #dea8df;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1.1;
  text-transform: uppercase;
  margin-top: 32px;
  margin-left: auto;
  display: block;
  
  /* Smooth transition for found button */
  transition: 
    opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
    transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

/* Hide found button in collapsed state */
#info-card.collapsed #found-button {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition-delay: 0s; /* No delay when hiding */
}

#info-card.expanded #found-button {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


/***************** /*GALLERY MODE*/

body.gallery-mode #map {
  background-color: black;
  width: 100%;
}

body.gallery-mode #connectionCanvas {
  opacity: 1;
}

body.gallery-mode .mapboxgl-canvas {
  opacity: 0;
  transition: background-color 0.5s ease, opacity 0.5s ease;
}

body .mapboxgl-ctrl-logo,
body .mapboxgl-ctrl-attrib {
  display: none !important;
}

body.gallery-mode .mapboxgl-ctrl-geolocate,
body.gallery-mode .mapboxgl-ctrl-logo,
body.gallery-mode .mapboxgl-ctrl-attrib {
  display: none !important;
}

body.gallery-mode .custom-geolocate {
  display: none;
}


/*MAPBOX STUFF*/
/*.mapboxgl-ctrl-geolocate {
  width: 40px !important;
  height: 40px !important;
}*/

/* Hide the default geolocate button */
.mapboxgl-ctrl-geolocate {
  display: none !important;
}

.mapboxgl-user-location-dot,
.mapboxgl-user-location-accuracy-circle {
  pointer-events: none !important;
}

/* Custom crosshair button */
.custom-geolocate {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1000;
  padding: 0;
}

/* Create the crosshair with pseudo-elements */
.custom-geolocate::before,
.custom-geolocate::after {
  content: '';
  position: absolute;
  background: #333; /* Change to 'white' for white crosshair */
  border-radius: 1px;
  transition: all 0.2s ease;
}

/* Vertical line */
.custom-geolocate::before {
  width: 3px;
  height: 20px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Horizontal line */
.custom-geolocate::after {
  width: 20px;
  height: 3px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Hover effect */
.custom-geolocate:hover::before,
.custom-geolocate:hover::after {
  background: #666;
  transform: translate(-50%, -50%) scale(1.1);
}

/* White version (add 'white' class for dark backgrounds) */
.custom-geolocate.white::before,
.custom-geolocate.white::after {
  background: white;
}

.custom-geolocate.white:hover::before,
.custom-geolocate.white:hover::after {
  background: #ddd;
}



body.gallery-mode #top-ui,
body.gallery-mode #add-btn {
  display: none !important;
}

/* Optional poetic header and close button */
#gallery-title {
  position: fixed;
  padding: 20px 24px 40px;
  width: 100%;
  text-align: left;
  font-size: 60px;
  font-weight: bold;
  line-height: 0.9;
  color: white;
  z-index: 2000;
  /* Remove the individual pointer-events: none from here */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#exit-gallery {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 60px;
  background: none;
  border: none;
  color: white;
  z-index: 2001;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* When visible, show them */
#gallery-title.visible,
#exit-gallery.visible {
  opacity: 1;
  pointer-events: auto;
}

/* UI elements fade out in gallery mode */
#top-ui,
#add-btn {
  transition: opacity 0.5s ease;
}

body.gallery-mode #top-ui,
body.gallery-mode #add-btn {
  opacity: 0;
  pointer-events: none;
}

/***************** /*CAMERA OVERLAY*/

#camera-container {
  position: fixed;
  top: 0;
  left: 0;
  height: calc(var(--vh) * 100);
  width: 100%;
  background: black;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* snap UI to bottom */
  align-items: center;
  overflow: hidden;
}

#camera-container.hidden {
  display: none;
}

#camera-container.fade-in {
  animation: fadeInCamera 0.4s ease forwards;
}

#camera-container.fade-out {
  animation: fadeOutCamera 0.4s ease forwards;
}

@keyframes fadeInCamera {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOutCamera {
  from { opacity: 1; }
  to { opacity: 0; }
}

#camera-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
}


#video {
  position: absolute;
  top: 0;
  left: 0;
  height: calc(var(--vh) * 100);
  width: 100%;
  object-fit: cover;
  z-index: 0;
}


#camera-bottom,
#close-camera {
  z-index: 1;
}

#camera-label {
  color: white;
  font-size: 16px;
  opacity: 0.6;
  margin-top: 20px;
  margin-bottom: 50px;
  text-align: center;
  font-family: 'Avenir', sans-serif;
}

#camera-confirm-label {
  position: absolute;
  bottom: 150px;
  width: 70%;
  margin: 0 auto; 
  left: 0;
  right: 0;
  text-align: center;
  color: white;
  font-size: 16px;
  opacity: 0.6;
  font-family: 'Avenir', sans-serif;
  pointer-events: none;
  z-index: 3; /* higher than canvas/video */
}

#snap {
  background: white;
  border: 4px solid #d2a2d3;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  margin-bottom: 25px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: all 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Mobile touch properties */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  
  /* Force hardware acceleration */
  transform: translateZ(0);
  will-change: transform;
}

/* Desktop hover effect only */
@media (hover: hover) and (pointer: fine) {
  #snap:hover:not(:active):not(.pressed) {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
  }
}

/* Active states for both desktop and mobile */
#snap:active,
#snap.pressed {
  transform: scale(0.75) !important;
  background: #d2a2d3 !important;
  border-color: #d2a2d3 !important;
  /*box-shadow: 0 0 20px rgba(210, 162, 211, 0.8) !important;*/
}

#canvas {
  position: absolute;
  top: 0;
  left: 0;
  height: calc(var(--vh) * 100);
  width: 100%;
  object-fit: cover;
  z-index: 1; /* On top of video, below UI */
  display: none;
}

#close-camera {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 64px;
  height: 64px;
  background-color: #e6b7e1; /* soft pink */
  color: white;
  font-size: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}

#confirmation-buttons {
  position: absolute;
  bottom: 45px;
  display: flex;
  justify-content: center;
  gap: 65px;
  z-index: 2;
}

#confirmation-buttons button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #d2a2d3;
  border: 4px solid #d2a2d3;
  color: white;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform 0.2s ease;
}

#confirmation-buttons button:active {
  transform: scale(0.95);
}

#confirmation-buttons.hidden {
  display: none;
}

#thinking-overlay {
  position: fixed;
  inset: 0;
  background: #222; /* or whatever dark tone you prefer */
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  text-align: center;
  z-index: 12000;
  font-family: 'Avenir', sans-serif;
  transition: opacity 0.3s ease;
}

#thinking-overlay.hidden {
  display: none;
}

#thinking-text {
  opacity: 1;
  transition: opacity 1.5s ease;
}

#thinking-text.fade-out {
  opacity: 0;
}

#thinking-text.fade-in {
  opacity: 1;
}


/***************** /*CHAT PAGE*/

:root {
  --vh: 1vh;
}

.chat-container {
  /*transition: opacity 0.5s ease;*/
  display: flex;
  flex-direction: column;
  height: 100%;
  height: calc(var(--vh, 1vh) * 100);
  background-color: #111;
  position: relative;
}

.chat-container.visible {
  
}

.photo-header {
  width: 100%;
  height: 250px;
  position: fixed; /* Keep it fixed at top */
  top: 0;
  left: 0;
  overflow: hidden;
  z-index: 10;
  flex-shrink: 0; /* Don't let it shrink */
}

#lichen-photo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100%;
  height: calc(var(--vh, 1vh) * 100);
  border-radius: 20px;
  object-fit: cover;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
  
  /* This is the animation - it will shrink and move */
  transition: all 1.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#lichen-photo.shrink {
  width: 100%;
  height: 250px;
  border-radius: 20px;
  z-index: 10;
}

.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 64px;
  height: 64px;
  background-color: rgba(230, 183, 225, 0.9);
  color: white;
  font-size: 40px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  cursor: pointer;
  z-index: 11;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.back-button.visible {
  opacity: 1;
}

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 250px; /* Push down by header height */
  padding: 0px 24px 20px 24px;
  min-height: 0; /* Important for flex */
  max-height: calc(calc(var(--vh, 1vh) * 100) - 250px);
  height: 100%;
  box-sizing: border-box;
}

.chat-box {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  gap: 10px;
  padding-bottom: 10px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  min-height: 0;
}

.chat-box {
  height: 100% !important;
  width: 100% !important;
}

.chat-box::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  animation: messageSlideIn 0.3s ease forwards;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.lichen {
  background-color: #d2a2d3;
  color: black;
  align-self: flex-start;
  border-bottom-left-radius: 8px;
}

.message.user {
  background-color: #444;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 8px;
}

.message.typing {
  background-color: #d2a2d3;
  color: black;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 30px;
  padding: 10px 14px;
  position: relative;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: black;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% {
    opacity: 0.2;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

#chat-form {
  margin-top: 10px;
  position: relative;
}

.input-wrapper {
  position: relative;
  color: white;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom); 
}

#user-input {
  width: 100%;
  padding: 16px 60px 16px 20px;
  border-radius: 25px;
  border: none;
  font-size: 16px;
  box-sizing: border-box;
  background: white;
  outline: none;
}

#user-input::placeholder {
  color: #888;
}

#send-button {
  position: absolute;
  right: 4px;
  top: 45%;
  transform: translateY(-50%);
  background-color: #d2a2d3;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background-color 0.2s ease;
}

/***************** /*ADMIN PAGE STUFF*/

#admin-wrapper {
  height: 100dvh;
  overflow-y: auto;
  padding: 50px;
  padding-bottom: 100px;
  box-sizing: border-box;
}

#entries {
  margin: 0 auto;
  padding-bottom: 40px; 
}

#download-data {
  padding: 4px 8px;
  font-size: 15px;
  background: #eee;
  border: 1px solid #aaa;
  border-radius: 6px;
  cursor: pointer;
}

.admin-entry {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 16px;
  margin: 6px 0;
  font-size: 15px;
  line-height: 1.5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 5px;
}


.admin-entry p {
  margin: 2px 0;
}

.admin-entry img {
  height: 200px;
  margin-right: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  object-fit: cover;
}

.image-row {
  display: flex;
  margin-bottom: 2px;
}

.admin-entry input[type="text"],
.admin-entry textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 10px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  resize: vertical;
  vertical-align: middle;
}

/* autosize textarea */
.admin-entry textarea {
  overflow-y: auto;
  resize: vertical;
  max-height: none;
  min-height: 50px;
}

.admin-entry button {
  padding: 4px 8px;
  font-size: 15px;
  background: #eee;
  border: 1px solid #aaa;
  border-radius: 6px;
  cursor: pointer;
}

.admin-buttons {
  display: flex;
  gap: 4px;
  justify-content: flex-start;
  margin-top: 8px;
}

.admin-field label {
  font-weight: bold;
}

.admin-thumb {
  height: 200px;
  width: 200px;
  margin: 4px 4px 5px 0;
  border-radius: 6px;
  object-fit: cover;
}

.collapsible.collapsed {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.collapsible {
  transition: max-height 0.4s ease;
}

.admin-session {
  background: #f3f3f3;
  border: 1px solid #ccc;
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-session h3 {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
  word-break: break-word;
}

.session-json {
  max-height: 200px;
  overflow: auto;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 4px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.4;
}

.session-actions {
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

