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

/* HEADER */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 50px;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
}

header h2 {
  color: #2e7d32;
}

nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

nav a:hover {
  color: green;
}

/* HERO */
.hero {
  height: 90vh;
  background: linear-gradient(to right, #43cea2, #185a9d);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 20px;
}

.hero-text h1 {
  font-size: 40px;
  margin-bottom: 15px;
}

.hero-text p {
  max-width: 600px;
  margin: auto;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 25px;
  background: white;
  color: #185a9d;
  border-radius: 25px;
  text-decoration: none;
  font-weight: bold;
}

/* ABOUT */
.about {
  padding: 60px 20px;
  text-align: center;
  background: #f5f5f5;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.card {
  background: white;
  padding: 20px;
  width: 250px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* SEARCH */
.search-section {
  padding: 60px 20px;
  text-align: center;
}

.search-section h2 {
  margin-bottom: 10px;
}

/* Plant search */
.plant-search-wrapper {
  position: relative;
  display: inline-block;
  width: 320px;
  max-width: 100%;
  margin-top: 15px;
}

#plantSearchInput {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #c6d7c9;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

#plantSearchInput:focus {
  border-color: #43cea2;
}

.plant-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #c6d7c9;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  list-style: none;
  padding: 4px 0;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  text-align: left;
}

.plant-result-btn {
  width: 100%;
  padding: 9px 14px;
  background: none;
  border: none;
  border-radius: 0;
  color: #1a3c1d;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  margin-top: 0;
  display: flex;
  gap: 4px;
  align-items: baseline;
}

.plant-result-btn:hover {
  background: #f0faf1;
}

.plant-result-btn small {
  color: #7a9e7e;
  font-size: 12px;
}

.plant-search-status {
  margin-top: 6px;
  font-size: 13px;
  color: #5a7a5e;
  min-height: 18px;
}

.plant-selected-display {
  margin-top: 10px;
  font-size: 14px;
  color: #2e7d32;
  background: #e8f5e9;
  border-radius: 6px;
  padding: 8px 14px;
  display: inline-block;
}

.plant-care-preview {
  margin: 16px auto 0;
  max-width: 480px;
  background: #f3fbf4;
  border: 1px solid #c8e0cc;
  border-radius: 10px;
  padding: 14px 18px;
  text-align: left;
}

.plant-care-preview h3 {
  color: #1f5d24;
  margin-bottom: 10px;
  font-size: 16px;
}

.care-details {
  list-style: none;
  padding: 0;
  margin: 0;
}

.care-details li {
  padding: 4px 0;
  font-size: 14px;
  color: #3a5c3e;
  border-bottom: 1px solid #e4ede5;
}

.care-details li:last-child {
  border-bottom: none;
}

button {
  padding: 12px 20px;
  margin-top: 15px;
  background: green;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background: darkgreen;
}

/* LOGIN */
.login-hero {
  min-height: calc(100vh - 70px);
  background: linear-gradient(to right, #43cea2, #185a9d);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card h2 {
  color: #2e7d32;
  margin-bottom: 20px;
  font-size: 26px;
}

.login-card #selectedPlant {
  color: #4b6250;
  margin-bottom: 16px;
  font-size: 14px;
}

.login-card input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #c6d7c9;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.login-card input:focus {
  border-color: #43cea2;
}

.login-card button {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  background: linear-gradient(to right, #43cea2, #185a9d);
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.login-card button:hover {
  opacity: 0.9;
  background: linear-gradient(to right, #43cea2, #185a9d);
}

.login-card #message {
  margin-top: 14px;
  font-size: 14px;
  color: #c0392b;
}

.favorites-banner {
  background: linear-gradient(to right, #43cea2, #185a9d);
  color: white;
  text-align: center;
  padding: 40px 20px 36px;
}

.favorites-banner h1 {
  font-size: 32px;
  margin-bottom: 8px;
}

.favorites-banner p {
  font-size: 16px;
  opacity: 0.9;
}

.favorites-page {
  min-height: calc(100vh - 160px);
  padding: 36px 20px 60px;
  display: flex;
  justify-content: center;
  background: #f0f6f1;
}

.favorites-card {
  width: 100%;
  max-width: 960px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 32px 36px;
}

.favorites-section-title {
  color: #2e7d32;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e4f0e5;
}

.favorites-search {
  margin: 0 0 24px;
  background: #f8fdf9;
  border: 1px solid #d6ead8;
  border-radius: 10px;
  padding: 16px 18px;
}

.favorites-search label {
  display: block;
  margin-bottom: 8px;
  color: #1f5d24;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#favoritesPlantSearch {
  width: 100%;
  border: 1px solid #c6d7c9;
  border-radius: 8px;
  padding: 11px 14px;
  margin: 0;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

#favoritesPlantSearch:focus {
  border-color: #43cea2;
  box-shadow: 0 0 0 3px rgba(67, 206, 162, 0.15);
}

.favorites-search-message {
  margin-top: 8px;
  color: #4b6250;
  font-size: 13px;
}

.favorites-search-results {
  list-style: none;
  margin-top: 10px;
  border: 1px solid #d6e4d8;
  border-radius: 8px;
  background: white;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.favorites-search-results li {
  border-bottom: 1px solid #edf3ee;
}

.favorites-search-results li:last-child {
  border-bottom: none;
}

.search-result-btn {
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 11px 14px;
  border-radius: 0;
  background: transparent;
  color: #27452b;
  font-size: 14px;
  transition: background 0.15s;
  display: flex;
  gap: 4px;
  align-items: baseline;
}

.search-result-btn small {
  color: #7a9e7e;
  font-size: 12px;
}

.search-result-btn:hover {
  background: #ecf7ed;
}

.selected-plant-prompt {
  border: 1px solid #b7debb;
  background: linear-gradient(135deg, #f3fbf4, #eaf6eb);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.selected-plant-prompt h2 {
  color: #1f5d24;
  margin-bottom: 6px;
  font-size: 20px;
}

.selected-plant-prompt > p {
  color: #4b6250;
  font-size: 14px;
}

.selected-plant-action-message {
  margin-top: 8px;
  color: #265f2a;
  font-size: 13px;
  min-height: 20px;
}

.selected-plant-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.selected-plant-actions button {
  margin-top: 0;
}

.secondary-btn {
  background: #e8eeea;
  color: #2c3e2f;
}

.secondary-btn:hover {
  background: #d4ddd6;
}

#favoritesMessage {
  color: #5a7a5e;
  margin-bottom: 20px;
  font-size: 14px;
}

.favorites-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.favorite-item {
  border: 1px solid #e2ece3;
  border-radius: 12px;
  padding: 0;
  background: white;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.favorite-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.favorite-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.favorite-item-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.favorite-item h3 {
  color: #1f5d24;
  margin-bottom: 6px;
  font-size: 16px;
}

.favorite-item p {
  color: #666;
  margin-bottom: 6px;
  font-size: 13px;
}

.favorite-detail {
  color: #3f5b42;
  font-size: 13px;
}

.favorite-detail--unavailable {
  color: #aaa;
  font-style: italic;
  font-size: 13px;
}

.delete-favorite-btn {
  margin-top: auto;
  padding: 8px 14px;
  background: transparent;
  color: #b23a2f;
  border: 1px solid #b23a2f;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition:
    background 0.2s,
    color 0.2s,
    box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.delete-favorite-btn:hover {
  background: #b23a2f;
  color: white;
  box-shadow: 0 2px 8px rgba(178, 58, 47, 0.3);
}

.delete-favorite-btn:active {
  background: #8f2d24;
  border-color: #8f2d24;
  box-shadow: none;
}

.delete-favorite-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: transparent;
  color: #b23a2f;
  box-shadow: none;
}

.favorites-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e8f0e9;
  display: flex;
  justify-content: flex-end;
}

.favorites-actions button {
  background: linear-gradient(to right, #43cea2, #185a9d);
  border-radius: 25px;
  padding: 10px 28px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.favorites-actions button:hover {
  opacity: 0.9;
  background: linear-gradient(to right, #43cea2, #185a9d);
}

/* PROFILE */
.profile-hero {
  min-height: calc(100vh - 70px);
  background: linear-gradient(to right, #43cea2, #185a9d);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.profile-page {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  padding: 32px 36px;
}

.profile-card h2 {
  color: #2e7d32;
  margin-bottom: 6px;
  font-size: 22px;
}

.profile-card p.profile-subtitle {
  color: #5a7a5e;
  font-size: 14px;
  margin-bottom: 20px;
}

.profile-card input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #c6d7c9;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.profile-card input:focus {
  border-color: #43cea2;
}

.profile-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  background: linear-gradient(to right, #43cea2, #185a9d);
  border-radius: 25px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.profile-card button[type="submit"]:hover {
  opacity: 0.9;
  background: linear-gradient(to right, #43cea2, #185a9d);
}

.profile-message {
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

.profile-message--success {
  color: #1f7a2b;
}

.profile-message--error {
  color: #c0392b;
}

.profile-back-link {
  display: inline-block;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  text-decoration: none;
}

.profile-back-link:hover {
  color: white;
  text-decoration: underline;
}
