/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, sans-serif;
}

/* General Styles (Light Mode Default - Green Tint) */
body {
  background-color: #e8f5e9; /* Very light green background */
  color: #1b5e20; /* Dark green text */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation */
nav {
  background: #c8e6c9; /* Light green nav background */
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav .logo {
  font-size: 1.6rem;
  font-weight: bold;
  color: #2e7d32; /* Medium green for logo */
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav ul li a {
  text-decoration: none;
  color: #388e3c; /* Darker green nav link color */
  font-weight: 500;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: #1b5e20; /* Even darker green on hover */
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  color: #388e3c; /* Green toggle icon color */
}

.theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Landing Section */
.landing {
  text-align: center;
  padding: 4rem 2rem;
  background-color: #dcedc8; /* Another light green for landing */
  color: #1b5e20;
}

.landing h2 {
  font-size: 3rem;
  font-weight: bold;
  color: #2e7d32; /* Medium green headline */
  margin-bottom: 1rem;
}

.landing p {
  font-size: 1.2rem;
  color: #1b5e20;
  max-width: 700px;
  margin: 0 auto;
}

/* Chat Section */
.chat {
  max-width: 800px;
  margin: 30px auto;
  background-color: #ffffff; /* White chat background */
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 70vh; /* Adjust as needed */
}

#chat-window {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 10px;
  background: #f1f8e9; /* Very light green for chat window background */
  border-bottom: 1px solid #e0e0e0;
}

#messages {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Chat Bubbles */
.message {
  max-width: 75%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  line-height: 1.4;
  word-wrap: break-word;
}

.user {
  align-self: flex-end;
  background: #4caf50; /* Green for user messages */
  color: white;
  border-radius: 12px 12px 0 12px;
}

.bot {
  align-self: flex-start;
  background: #e8f5e9; /* Very light green for bot messages */
  color: #1b5e20;
  border-radius: 12px 12px 12px 0;
}

#typing-indicator {
  font-style: italic;
  color: #66bb6a; /* Greenish grey for typing indicator */
}

#typing-indicator.hidden {
  display: none;
}

.input-area {
  display: flex;
  margin-top: 1rem;
  padding: 15px 20px;
  border-top: 1px solid #e0e0e0;
  background-color: #f1f8e9; /* Very light green for input area */
}

.input-area input {
  flex: 1;
  padding: 0.8rem;
  border-radius: 20px 0 0 20px;
  border: 1px solid #a5d6a7; /* Light green border */
  outline: none;
  font-size: 1rem;
  background: #ffffff; /* White input background */
  color: #1b5e20;
}

.input-area button {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 0 20px 20px 0;
  background: #4caf50; /* Green send button */
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

.input-area button:hover {
  background: #388e3c;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 10px 20px;
  border-top: 1px solid #e0e0e0;
  background-color: #f1f8e9; /* Very light green for quick actions */
}

.quick-actions button {
  background: #a5d6a7; /* Light green quick action buttons */
  color: #1b5e20;
  border: 1px solid #81c784;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.quick-actions button:hover {
  background: #81c784;
}

button.clear {
  background: #ffc107; /* Yellow clear button (exception) */
  color: #333;
  border: none;
}

button.clear:hover {
  background: #e0a800;
}

/* Location Input UI */
#location-input {
  padding: 20px;
  background-color: #e0f2f1; /* Light teal green for location input */
  border-radius: 8px;
  margin-top: 20px;
  text-align: left;
}

#location-input label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

#location-input input[type="text"] {
  width: calc(100% - 22px);
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #80cbc4; /* Teal green border */
  border-radius: 5px;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #1b5e20;
}

#location-input button {
  background-color: #26a69a; /* Teal green for location submit */
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
}

#location-input button:hover {
  background-color: #00897b;
}

/* Onboarding Modal Styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #ffffff; /* White modal background */
  margin: auto;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 80%;
  max-width: 500px;
  text-align: center;
  color: #1b5e20;
}

.modal-content h2 {
  color: #2e7d32; /* Medium green for modal title */
  margin-bottom: 20px;
}

.modal-content label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
  text-align: left;
}

.modal-content input[type="text"],
.modal-content select {
  width: calc(100% - 20px);
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #a5d6a7; /* Light green border */
  border-radius: 5px;
  box-sizing: border-box;
  background-color: #ffffff;
  color: #1b5e20;
}

.modal-content button {
  background-color: #4caf50; /* Green modal button */
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
}

.modal-content button:hover {
  background-color: #388e3c;
}

/* Dark Mode Overrides (Green Tint) */
body.dark-mode {
  background-color: #212121; /* Dark grey background */
  color: #c8e6c9; /* Light green text */
}

body.dark-mode nav {
  background-color: #303030; /* Darker grey nav */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

body.dark-mode nav .logo {
  color: #81c784; /* Brighter green for dark mode logo */
}

body.dark-mode nav ul li a {
  color: #c8e6c9;
}

body.dark-mode nav ul li a:hover {
  color: #a5d6a7;
}

body.dark-mode .theme-toggle {
  color: #c8e6c9;
}

body.dark-mode .theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .landing {
  background-color: #303030;
  color: #c8e6c9;
}

body.dark-mode .landing h2 {
  color: #81c784;
}

body.dark-mode .landing p {
  color: #c8e6c9;
}

body.dark-mode .chat {
  background-color: #303030;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

body.dark-mode #chat-window {
  background-color: #424242; /* Darker chat window background */
  border: 1px solid #555;
}

body.dark-mode .message.user {
  background-color: #388e3c; /* Darker green for user messages */
  color: #fff;
}

body.dark-mode .message.bot {
  background-color: #424242; /* Darker grey for bot messages */
  color: #c8e6c9;
}

body.dark-mode .input-area {
  background-color: #303030;
  border-top: 1px solid #555;
}

body.dark-mode .input-area input[type="text"] {
  background-color: #424242;
  color: #c8e6c9;
  border: 1px solid #616161;
}

body.dark-mode .input-area input[type="text"]::placeholder {
  color: #9e9e9e;
}

body.dark-mode .input-area button {
  background-color: #4caf50; /* Green send button */
  color: #fff;
}

body.dark-mode .input-area button:hover {
  background-color: #388e3c;
}

body.dark-mode .quick-actions {
  background-color: #303030;
  border-top: 1px solid #555;
}

body.dark-mode .quick-actions button {
  background-color: #424242;
  color: #c8e6c9;
  border: 1px solid #616161;
}

body.dark-mode .quick-actions button:hover {
  background-color: #616161;
}

body.dark-mode #clear-btn {
  background-color: #dc3545; /* Red clear button (exception) */
  color: #fff;
}

body.dark-mode #clear-btn:hover {
  background-color: #c82333;
}

body.dark-mode #location-input {
  background-color: #424242;
  color: #c8e6c9;
}

body.dark-mode #location-input input[type="text"] {
  background-color: #555;
  color: #c8e6c9;
  border: 1px solid #616161;
}

body.dark-mode .modal-content {
  background-color: #303030;
  color: #c8e6c9;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.7);
}

body.dark-mode .modal-content h2 {
  color: #81c784;
}

body.dark-mode .modal-content input[type="text"],
body.dark-mode .modal-content select {
  background-color: #424242;
  color: #c8e6c9;
  border: 1px solid #616161;
}

body.dark-mode .modal-content input[type="text"]::placeholder {
  color: #9e9e9e;
}

/* Plant Care Calendar Section */
#plant-care-calendar {
  max-width: 1000px;
  margin: 30px auto;
  padding: 2rem;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  color: #1b5e20;
}

#plant-care-calendar h2 {
  font-size: 2.5rem;
  color: #2e7d32;
  margin-bottom: 1.5rem;
  text-align: center;
}

.feature-section {
  background-color: #f1f8e9;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.feature-section:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.feature-section h3 {
  font-size: 1.8rem;
  color: #388e3c;
  margin-bottom: 1rem;
  border-bottom: 2px solid #c8e6c9;
  padding-bottom: 0.5rem;
}

.feature-section p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Growth Timeline */
#crop-timeline-select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #a5d6a7;
  border-radius: 5px;
  margin-bottom: 1rem;
  background-color: #ffffff;
  color: #1b5e20;
  font-size: 1rem;
}

#timeline-display {
  background-color: #e8f5e9;
  border-radius: 5px;
  padding: 1rem;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #388e3c;
  font-style: italic;
}

/* Plant Health Monitor */
#leaf-photo-upload {
  display: block;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border: 1px solid #a5d6a7;
  border-radius: 5px;
  background-color: #ffffff;
  color: #1b5e20;
}

#analyze-leaf-btn {
  background-color: #4caf50;
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

#analyze-leaf-btn:hover {
  background-color: #388e3c;
}

#health-analysis-results {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #e8f5e9;
  border-radius: 5px;
  min-height: 50px;
  color: #1b5e20;
}

/* Success Tracker */
.tracker-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tracker-controls input,
.tracker-controls select {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid #a5d6a7;
  border-radius: 5px;
  background-color: #ffffff;
  color: #1b5e20;
  font-size: 1rem;
  min-width: 120px;
}

#log-activity-btn {
  background-color: #66bb6a;
  color: white;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

#log-activity-btn:hover {
  background-color: #43a047;
}

#activity-log {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #c8e6c9;
  border-radius: 5px;
  background-color: #ffffff;
}

#activity-log li {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #e8f5e9;
  color: #1b5e20;
}

#activity-log li:last-child {
  border-bottom: none;
}

#milestone-celebrations {
  padding: 1rem;
  background-color: #dcedc8;
  border-radius: 5px;
  text-align: center;
  font-weight: bold;
  color: #2e7d32;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.milestone {
  margin: 0.5rem 0;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Season Wheel */
#season-wheel-display {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 350px; /* Increased height for better visibility */
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
}

.season-wheel-container {
  width: 350px; /* Increased size */
  height: 350px; /* Increased size */
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 5px solid #a5d6a7;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); /* Stronger shadow */
  background-color: #e8f5e9; /* Light background for the wheel itself */
}

.month-segment {
  position: absolute;
  width: 175px; /* Half of container width */
  height: 175px; /* Half of container height */
  top: 0;
  left: 50%;
  transform-origin: 0% 100%; /* Rotate around the center bottom of the segment */
  overflow: hidden;
  background-color: rgba(197, 225, 197, 0.8); /* Light green with transparency */
  border: 1px solid #c8e6c9;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px; /* Add padding for content */
  box-sizing: border-box; /* Include padding in width/height */
}

.month-segment:hover {
  background-color: rgba(165, 214, 167, 0.95); /* Slightly darker and less transparent on hover */
  transform: scale(1.03); /* Subtle scale on hover */
  z-index: 1;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.month-name {
  position: absolute;
  top: 15px; /* Adjust position */
  left: 50%;
  transform: translateX(-50%) rotate(var(--angle-text)); /* Counter-rotate text to be horizontal */
  font-weight: bold;
  color: #1b5e20;
  font-size: 1rem; /* Slightly larger font */
  white-space: nowrap;
  text-align: center;
  width: 100%; /* Ensure text takes full width of segment */
}

.month-advice-text {
  position: absolute;
  bottom: 15px; /* Adjust position */
  left: 50%;
  transform: translateX(-50%) rotate(var(--angle-text)); /* Counter-rotate text to be horizontal */
  font-size: 0.8rem; /* Slightly larger font */
  color: #388e3c;
  text-align: center;
  width: 90%; /* Adjust width */
  opacity: 0;
  transition: opacity 0.3s ease;
  line-height: 1.3;
}

.month-segment:hover .month-advice-text {
  opacity: 1;
}

/* Dynamic rotation for month segments and text */
/* Each segment is 30 degrees (360 / 12 months) */
.season-wheel-container .month-segment:nth-child(1) { transform: rotate(0deg); } /* January */
.season-wheel-container .month-segment:nth-child(1) .month-name, .season-wheel-container .month-segment:nth-child(1) .month-advice-text { --angle-text: 0deg; }

.season-wheel-container .month-segment:nth-child(2) { transform: rotate(30deg); } /* February */
.season-wheel-container .month-segment:nth-child(2) .month-name, .season-wheel-container .month-segment:nth-child(2) .month-advice-text { --angle-text: -30deg; }

.season-wheel-container .month-segment:nth-child(3) { transform: rotate(60deg); } /* March */
.season-wheel-container .month-segment:nth-child(3) .month-name, .season-wheel-container .month-segment:nth-child(3) .month-advice-text { --angle-text: -60deg; }

.season-wheel-container .month-segment:nth-child(4) { transform: rotate(90deg); } /* April */
.season-wheel-container .month-segment:nth-child(4) .month-name, .season-wheel-container .month-segment:nth-child(4) .month-advice-text { --angle-text: -90deg; }

.season-wheel-container .month-segment:nth-child(5) { transform: rotate(120deg); } /* May */
.season-wheel-container .month-segment:nth-child(5) .month-name, .season-wheel-container .month-segment:nth-child(5) .month-advice-text { --angle-text: -120deg; }

.season-wheel-container .month-segment:nth-child(6) { transform: rotate(150deg); } /* June */
.season-wheel-container .month-segment:nth-child(6) .month-name, .season-wheel-container .month-segment:nth-child(6) .month-advice-text { --angle-text: -150deg; }

.season-wheel-container .month-segment:nth-child(7) { transform: rotate(180deg); } /* July */
.season-wheel-container .month-segment:nth-child(7) .month-name, .season-wheel-container .month-segment:nth-child(7) .month-advice-text { --angle-text: -180deg; }

.season-wheel-container .month-segment:nth-child(8) { transform: rotate(210deg); } /* August */
.season-wheel-container .month-segment:nth-child(8) .month-name, .season-wheel-container .month-segment:nth-child(8) .month-advice-text { --angle-text: -210deg; }

.season-wheel-container .month-segment:nth-child(9) { transform: rotate(240deg); } /* September */
.season-wheel-container .month-segment:nth-child(9) .month-name, .season-wheel-container .month-segment:nth-child(9) .month-advice-text { --angle-text: -240deg; }

.season-wheel-container .month-segment:nth-child(10) { transform: rotate(270deg); } /* October */
.season-wheel-container .month-segment:nth-child(10) .month-name, .season-wheel-container .month-segment:nth-child(10) .month-advice-text { --angle-text: -270deg; }

.season-wheel-container .month-segment:nth-child(11) { transform: rotate(300deg); } /* November */
.season-wheel-container .month-segment:nth-child(11) .month-name, .season-wheel-container .month-segment:nth-child(11) .month-advice-text { --angle-text: -300deg; }

.season-wheel-container .month-segment:nth-child(12) { transform: rotate(330deg); } /* December */
.season-wheel-container .month-segment:nth-child(12) .month-name, .season-wheel-container .month-segment:nth-child(12) .month-advice-text { --angle-text: -330deg; }


/* Dark Mode Overrides for new sections */
body.dark-mode #plant-care-calendar {
  background-color: #303030;
  color: #c8e6c9;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
}

body.dark-mode #plant-care-calendar h2 {
  color: #81c784;
}

body.dark-mode .feature-section {
  background-color: #424242;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

body.dark-mode .feature-section:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .feature-section h3 {
  color: #a5d6a7;
  border-bottom-color: #616161;
}

body.dark-mode #crop-timeline-select,
body.dark-mode #leaf-photo-upload,
body.dark-mode .tracker-controls input,
body.dark-mode .tracker-controls select {
  background-color: #555;
  color: #c8e6c9;
  border-color: #616161;
}

body.dark-mode #timeline-display,
body.dark-mode #health-analysis-results {
  background-color: #555;
  color: #a5d6a7;
}

body.dark-mode #analyze-leaf-btn,
body.dark-mode #log-activity-btn {
  background-color: #388e3c;
}

body.dark-mode #analyze-leaf-btn:hover,
body.dark-mode #log-activity-btn:hover {
  background-color: #2e7d32;
}

body.dark-mode #activity-log {
  background-color: #555;
  border-color: #616161;
}

body.dark-mode #activity-log li {
  color: #c8e6c9;
  border-bottom-color: #616161;
}

body.dark-mode #milestone-celebrations {
  background-color: #616161;
  color: #a5d6a7;
}

body.dark-mode .season-wheel-container {
  background-color: #424242;
  border-color: #616161;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .month-segment {
  background-color: rgba(85, 85, 85, 0.8);
  border-color: #616161;
}

body.dark-mode .month-segment:hover {
  background-color: rgba(97, 97, 97, 0.95);
}

body.dark-mode .month-name {
  color: #c8e6c9;
}

body.dark-mode .month-advice-text {
  color: #a5d6a7;
}
