/* =========================
   THEME COLORS
========================= */
@import url('theme.css');
:root {
  /* Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --border-color: #e2e8f0;

  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --shadow-heavy: rgba(0, 0, 0, 0.15);

  /* Agricultural Green Palette */
  --primary-green: #16a34a;
  --secondary-green: #22c55e;
  --accent-green: #4ade80;
  --light-green: #f0fdf4;
  --dark-green: #15803d;
  --green-hover: #15803d;

  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Mode */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-color: #334155;

  --shadow-light: rgba(0, 0, 0, 0.3);
  --shadow-medium: rgba(0, 0, 0, 0.4);
  --shadow-heavy: rgba(0, 0, 0, 0.6);

  /* Adjusted Greens for Dark Mode */
  --light-green: #1a2e1a;
  --green-hover: #22c55e;
}

/* =========================
   GLOBAL STYLES
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   HEADER
========================= */
/* ========================
   HEADER SECTION
======================== */
header {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  padding: 2.5rem 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

header .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.header-content h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.9;
}

/* ========================
   BUTTON GROUP (Toggle + Back)
======================== */
.header-content > div {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}


/* ========================
   BACK BUTTON
======================== */
.back-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color:#334155;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 8px 14px;
  color: black;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* =========================
   NAV TABS
========================= */
.nav-tabs {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  padding: 8px;
  box-shadow: 0 4px 20px var(--shadow-light);
}

.tab-button {
  flex: 1;
  max-width: 200px;
  padding: 16px 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-button.active {
  background: linear-gradient(
    135deg,
    var(--primary-green),
    var(--secondary-green)
  );
  color: white;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

.tab-button:hover:not(.active) {
  background: var(--light-green);
  color: var(--dark-green);
}

/* =========================
   MAIN CONTENT
========================= */
main {
  padding: 2rem 0;
}

.section {
  display: none;
  animation: fadeIn 0.5s ease-in-out;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* =========================
   FORM CARDS
========================= */
.form-card {
  background: var(--bg-primary);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.form-card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-4px);
}

.form-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--light-green);
  border-radius: 12px;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-tertiary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2);
  background: white;
}

.submit-button {
  width: 100%;
  padding: 18px;
  background: linear-gradient(
    135deg,
    var(--primary-green),
    var(--secondary-green)
  );
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(22, 163, 74, 0.3);
}

/* =========================
   LISTINGS
========================= */
.listings-container {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px var(--shadow-light);
  min-height: 400px;
}

.listings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--light-green);
}

.listings-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.listings-count {
  background: var(--accent-green);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.listing-item {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--light-green));
  border: 1px solid rgba(107, 144, 128, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.listing-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-green),
    var(--secondary-green)
  );
}

.listing-item:hover {
  transform: translateX(8px);
  box-shadow: var(--shadow-medium);
}

.listing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.listing-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.listing-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-green);
}

.listing-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.listing-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.delete-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

.delete-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* =========================
   FOOTER
========================= */
footer {
  background: linear-gradient(
    135deg,
    var(--dark-green),
    var(--secondary-green)
  );
  color: #ffffff;
  text-align: center;
  padding: 1.5rem;
  font-weight: 500;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .nav-tabs {
    flex-direction: column;
    gap: 8px;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .listings-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .listing-details {
    grid-template-columns: 1fr;
  }
}

/* =========================
   SUCCESS ANIMATION
========================= */
.success-message {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 1rem 2rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInSuccess 0.5s ease-out;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

@keyframes slideInSuccess {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Floating Chatbot Button */
#chatbotBtn {
  position: fixed;
  bottom: 100px; /* 20px above scroll-to-top button */
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #4caf50; /* greenish theme */
  color: #fff;
  font-size: 28px;
  text-align: center;
  line-height: 60px;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 1100; /* above scroll-to-top button */
}

#chatbotBtn:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
  background-color: #43a047; /* slightly darker green on hover */
}

/* Mobile responsiveness: hide on very small screens */
@media (max-width: 400px) {
  #chatbotBtn {
    display: none;
  }
}