/* Brand-compliant fonts - replace Adobe Fonts URL with your actual project URL */
/* @import url('https://use.typekit.net/YOUR-PROJECT-ID.css'); */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@400;500;600;700&family=Simonetta:ital,wght@1,900&display=swap');

/* General Styling */
body {
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  color: #123435;
  background-color: #F4F1ED;
  /* Onion - brand background */
  margin: 0;
  padding: 0;
  font-size: 16px;
  transition: transform 0.3s ease;
}

/* Headings */
h1 {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  font-size: 36px;
  font-weight: 500;
  color: #123435;
  /* Kale */
  text-align: center;
  margin-top: 20px;
}

/* Main Header Styling */
.main-header {
  text-align: center;
  position: relative;
  margin-top: 30px;
  margin-bottom: 20px;
}

#main-title {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  font-size: 36px;
  font-weight: 400;
  font-style: normal;
  color: #123435;
  /* Kale */
  margin: 0;
  line-height: 1.1;
}

.subtitle {
  text-align: center;
  margin-top: 3px;
}

.by-text {
  font-family: 'Simonetta', serif;
  /* Keep original ChatGPTree branding font */
  font-size: 10px;
  font-weight: 900;
  font-style: italic;
  color: #2F5E44;
  /* Keep original color for branding */
  margin-right: 0px;
}

.brand-text {
  font-family: 'Simonetta', serif;
  /* Keep original ChatGPTree branding font */
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  color: #2F5E44;
  /* Keep original color for branding */
}

/* User Feedback Styling */
#user-feedback {
  width: 80%;
  max-width: 600px;
  margin: 10px auto;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease-out;
}

#user-feedback.info {
  background-color: #C4E8DD;
  color: #123435;
  /* Kale */
}

#user-feedback.error {
  background-color: #F8D7DA;
  color: #721C24;
  border: 1px solid #F5C6CB;
}

#user-feedback.success {
  background-color: #D4EDDA;
  color: #155724;
  animation: pulse 5s infinite;
}

/* Tree Info */
#tree-info {
  font-size: 18px;
  color: #333333;
  margin: 20px auto;
  width: 80%;
  max-width: 800px;
  background-color: #EBE0CB;
  /* Cauliflower - brand background */
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#tree-info h2 {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  font-size: 24px;
  font-weight: 500;
  color: #4B6E40;
  margin-top: 0;
  margin-bottom: 5px;
}

#tree-info p {
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
  color: #333333;
  margin: 0;
}

#tree-info .icon {
  margin-right: 5px;
  color: #123435;
  /* Kale */
}

#tree-info .info-item {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

#tree-info a {
  color: #4B6E40;
  text-decoration: none;
  transition: color 0.3s ease;
}

#tree-info a:hover {
  color: #1B5E20;
  text-decoration: underline;
}

/* Scanner Container */
#scanner-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

#scanner-container>div {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Chat Container */
#chat-container {
  display: none;
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  border: 1px solid #ccc;
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  height: 500px;
  background-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

.chat-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

/* 
.chat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 2;
}
*/

.chat-log {
  height: calc(100% - 70px);
  padding: 10px;
  padding-bottom: 60px;
  overflow-y: scroll;
  position: relative;
  z-index: 3;
}

/* Action buttons container - FORCE HORIZONTAL LAYOUT */
.action-buttons-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  /* Closer together horizontally */
  margin: -10px 0 -10px 0;
  /* NEGATIVE MARGINS: Pull up from above, reduce space below */
}

/* OVERRIDE BUTTON MARGINS - This is why gap wasn't working! */
#new-tree-btn,
#map-btn {
  margin: 5px;
}

/* Individual action buttons */
#new-tree-btn,
#map-btn {
  background-color: #2F5E44;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  text-align: center;
  flex: 0 0 140px;
  /* Fixed width */
  padding: 15px 10px;
  font-size: 16px;
}

#new-tree-btn:hover,
#map-btn:hover {
  background-color: #234a37;
  transform: translateY(-2px);
}

#new-tree-btn i,
#map-btn i {
  margin-right: 6px;
}

/* Dropdown Toggle and Curtain Styles */
.chat-dropdown-toggle {
  position: absolute;
  bottom: calc(100% - 40px);
  /* Positioned just above chat input */
  left: 0;
  right: 0;
  height: 40px;
  background-color: #2F5E44;
  /* Sage - brand button color */
  /* Matches "View Map" button green */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 4;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  gap: 10px;
}

.chat-dropdown-toggle:hover {
  background-color: rgba(47, 94, 68, 0.3);
  /* Subtle hover effect */
}

.chat-dropdown-toggle i {
  color: white;
  font-size: 24px;
  transition: transform 0.2s ease;
}

.chat-dropdown-toggle span {
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: white;
}

.chat-dropdown-toggle i:hover {
  transform: scale(1.1);
  /* Slight enlarge on hover */
}

.chat-dropdown-curtain {
  position: absolute;
  top: -100%;
  /* Initially off-screen */
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 4;
  /* Positioned above chat content */
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: top 0.4s ease, opacity 0.4s ease;
  border-bottom: 1px solid #ddd;
  max-height: 60%;
  /* Limit height */
  overflow-y: auto;
  opacity: 0;
  /* Start fully transparent */
}

.chat-dropdown-curtain.open {
  top: 40px;
  /* Drop down just below toggle */
  opacity: 1;
  /* Fully visible when open */
}

.chat-dropdown-title {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  font-size: 22px;
  /* Slightly larger for emphasis */
  font-weight: 500;
  /* Remove bold for a more classic look */
  color: #123435;
  /* Kale */
  /* Deep forest green, matching other tree-themed text */
  text-align: center;
  margin: 0 0 15px;
}

.suggested-questions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.question-btn {
  background-color: rgba(240, 240, 240, 0.8);
  border: 1px solid rgb(51, 132, 108);
  border-radius: 20px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  color: rgb(51, 132, 108);
  text-align: left;
}

.question-btn:hover {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
}

.question-section-header {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  color: #123435;
  /* Kale */
  text-align: center;
  margin: 15px 0 10px;
  opacity: 0.7;
  position: relative;
}

.question-section-header::before,
.question-section-header::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background-color: rgba(18, 52, 53, 0.2);
  /* Kale with transparency */
}

.question-section-header::before {
  left: 0;
}

.question-section-header::after {
  right: 0;
}

/* Adjustments to ensure chat layout accommodates dropdown */
.chat-log {
  height: calc(100% - 160px);
  /* Reduce height to make room for dropdown */
  padding-top: 40px;
  /* Space for dropdown toggle */
  padding-bottom: 80px;
}

.chat-background,
.chat-overlay {
  top: 40px;
  /* Adjust to start below toggle */
}

/* Suggestion container */
.suggestions-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  justify-content: center;
}

.suggestion-btn {
  background-color: rgba(240, 240, 240, 0.8);
  border: 1px solid rgb(51, 132, 108);
  ;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  color: rgb(51, 132, 108);
  ;
}

.suggestion-btn:hover {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
}


/* Updated Message Styling */
.message {
  padding: 12px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  max-width: 75%;
  word-wrap: break-word;
  line-height: 1.5;
  position: relative;
  font-size: 16px;
  background-color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
}

.user-message {
  background-color: rgba(227, 242, 253, 0.99);
  color: #0D47A1;
  border-radius: 18px;
  /* Changed from: border-radius: 18px 18px 0 18px; */
  align-self: flex-end;
  margin-left: auto;
  margin-right: 15px;
}

.ai-message {
  background-color: rgba(51, 132, 108, 0.99);
  color: #fff;
  border-radius: 18px;
  /* Changed from: border-radius: 18px 18px 18px 0; */
  align-self: flex-start;
  margin-right: auto;
  margin-left: 15px;
}

/* System greeting */
.system-greeting {
  background-color: rgba(240, 240, 240, 0.8);
  border: 1px solid #ddd;
  font-style: italic;
  text-align: center;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 8px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  font-size: 16px;
}

/* Chat Input Container - Updated for speech toggle */
.chat-input-container {
  display: flex;
  border-top: 1px solid rgba(204, 204, 204, 0.5);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 4;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  align-items: center;
}

.chat-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Update input to leave space for mic inside */
.chat-input-container input {
  width: 100%;
  padding: 12px 30px 12px 8px !important;
  /* Extra padding on right for mic */
  border: 1px solid rgba(204, 204, 204, 0.5);
  border-radius: 20px;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 15px;
  transition: all 0.3s ease;
  box-shadow: none;
}

#chat-container input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f0f0f0;
}

/* Speech Toggle Button Styling */
.speech-toggle {
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.speech-toggle.recording {
  background-color: #ff3b30;
  /* Red background while recording */
  color: white;
  /* White icon while recording */
}

.speech-toggle:hover {
  color: #2F5E44;
  /* Sage - brand button color */
  background-color: rgba(47, 94, 68, 0.1);
}

.speech-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: transparent;
}

/* Add styles for the input while receiving speech */
.chat-input-container input.receiving-speech {
  background: linear-gradient(90deg,
      rgba(47, 94, 68, 0.1) 0%,
      rgba(47, 94, 68, 0.2) 50%,
      rgba(47, 94, 68, 0.1) 100%);
  background-size: 200% 100%;
  animation: gradient-slide 2s linear infinite;
}

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

  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }

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

@keyframes gradient-slide {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.speech-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: transparent;
}

/* Send Button */
.send-button {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  border: none;
  border-radius: 20px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  min-width: 36px;
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #f0f0f0;
}

.send-button:hover:not(:disabled) {
  background-color: #234a37;
  transform: scale(1.05);
}

.send-button i {
  font-size: 18px;
}

#session-timer {
  position: fixed;
  top: 5px;
  right: 5px;
  background-color: rgba(47, 94, 68, 0.9);
  /* Sage - brand button color */
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

#session-timer i {
  margin-right: 5px;
}

#session-timer.warning {
  background-color: rgba(255, 0, 0, 0.9);
  color: white;
}

/* Buttons Container */
.buttons-container {
  text-align: center;
  margin: 20px auto 5px auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* This sets equal spacing between buttons */
}

/* General Button Styling */
.buttons-container button {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  display: inline-block;
  margin: 10px;
  padding: 15px 30px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 200px;
}

.buttons-container button:hover {
  background-color: #234a37;
  transform: translateY(-2px);
}

.buttons-container button:active {
  transform: translateY(1px);
}

.buttons-container button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.buttons-container button i {
  margin-right: 8px;
}

/* Error Message Styling */
.error-message {
  text-align: center;
  font-weight: 600;
  color: #721C24;
  background-color: #FFF3F3;
  padding: 12px;
  border-radius: 5px;
  margin: 20px auto;
  width: 80%;
  max-width: 600px;
  animation: fadeIn 0.3s ease-out;
  border-left: 4px solid #721C24;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #721C24;
  font-size: 16px;
}

.location-instructions {
  font-size: 14px;
  background-color: #f8f9fa;
  padding: 10px;
  margin-top: 10px;
  border-radius: 4px;
  text-align: left;
  line-height: 1.5;
}

/* Animation for Feedback Messages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Styles for loading and privacy pages */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #F4F1ED;
  /* Onion - brand background */
  z-index: 1000;
}

/* #loading-title {
  font-family: 'forevs', 'Montserrat', sans-serif;
  font-size: 64px;
  font-weight: 500;
  color: #123435;
  opacity: 0;
  animation: fadeIn 2s ease-in-out forwards;
} */

#loading-image {
  max-width: 300px;
  max-height: 300px;
  width: auto;
  height: auto;
  opacity: 0;
  animation: imageFadeInOut 3s ease-in-out forwards;
}

@keyframes imageFadeInOut {
  0% {
    opacity: 0;
  }

  30% {
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

#privacy-page,
#gps-privacy-page,
#feedback-page {
  text-align: center;
  padding: 20px;
  max-width: 90%;
  margin: 0 auto;
  padding-top: 0px;
}

#privacy-page h2,
#gps-privacy-page h2,
#feedback-page h2 {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  font-weight: 500;
  color: #123435;
  /* Kale */
  margin-bottom: 0px;
  margin-top: 0;
  font-size: 24px;
}

#privacy-page h4,
#gps-privacy-page h4,
#feedback-page h4 {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  font-weight: 500;
  color: #123435;
  /* Kale */
  margin-bottom: 15px;
  margin-top: 0;
  font-size: 24px;
}

#privacy-page h3,
#gps-privacy-page h3 {
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  color: #123435;
  /* Kale */
  margin-bottom: 0px;
  margin-top: 20px;
  font-size: 20px;
}

#privacy-page p,
#gps-privacy-page p {
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
  margin-bottom: 20px;
  max-width: 100%;
  padding: 0 15px;
}

#continue-btn,
#gps-continue-btn,
#submit-feedback {
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

#continue-btn:hover,
#gps-continue-btn:hover,
#submit-feedback:hover {
  background-color: #234a37;
  transform: translateY(-2px);
}

#continue-btn:active,
#gps-continue-btn:active,
#submit-feedback:active {
  transform: translateY(1px);
}

/* Improve the overall layout */
#main-app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Styles for loading overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Updated spinner styles */
.spinner {
  border: 4px solid #E8F5E9;
  border-top: 4px solid #2F5E44;
  /* Sage - brand button color */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

#submit-feedback .spinner {
  width: 20px;
  height: 20px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Feedback Form Styling */
#feedback-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

#feedback-page h1 {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  color: #123435;
  /* Kale */
  margin-bottom: 15px;
  font-size: 36px;
}

#feedback-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#thank-you-message {
  display: none;
  /* Initially hidden */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  padding: 20px;
}

#thank-you-message h2 {
  margin-bottom: 20px;
}

#thank-you-message p {
  margin-bottom: 20px;
}

/* Star Rating Styling */
.star-rating {
  font-size: 0;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
}

.star {
  font-size: 48px;
  cursor: pointer;
  color: white;
  transition: all 0.3s ease;
  margin: 0 10px;
}

/* Make the first star always purple/lavender */
.star:first-child {
  color: #A080E1;
}

.star:hover,
.star.active {
  color: #A080E1;
}

#feedback-page input,
#feedback-page textarea {
  width: 100%;
  max-width: 300px;
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #C4E8DD;
  border-radius: 5px;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
}

#feedback-page textarea {
  height: 100px;
  resize: vertical;
}

#submit-feedback {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.3s ease;
}

#submit-feedback:hover {
  background-color: #234a37;
  transform: translateY(-2px);
}

#submit-feedback:active {
  transform: translateY(1px);
}

/* Styles for social media buttons */
.social-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  /* Consistent spacing */
  margin-top: 20px;
  width: 100%;
  max-width: 300px;
  /* Limit width for better layout */
}

.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.social-button i {
  font-size: 28px;
}


#voice-footer {
  display: none;
  text-align: center;
  padding: 5px;
  background-color: #F4F1ED;
  /* Onion - brand background */
  color: #123435;
  /* Kale */
  font-size: 14px;
  font-style: italic;
  /* Makes it look like a coming soon message */
  opacity: 0.8;
  /* Slightly faded to distinguish from main footer */
}

#global-footer {
  text-align: center;
  padding: 1px;
  background-color: #F4F1ED;
  /* Onion - brand background */
  color: #123435;
  /* Kale */
  font-size: 14px;
}

#loading-page #global-footer {
  display: none;
}

#loading-page #voice-footer {
  display: none;
}

/* Accessibility Improvements */
input:focus,
textarea:focus,
button:focus,
.star:focus,
.social-button:focus,
.speech-toggle:focus {
  outline: 2px solid #2F5E44;
  /* Sage - brand button color */
  outline-offset: 2px;
}

/* Improved touch targets for mobile */
@media (max-width: 768px) {

  input[type="text"],
  input[type="email"],
  input[type="number"],
  textarea,
  button,
  .social-button {
    min-height: 44px;
    padding: 10px;
  }

  .star {
    font-size: 36px;
  }

  .speech-toggle,
  .send-button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Additional Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

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

/* Improved loading overlay */
#loading-overlay .spinner {
  border-top-color: #2F5E44;
  /* Sage - brand button color */
}

#loading-message {
  margin-top: 20px;
  color: white;
  font-size: 18px;
  text-align: center;
}

/* Chat scroll bar styling */
.chat-log {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.3s ease;
  height: calc(100% - 120px);
  /* Increased to accommodate dropdown toggle */
  padding-bottom: 80px;
  /* More padding at bottom */
}

.chat-log::-webkit-scrollbar {
  width: 8px;
}

.chat-log::-webkit-scrollbar-track {
  background: transparent;
}

.chat-log::-webkit-scrollbar-thumb {
  background-color: rgba(136, 136, 136, 0);
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

.chat-log:hover::-webkit-scrollbar-thumb,
.chat-log:focus::-webkit-scrollbar-thumb,
.chat-log:active::-webkit-scrollbar-thumb {
  background-color: rgba(136, 136, 136, 0.5);
}

.chat-log:hover::-webkit-scrollbar-thumb:hover {
  background-color: rgba(136, 136, 136, 0.8);
}

@media (max-width: 768px) {
  .chat-log::-webkit-scrollbar {
    width: 6px;
  }
}

/* Responsive design improvements */
@media screen and (max-width: 600px) {
  #main-app {
    padding: 10px;
  }

  .message {
    max-width: 90%;
  }

  #tree-info,
  #chat-container {
    width: 95%;
  }

  #continue-btn,
  #gps-continue-btn,
  #submit-feedback {
    padding: 12px 20px;
    font-size: 16px;
  }

  #loading-title {
    font-size: 48px;
  }

  #privacy-page h2,
  #gps-privacy-page h2,
  #feedback-page h2 {
    font-size: 22px;
  }

  #privacy-page p,
  #gps-privacy-page p {
    font-size: 16px;
  }

  #feedback-page {
    width: 95%;
    max-width: 350px;
    padding: 15px;
  }

  #feedback-page input,
  #feedback-page textarea {
    font-size: 16px;
    padding: 10px;
  }

  .star {
    font-size: 32px;
  }

  .buttons-container button {
    width: 80%;
    margin: 10px auto;
  }

  .social-button {
    width: 50px;
    height: 50px;
  }

  .social-button i {
    font-size: 24px;
  }

  .chat-input-container {
    padding: 8px;
  }

  .chat-buttons {
    gap: 4px;
  }

  .speech-toggle,
  .send-button {
    width: 32px;
    height: 32px;
  }

  .speech-toggle i,
  .send-button i {
    font-size: 16px;
  }
}

/* Map Overlay Styling */
#map-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.map-content {
  position: relative;
  width: 90%;
  height: 90vh;
  max-width: 1200px;
  border-radius: 30px;
  overflow: hidden;
}

#map-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 30px;
}

#close-map-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  /* Make sure button is above map */
}

#close-map-btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

/* Image overlay */
#image-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.image-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  border-radius: 30px;
  overflow: hidden;
}

#detail-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 30px;
}

/* Just add caption styles (since this is unique to images) */
.image-caption {
  color: white;
  margin-top: 15px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
  padding: 10px;
}

/* Just add link styles (since this is unique to images) */
.image-link {
  color: #FFD700;
  /* Changed to match the heart color */
  cursor: pointer;
  text-decoration: underline;
  display: inline-block;
  margin-top: 5px;
}

.image-link:hover {
  color: #FFD700;
  /* Slightly darker shade for hover */
}

/* Close button can use same styles as map */
#close-image-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-image-btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

.messageboard-button {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  font-size: 16px;
  margin: 20px 0;
  display: inline-block;
  transition: all 0.3s ease;
}

.messageboard-button:hover {
  background-color: #234a37;
  transform: translateY(-2px);
}

#report-container {
  position: fixed;
  top: 5px;
  left: 5px;
  z-index: 1000;
  display: none;
}

#report-button {
  background-color: rgba(47, 94, 68, 0.9);
  /* Sage - brand button color */
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

#report-button:hover {
  background-color: rgba(47, 94, 68, 1);
  /* Sage - brand button color */
  transform: translateY(-1px);
}

.report-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-width: 200px;
}

.report-dropdown.show {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-option {
  width: 100%;
  padding: 10px 15px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #333;
  transition: all 0.2s ease;
  text-decoration: none;
}

.dropdown-option:hover {
  background-color: #f5f5f5;
}

.dropdown-option i {
  width: 20px;
}

#report-fault {
  color: #dc3545;
}

#get-in-touch {
  color: #28a745;
}

.dropdown-option[href*="messageboard"] {
  color: #A080E1;
}

/* Lavender */

.dropdown-option[href*="news"] {
  color: #e7a80c;
}

.dropdown-option[href*="donate"] {
  color: #054A29;
}

#map-container {
  width: 100%;
  height: 80vh;
  border-radius: 30px;
  z-index: 1;
}

.custom-marker-wrapper {
  background: none;
  border: none;
}

.custom-tree-marker {
  width: 30px;
  height: 42px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.custom-tree-marker i {
  font-size: 24px;
  color: #2F5E44;
  /* Sage - brand button color */
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.2);
}

.custom-popup {
  text-align: center;
  padding: 10px;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  /* Matching your site's font */
}

.custom-popup h3 {
  margin: 0 0 5px 0;
  color: #2F5E44;
  /* Sage - brand button color */
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  /* Matching your tree info font */
  font-size: 18px;
}



/* Background image under scn-btn */

.tree-image {
  width: auto;
  height: auto;
  max-width: 100%;
  /* Adjust scale percentage here */
  max-height: 45vh;
  /* Maximum height relative to viewport */
  display: block;
  margin: 1rem auto;
  opacity: 1;
  padding-top: 2rem;
  object-fit: contain;
  touch-action: manipulation;
  /* Less aggressive than 'none', still prevents zoom */
  pointer-events: none;
  /* Prevents all click/touch interactions */
  -webkit-touch-callout: none;
  /* Prevents iOS callout */
  -webkit-user-select: none;
  /* Safari */
  -khtml-user-select: none;
  /* Konqueror HTML */
  -moz-user-select: none;
  /* Firefox */
  -ms-user-select: none;
  /* Internet Explorer/Edge */
  user-select: none;
  /* Non-prefixed version */
}

/* Benefits Overlay Styles */
.benefits-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.benefits-content {
  background-color: white;
  border-radius: 15px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

.benefits-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.benefits-header h2 {
  margin: 0;
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  color: #123435;
  /* Kale */
  font-size: 32px;
}

.benefits-body {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.benefit-section {
  padding: 25px;
  border-radius: 10px;
  background-color: #F4F1ED;
  /* Onion - brand background */
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.benefit-section:nth-child(1) {
  animation-delay: 0.1s;
}

.benefit-section:nth-child(2) {
  animation-delay: 0.3s;
}

.benefit-section:nth-child(3) {
  animation-delay: 0.5s;
}

.benefit-section h3 {
  color: #123435;
  /* Kale */
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  margin-top: 0;
  margin-bottom: 25px;
  font-size: 24px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.benefit-item {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  padding: 25px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.benefit-item i {
  font-size: 32px;
  color: #2F5E44;
  /* Sage - brand button color */
  margin-bottom: 15px;
}

.benefit-item h4 {
  margin: 10px 0;
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  color: #123435;
  /* Kale */
  font-size: 18px;
  font-weight: bold;
}

.benefit-item p {
  margin: 0;
  color: #2F5E44;
  /* Sage - brand button color */
  font-weight: bold;
  font-size: 24px;
  animation: countUp 0.8s ease forwards;
}

/* Close button styling to match atlas */
.benefits-header .close-btn {
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.benefits-header .close-btn:hover {
  background-color: rgba(255, 255, 255, 0.9);
}

ul {
  list-style-type: none;
  padding-left: 0;
}

li {
  padding: 8px 0;
  line-height: 1.5;
}

/* LEGAL LINKS */

/* Legal Links Styling */
.legal-links {
  margin-top: 15px;
  text-align: center;
  margin-bottom: 15px !important;
}


.legal-links a {
  color: #2F5E44;
  /* Sage - brand button color */
  font-size: 14px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  opacity: 0.9;
}

.legal-links a:hover {
  color: #234a37;
  text-decoration: underline;
  opacity: 1;
  transform: translateY(-1px);
}

/* Style the separator */
.legal-links {
  font-size: 14px;
  color: #666;
  margin: 0 8px;
}

/* ChatGPTree Title Styling */

.chatgptree-title {
  font-family: 'Simonetta', serif !important;
  font-weight: 900 !important;
  font-style: italic !important;
  /* Keep same color and size as existing h2 titles */
  color: #2F5E44 !important;
  /* Same as other h2 titles */
  font-size: 24px;
  /* Same as other h2 titles */
  margin-top: 15px !important;
}



/* DONATION HEART */

.donate-heart {
  position: absolute;
  bottom: 80px;
  right: 9px;
  background: transparent;
  border: 2px solid #2F5E44;
  /* Sage - brand button color */
  /* Round green border */
  border-radius: 50%;
  /* Makes it circular */
  width: 44px;
  height: 44px;
  color: #2F5E44;
  /* Sage - brand button color */
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donate-heart:hover {
  transform: scale(1.1);
  color: #234a37;
  border-color: #234a37;
  /* Border color changes on hover too */
}

/* Tree Cards Overlay Styles */
.cards-content {
  background-color: #F4F1ED;
  /* Onion - brand background */
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  height: 95vh;
  margin: 10px auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Header Section */
.cards-header {
  padding: 15px 20px;
  border-bottom: 1px solid #e5e0d5;
  background: #F4F1ED;
  /* Onion - brand background */
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cards-header h2 {
  margin: 0;
  color: #123435;
  /* Kale */
  font-size: 24px;
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
}

.view-controls {
  display: flex;
  gap: 10px;
}

.view-controls button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #123435;
  /* Kale */
  padding: 5px;
  transition: color 0.2s ease;
}

.view-controls button:hover {
  color: #2F5E44;
  /* Sage - brand button color */
}

/* List View */
.tree-list {
  display: block;
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  z-index: 1;
  background: #F4F1ED;
  /* Onion - brand background */
}

.tree-item {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
}

.tree-item:hover {
  transform: translateY(-2px);
}

.tree-item h3 {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  color: #123435;
  /* Kale */
  margin: 0;
}

/* Card View */
.card-view {
  display: none;
  flex: 1;
  position: relative;
  padding: 10px 20px;
  z-index: 2;
  overflow: hidden;
  height: calc(100% - 70px);
  background: #F4F1ED;
  /* Onion - brand background */
}

.card-view.active {
  display: flex;
  flex-direction: column;
}

.tree-list.hidden {
  display: none;
}

/* Navigation Bar */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 2px 0;
  background: #F4F1ED;
  /* Onion - brand background */
  margin: 5px 0;
}

.nav-button {
  min-width: 36px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  padding: 0 8px;
  color: #123435;
  /* Kale */
}

.nav-button:hover {
  transform: scale(1.05);
  background: #e5e0d5;
}

/* Card Container */
.card {
  position: relative;
  margin-top: 10px;
  height: 100%;
  overflow: hidden;
}

/* Card Faces */
.card-front,
.card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 15px;
  transition: opacity 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
}

.card-front {
  opacity: 1;
  visibility: visible;
  z-index: 2;
  padding: 15px;
  background: #fff;
}

.card-back {
  background: #F4F1ED;
  /* Onion - brand background */
  padding: 20px;
  z-index: 1;
  word-wrap: break-word;
}

.card.flipped .card-front {
  opacity: 0;
  visibility: hidden;
}

.card.flipped .card-back {
  opacity: 1;
  visibility: visible;
}

/* Content Styling */
.card-front img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  padding-bottom: 40px;
  display: block;
}

.card-back h3 {
  color: #123435;
  /* Kale */
  margin: 0 0 10px 0;
  font-size: 22px;
  word-wrap: break-word;
  max-width: 100%;
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
}

.scientific-name {
  font-family: 'forevs', 'Montserrat', sans-serif;
  /* Forevs primary font */
  color: #123435;
  /* Kale */
  margin-bottom: 15px;
  word-wrap: break-word;
  max-width: 100%;
  font-style: italic;
}

#cardFeatures {
  margin-top: 20px;
  word-wrap: break-word;
  max-width: 100%;
  margin-bottom: 45px;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  color: #123435;
  /* Kale */
}

/* Scrollbar Styling */
.card-front::-webkit-scrollbar,
.card-back::-webkit-scrollbar {
  width: 6px;
}

.card-front::-webkit-scrollbar-track,
.card-back::-webkit-scrollbar-track {
  background: #F4F1ED;
  /* Onion - brand background */
}

.card-front::-webkit-scrollbar-thumb,
.card-back::-webkit-scrollbar-thumb {
  background-color: #123435;
  /* Kale */
  border-radius: 20px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .cards-content {
    width: 95%;
    height: 95vh;
    margin: 5px auto;
  }

  .cards-header {
    padding: 12px 15px;
  }

  .cards-header h2 {
    font-size: 20px;
  }

  .nav-button {
    width: 36px;
    height: 36px;
  }

  .card-view {
    padding: 10px;
  }

  .card-front,
  .card-back {
    padding: 15px;
  }
}

/* Very small devices */
@media (max-width: 380px) {
  .cards-content {
    width: 98%;
    height: 98vh;
    margin: 3px auto;
  }

  .cards-header {
    padding: 8px 10px;
  }

  .cards-header h2 {
    font-size: 18px;
  }

  .view-controls button {
    font-size: 18px;
    padding: 3px;
  }

  .nav-button {
    width: 32px;
    height: 32px;
  }

  .tree-item {
    padding: 12px;
    margin-bottom: 8px;
  }

  .card-front,
  .card-back {
    padding: 10px;
  }

  .card-back h3 {
    font-size: 18px;
  }

  .scientific-name {
    font-size: 14px;
  }

  #cardFeatures {
    margin-top: 15px;
    margin-bottom: 35px;
  }
}

/* Accessibility Improvements */
.nav-button:focus,
.view-controls button:focus {
  outline: 2px solid #2F5E44;
  /* Sage - brand button color */
  outline-offset: 2px;
}

/* Performance Optimization */
.card-front,
.card-back {
  will-change: transform, opacity;
}


/*Tree Benefits key frames*/

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes countUp {
  from {
    transform: scale(0.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}




/* Responsive adjustments */
@media (max-width: 768px) {
  .benefits-content {
    padding: 20px;
    width: 95%;
  }

  .benefits-header h2 {
    font-size: 24px;
  }

  .benefit-section {
    padding: 20px;
  }

  .benefit-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
  }

  .benefit-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .benefit-item {
    padding: 20px;
  }

  .benefit-item i {
    font-size: 28px;
  }

  .benefit-item p {
    font-size: 20px;
  }
}

.benefit-item .primary-value {
  margin: 10px 0;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  color: #2F5E44;
  /* Sage - brand button color */
  font-weight: bold;
  font-size: 24px;
  opacity: 0;
  animation: countUp 1s ease forwards;
  animation-delay: 0.3s;
}

.benefit-item .equivalency {
  margin: 15px 0 0 0;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
  color: #123435;
  /* Kale */
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 1s;
  line-height: 1.4;
}

/* End Benefits Overlay Styles */


.content-button {
  background: #2F5E44;
  /* Sage - brand button color */
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  margin: 5px 5px 0 0;
  display: inline-block;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.content-button:hover {
  background: #234a37;
  transform: translateY(-1px);
}

/* FONTS TREE DATA */

.tree-hwphytolacca .ai-message {
  background-color: #EBE0CB;
  color: #123435;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwphytolacca .message-speaker {
  color: rgba(18, 52, 53, 0.8) !important;
  background: rgba(18, 52, 53, 0.1) !important;
  border: 1px solid rgba(18, 52, 53, 0.2) !important;
}

.tree-hwceiba .ai-message {
  background-color: #DEFB6F;
  color: #123435;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwceiba .message-speaker {
  color: rgba(18, 52, 53, 0.8) !important;
  background: rgba(18, 52, 53, 0.1) !important;
  border: 1px solid rgba(18, 52, 53, 0.2) !important;
}

.tree-hwpersea .ai-message {
  background-color: #EBAC25;
  color: #123435;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwpersea .message-speaker {
  color: rgba(18, 52, 53, 0.8) !important;
  background: rgba(18, 52, 53, 0.1) !important;
  border: 1px solid rgba(18, 52, 53, 0.2) !important;
}

.tree-hwauracaria .ai-message {
  background-color: #F4F1ED;
  color: #123435;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwauracaria .message-speaker {
  color: rgba(18, 52, 53, 0.8) !important;
  background: rgba(18, 52, 53, 0.1) !important;
  border: 1px solid rgba(18, 52, 53, 0.2) !important;
}

.tree-hwpagoda .ai-message {
  background-color: rgba(2, 90, 160, 0.99);
  color: white;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwpagoda .message-speaker {
  color: rgba(255, 255, 255, 0.8) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.tree-hwficus .ai-message {
  background-color: #EBAC25;
  color: #123435;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwficus .message-speaker {
  color: rgba(18, 52, 53, 0.8) !important;
  background: rgba(18, 52, 53, 0.1) !important;
  border: 1px solid rgba(18, 52, 53, 0.2) !important;
}

.tree-hwensete .ai-message {
  background-color: #F15F2F;
  color: #F4F1ED;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwensete .message-speaker {
  color: rgba(244, 241, 237, 0.8) !important;
  background: rgba(244, 241, 237, 0.1) !important;
  border: 1px solid rgba(244, 241, 237, 0.2) !important;
}

.tree-hwfraxinus .ai-message {
  background-color: #2F5E44;
  color: #F4F1ED;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwfraxinus .message-speaker {
  color: rgba(244, 241, 237, 0.8) !important;
  background: rgba(244, 241, 237, 0.1) !important;
  border: 1px solid rgba(244, 241, 237, 0.2) !important;
}

.tree-hwbutia .ai-message {
  background-color: #4B6E40;
  color: #F4F1ED;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwbutia .message-speaker {
  color: rgba(244, 241, 237, 0.8) !important;
  background: rgba(244, 241, 237, 0.1) !important;
  border: 1px solid rgba(244, 241, 237, 0.2) !important;
}

.tree-hwginkgo .ai-message {
  background-color: #123435;
  color: #F4F1ED;
  font-family: 'Montserrat', sans-serif;
}

.tree-hwginkgo .message-speaker {
  color: rgba(244, 241, 237, 0.8) !important;
  background: rgba(244, 241, 237, 0.1) !important;
  border: 1px solid rgba(244, 241, 237, 0.2) !important;
}

/* Keep the golden playing state the same for all trees */
.message-speaker.playing {
  color: #FFD700 !important;
  background: rgba(255, 215, 0, 0.2) !important;
  border-color: #FFD700 !important;
  animation: pulse 1s infinite;
}

/* Stacked TTS Icons */
.autoplay-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.autoplay-toggle .fa-rotate {
  font-size: 10px !important;
  position: absolute !important;
  bottom: 4px !important;
  opacity: 0.7 !important;
}

/* Voice Selection Popup - SLIDE UP FROM BOTTOM */
.voice-popup {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: white !important;
  padding: 20px !important;
  padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
  /* iPhone safe area */
  z-index: 9999 !important;
  border-radius: 15px 15px 0 0 !important;
  /* Rounded top corners */
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
  transform: translateY(100%) !important;
  /* Start hidden below screen */
  transition: transform 0.3s ease !important;
  font-family: 'Montserrat', sans-serif !important;
  /* Gotham fallback */
  font-size: 16px !important;
  /* Slightly larger for mobile */
}

.voice-popup.show {
  transform: translateY(0) !important;
  /* Slide up to visible */
}

.voice-option {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 15px 8px !important;
  /* Larger touch targets */
  cursor: pointer !important;
  border-radius: 8px !important;
  transition: background-color 0.2s ease !important;
  font-size: 16px !important;
}

.voice-option:hover {
  background-color: #f5f5f5 !important;
}

.voice-option input[type="radio"] {
  margin: 0 !important;
  flex-shrink: 0 !important;
  width: 20px !important;
  /* Larger radio buttons */
  height: 20px !important;
  accent-color: #2F5E44 !important;
  /* Sage - brand button color */
  /* Makes radio button green */
}

.voice-option label {
  cursor: pointer !important;
  margin: 0 !important;
  color: #333 !important;
  flex: 1 !important;
  font-size: 16px !important;
}

/* TTS SECTION */

/* Autoplay Toggle Button */
.autoplay-toggle {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 8px;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  /* Ensure it doesn't collapse */
}

.autoplay-toggle.active {
  color: #2F5E44;
  /* Sage - brand button color */
}

.autoplay-toggle:hover {
  background-color: rgba(47, 94, 68, 0.1);
}

.autoplay-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Speaker icon in messages - UPDATED to subtle button style */
.message-speaker {
  display: inline-block;
  margin-left: 2px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  font-size: 16px;
  /* NEW: Button-like appearance */
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 6px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-speaker:hover {
  /* Enhanced hover state */
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.message-speaker.playing {
  color: #FFD700;
  background: rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
  animation: pulse 1s infinite;
}

/* Make AI messages clickable when TTS is enabled */
.ai-message.tts-enabled {
  cursor: pointer;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}

/* Shop button styling - always green with white icon */
.shop-button {
  background-color: #2F5E44 !important;
  /* Sage - brand button color */
  border: 1px solid #2F5E44 !important;
  padding: 4px 6px !important;
  margin-left: 4px !important;
}

.shop-button:hover {
  transform: translateY(-1px) !important;
}

.shop-button i {
  font-size: 11px !important;
  color: white !important;
}

/* Progressive Discovery - Global TTS Button Pulse */
.autoplay-toggle.pulse-discover {
  animation: discoverPulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(47, 94, 68, 0.4);
}

@keyframes discoverPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 94, 68, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(47, 94, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(47, 94, 68, 0);
  }
}

/* Input wrapper to contain input and mic button */
.input-wrapper {
  position: relative;
  flex: 1;
  margin-right: 8px;
}

/* Styles for chat links */
.chat-link {
  color: #FFD700;
  /* Gold color to match your other link styles */
  text-decoration: underline;
  transition: color 0.2s ease;
}

.chat-link:hover {
  color: #FFC107;
  /* Slightly darker gold on hover */
}

.ai-message .chat-link {
  color: #FFD700;
  /* Gold color for dark background in AI messages */
}

.user-message .chat-link {
  color: #0D47A1;
  /* Blue color to match user message text */
}


/* Ensure all text is at least 16px for accessibility */
body,
input,
textarea,
button,
#user-feedback,
.message,
.system-greeting,
#session-timer,
.error-message,
#privacy-page p,
#gps-privacy-page p,
#feedback-page input,
#feedback-page textarea {
  font-size: 16px;
}


/* THREE NEW BUTTONS */

.permission-btn {
  background-color: #2F5E44;
  /* Sage - brand button color */
  color: white;
  display: block;
  margin: 10px auto;
  padding: 15px 30px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 280px;
  position: relative;
  font-family: 'Montserrat', sans-serif;
  /* Gotham fallback */
}

.permission-btn:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.permission-btn.success {
  background-color: #2E7D32;
}

.permission-btn:hover:not(:disabled) {
  background-color: #234a37;
  transform: translateY(-2px);
}

.permission-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.permission-btn i {
  margin-right: 8px;
}

/* Loading spinner animation */
.permission-btn .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Enhanced error message styling for permission errors */
.error-message .location-instructions {
  font-size: 14px;
  background-color: #f8f9fa;
  padding: 10px;
  margin-top: 10px;
  border-radius: 4px;
  text-align: left;
  line-height: 1.5;
  border-left: 4px solid #2F5E44;
  /* Sage - brand button color */
}

/* Mobile responsiveness for permission buttons */
@media screen and (max-width: 600px) {
  .permission-btn {
    width: 90%;
    max-width: 300px;
    padding: 12px 20px;
    font-size: 16px;
  }
}

/* Very small devices */
@media screen and (max-width: 380px) {
  .permission-btn {
    width: 95%;
    padding: 10px 15px;
    font-size: 14px;
  }
}


/* End of CSS */

/* Copyright (c) 2025 Giacomo Barchiesi - ChatGPTree
All rights reserved.*/