:root {
      --bg-light: #e8f5e9;
      --bg-dark: #1b1b1b;
      --text-light: #1b4332;
      --text-dark: #e0f2f1;
      --card-light: #f1fdf6;
      --card-dark: #263238;
    }

    [data-theme="dark"] {
      background-color: var(--bg-dark);
      color: var(--text-dark);
    }

    body {
      font-family: 'Arial', sans-serif;
      margin: 0;
      padding: 1rem;
      background-color: var(--bg-light);
      color: var(--text-light);
      transition: background-color 0.3s, color 0.3s;
    }

    /* Add this for full-page dark mode */
    [data-theme="dark"] body {
      background-color: var(--bg-dark);
      color: var(--text-dark);
    }

    .app-container {
      max-width: 600px;
      margin: auto;
      padding: 1rem;
      background: white;
      border-radius: 1rem;
      box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }

    /* Already present, but keep for card dark mode */
    [data-theme="dark"] .app-container {
      background: var(--card-dark);
      color: var(--text-dark);
      box-shadow: 0 0 20px rgba(0,0,0,0.5);
    }

    h1 {
      text-align: center;
    }

    input, select, button {
      width: 100%;
      padding: 10px;
      margin: 0.5rem 0;
      border-radius: 10px;
    }

    #cropInput {
      max-width: 300px;
      display: block;
      margin-left: auto;
      margin-right: auto;
    }

    button {
      background: #2d6a4f;
      color: white;
      border: none;
      border-radius: 10px;
      transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
      box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }

    /* Button hover animation */
    button:hover, button:focus {
      background: #40916c;
      transform: translateY(-2px) scale(1.04);
      box-shadow: 0 6px 18px rgba(44, 62, 80, 0.18);
    }

    /* Button click animation */
    button:active {
      transform: scale(0.97);
      background: #1b4332;
    }

    /* Ripple effect on click */
    button::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      width: 0;
      height: 0;
      background: rgba(255,255,255,0.3);
      border-radius: 50%;
      transform: translate(-50%, -50%);
      transition: width 0.4s ease, height 0.4s ease, opacity 0.4s;
      opacity: 0;
      pointer-events: none;
    }

    button:active::after {
      width: 120px;
      height: 120px;
      opacity: 1;
      transition: 0s;
    }

    .dark-toggle {
      position: fixed;
      top: 10px;
      right: 10px;
      background: #2d6a4f;
      color: white;
      border: none;
      border-radius: 50%;
      width: 40px;
      height: 40px;
      font-size: 1.5rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
    }

    .result-card {
      background-color: var(--card-light);
      padding: 1rem;
      margin: 1rem 0;
      border-radius: 10px;
    }

    [data-theme="dark"] .result-card {
      background-color: var(--card-dark);
    }

    .crop-image {
      width: 60px;
      height: 60px;
      object-fit: cover;
      border-radius: 10px;
      margin-right: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.10);
      background: #f1fdf6;
      border: 2px solid #d8f3dc;
      vertical-align: middle;
      display: inline-block;
    }

    [data-theme="dark"] .crop-image {
      background: #263238;
      border: 2px solid #40916c;
    }

    .category-badge {
      display: inline-block;
      background: #d8f3dc;
      color: #1b4332;
      padding: 4px 8px;
      border-radius: 6px;
      font-size: 0.9rem;
    }

    .daily-tip {
      background: #d8f3dc;
      color: #1b4332;
      border-radius: 8px;
      padding: 0.75rem 1rem;
      margin: 1rem 0;
      font-size: 1.1rem;
      text-align: center;
      font-style: italic;
    }
    [data-theme="dark"] .daily-tip {
      background: #263238;
      color: #b7efc5;
    }

    /* Modal styles */
    .modal-overlay {
      position: fixed;
      z-index: 1000;
      inset: 0;
      background: rgba(0,0,0,0.65);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: opacity 0.3s;
    }

    .modal-content {
      background: #fff;
      color: #1b4332;
      border-radius: 16px;
      padding: 2rem 1.5rem;
      max-width: 95vw;
      width: 370px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.25);
      text-align: left;
      font-size: 1.05rem;
    }

    [data-theme="dark"] .modal-content {
      background: #263238;
      color: #e0f2f1;
    }

    #start-btn {
      margin-top: 1.5rem;
      width: 100%;
      background: #2d6a4f;
      color: #fff;
      border: none;
      border-radius: 10px;
      padding: 12px;
      font-size: 1.1rem;
      cursor: pointer;
    }

    .app-blur {
      filter: blur(6px) brightness(0.7);
      pointer-events: none;
      user-select: none;
      transition: filter 0.3s;
      /* Optionally add opacity for extra faintness */
      opacity: 0.3;
    }

    .app-footer {
      max-width: 600px;
      margin: 2rem auto 0 auto;
      padding: 1rem;
      background: #f1fdf6;
      color: #1b4332;
      border-radius: 0 0 1rem 1rem;
      text-align: center;
      font-size: 1rem;
      box-shadow: 0 0 10px rgba(0,0,0,0.05);
    }

    .app-footer a{
      color: #2d6a4f;
      text-decoration: none;
      transition: color 0.2s;
    }
    [data-theme="dark"] .app-footer {
      background: #263238;
      color: #e0f2f1;
    }
    .app-footer ul {
      list-style: none;
      padding: 0;
      margin: 0.5rem 0 0 0;
    }
    .app-footer li {
      display: inline-block;
      margin: 0 0.5rem;
    }

    .app-container,
    .dark-toggle,
    .app-footer {
      display: none;
    }

    /* --- Animated crop card styles --- */
    .result-card-list {
      display: flex;
      flex-wrap: wrap;
      gap: 18px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .crop-card {
      background: var(--card-light);
      border-radius: 12px;
      box-shadow: 0 2px 12px rgba(0,0,0,0.08);
      width: 140px;
      min-height: 170px;
      margin: 0;
      padding: 0;
      position: relative;
      cursor: pointer;
      perspective: 600px;
      transition: box-shadow 0.3s;
      opacity: 0;
      transform: translateY(30px) scale(0.95);
      animation: fadeInCard 0.6s forwards;
      animation-delay: var(--delay, 0s);
    }

    @keyframes fadeInCard {
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .crop-card-inner {
      position: relative;
      width: 100%;
      height: 100%;
      transition: transform 0.6s cubic-bezier(.4,2,.3,1);
      transform-style: preserve-3d;
    }

    .crop-card:hover .crop-card-inner {
      transform: rotateY(180deg);
    }

    .crop-card-front, .crop-card-back {
      position: absolute;
      width: 100%;
      height: 100%;
      backface-visibility: hidden;
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 12px;
      box-sizing: border-box;
    }

    .crop-card-front {
      z-index: 2;
      background: var(--card-light);
      color: var(--text-light);
    }

    .crop-card-back {
      background: #d8f3dc;
      color: #1b4332;
      transform: rotateY(180deg);
      font-size: 0.98em;
      text-align: center;
    }

    [data-theme="dark"] .crop-card-front {
      background: var(--card-dark);
      color: var(--text-dark);
    }
    [data-theme="dark"] .crop-card-back {
      background: #263238;
      color: #b7efc5;
    }

    .crop-tags {
      margin-top: 8px;
    }
    .crop-tag {
      display: inline-block;
      background: #ffe066;
      color: #1b4332;
      border-radius: 6px;
      padding: 3px 10px;
      font-size: 0.95em;
      margin: 2px 4px 2px 0;
      font-weight: 500;
    }
    [data-theme="dark"] .crop-tag {
      background: #ffd60a;
      color: #263238;
    }

    /* --- End crop card styles --- */


    .spinner-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.18);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2000;
    }

    .spinner {
      width: 54px;
      height: 54px;
      border: 6px solid #d8f3dc;
      border-top: 6px solid #2d6a4f;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .success-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.12);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2100;
      animation: fadeIn 0.4s;
    }
    .success-checkmark {
      font-size: 4rem;
      color: #2d6a4f;
      background: #d8f3dc;
      border-radius: 50%;
      padding: 24px;
      box-shadow: 0 2px 18px rgba(44,62,80,0.18);
      animation: popIn 0.5s;
    }
    @keyframes popIn {
      0% { transform: scale(0.5); opacity: 0; }
      80% { transform: scale(1.1); opacity: 1; }
      100% { transform: scale(1); }
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }

    }

   textarea#user-notes {
  width: 95%;
  min-height: 120px;
  padding: 14px 16px;
  margin: 1rem 0;
  border: 2px solid #b7efc5;
  border-radius: 12px;
  font-family: 'Arial', sans-serif;
  font-size: 1rem;
  background-color: #f1fdf6;
  color: #1b4332;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: border-color 0.3s, box-shadow 0.3s;
}

textarea#user-notes:focus {
  outline: none;
  border-color: #2d6a4f;
  box-shadow: 0 0 8px rgba(45, 106, 79, 0.2);
}
[data-theme="dark"] textarea#user-notes {
  background-color: #263238;
  color: #e0f2f1;
  border-color: #40916c;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.03);
}
#favorites {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #f8fbe9;
  border: 2px solid #c5e1a5;
  border-radius: 12px;
}

.fav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background-color: #ffffff;
  border: 1px solid #cfd8dc;
  border-radius: 8px;
  margin-bottom: 6px;
  gap: 10px;              /* Add spacing between name and button */
}

.fav-item span {
  flex: 1 1 auto;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.fav-btn {
  display: inline-block;  /* Inline so it sits next to the name, not on top */
  background: none;
  border: none;
  font-size: 1.5em;
  color: #ffd700;
  cursor: pointer;
  margin-left: 8px;
  outline: none;
  padding: 0 4px;
  border-radius: 10px;
  transition: background 0.18s, color 0.18s;
  box-shadow: none;
  vertical-align: middle;
}

[data-theme="dark"] .fav-btn {
  color: #ffe066;
  background: none;
}

[data-theme="dark"] .fav-btn:hover,
[data-theme="dark"] .fav-btn:focus {
  color: #ffd60a;
  background: #33331a;
  box-shadow: 0 0 0 2px #ffd60a;
}

[data-theme="dark"] .fav-btn:active {
  background: #ffd60a;
  color: #263238;
  box-shadow: 0 0 0 2px #ffe066;
}

[data-theme="dark"] #favorites {
  background-color: #263238;
  color: #e0f2f1;
  border-color: #40916c;
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.03);
}
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4fff4;
  margin: 0;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #2e2e2e;
}

h1 {
  margin-bottom: 1.5rem;
}

button {
  background-color: #4caf50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #43a047;
}

#result {
  margin-top: 2rem;
  font-size: 1.5rem;
  background: #ffffff;
  padding: 1rem 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  min-width: 200px;
  text-align: center;
}
[data-theme="dark"] #result {
  background-color: #263238;
  color: #e0f2f1;
  border-color: #40916c;
        box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.03);
    }

    /* Add to style.css */

.recent-searches-section {
  margin: 1.5rem 0 1rem 0;
  width: 100%;
  max-width: 600px;
}

.recent-toggle-btn {
  background: #e0e0e0;
  color: #1b4332;
  border: none;
  border-radius: 8px;
  font-size: 1.08em;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.recent-toggle-btn:hover, .recent-toggle-btn:focus {
  background: #ffd60a;
  color: #263238;
}

#recent-arrow {
  margin-left: auto;
  font-size: 1.1em;
  transition: transform 0.2s;
}

.recent-searches-list {
  display: none;
  background: #f8fbe9;
  border: 1px solid #c5e1a5;
  border-radius: 0 0 10px 10px;
  padding: 0.5em 1em 0.5em 1em;
  margin-top: 0;
  margin-bottom: 0.5em;
}

.recent-searches-list.open {
  display: block;
}

.recent-searches-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-searches-list li {
  padding: 6px 0;
  cursor: pointer;
  color: #2d6a4f;
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.15s;
}

.recent-searches-list li:last-child {
  border-bottom: none;
}

.recent-searches-list li:hover {
  background: #d8f3dc;
  color: #1b4332;
  border-radius: 6px;
}

[data-theme="dark"] .recent-searches-list {
  background: #263238;
  border-color: #40916c;
  color: #e0f2f1;
}
[data-theme="dark"] .recent-toggle-btn {
  background: #263238;
  color: #ffd60a;
}

/* Favorite Main Button Styling */
.favorite-main-action {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 1.2rem 0 1.2rem 0;
}

#favorite-main-btn {
  background: #ffe066;
  color: #1b4332;
  border: 1.5px solid #ffd700;
  border-radius: 10px;
  font-size: 1.13em;
  font-weight: 600;
  padding: 10px 26px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 8px rgba(255, 224, 102, 0.08);
  outline: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

#favorite-main-btn:hover, #favorite-main-btn:focus {
  background: #ffd60a;
  color: #263238;
  box-shadow: 0 4px 16px rgba(255, 214, 10, 0.15);
}

#favorite-main-star {
  font-size: 1.4em;
  vertical-align: middle;
  transition: color 0.2s;
}

#favorite-main-label {
  font-size: 1em;
  font-weight: 500;
}

[data-theme="dark"] #favorite-main-btn {
  background: #ffd60a;
  color: #263238;
  border-color: #ffe066;
}

[data-theme="dark"] #favorite-main-btn:hover, 
[data-theme="dark"] #favorite-main-btn:focus {
  background: #ffe066;
  color: #1b4332;
}

.favorites-section {
  margin-top: 20px;
  border-top: 1px solid #ccc;
  padding-top: 12px;
}

.favorites-toggle-btn {
  background: none;
  border: none;
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
  padding: 6px 0;
  color: #263238;
  display: flex;
  align-items: center;
  justify-content: center; /* ✅ center horizontally */
  width: 100%;             /* ✅ fill container width */
  text-align: center;
}

#fav-arrow {
  margin-left: 8px;
  font-size: 0.9em;
  transition: transform 0.2s;
}

.favorites-list {
  display: none;
  margin-top: 10px;
}
.favorites-list.open {
  display: block;
}

.fav-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #ddd;
  font-size: 1em;
  color: #263238;
}

.fav-btn {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.2em;
  color: #ffb703;
  cursor: pointer;
  transition: color 0.2s;
}
.fav-btn:hover {
  color: #ffa200;
}

[data-theme="dark"] .favorites-section {
  border-top: 1px solid #444;
}

[data-theme="dark"] .favorites-toggle-btn {
  color: #060606;
}

[data-theme="dark"] .fav-item {
  color: #0e0c0c;
  border-bottom: 1px dashed #555;
}

[data-theme="dark"] .fav-btn {
  color: #ffd60a;
}
[data-theme="dark"] .fav-btn:hover {
  color: #ffe066;
}

.favorites-list.open + #fav-arrow {
  transform: rotate(180deg);
}

@media screen and (max-width: 768px) {
  label[for="user-notes"] {
    display: block;
    width: 100%;
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  textarea#user-notes {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
  }

  #cropInput {
    width: 100% !important; /* override the 300px max-width */
    box-sizing: border-box;
    margin-left: 0;
    margin-right: 0;
    font-size: 1rem;
  }
}
