/* 
  AgriVision Premium UI 
  Dark mode aesthetic, glassmorphism, responsive 
*/

:root {
  /* Colors */
  --bg-primary: #f1f5f9;
  --bg-secondary: rgba(255, 255, 255, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.75);
  
  --primary: #10b981;
  --primary-hover: #059669;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --border-color: rgba(0, 0, 0, 0.08);
  
  /* Status Colors */
  --green: #22c55e;
  --blue: #3b82f6;
  --yellow: #eab308;
  --red: #ef4444;
  --purple: #8b5cf6;

  /* Typography */
  --font-family: 'Inter', sans-serif;
  
  /* Effects */
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  /* Transitions */
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===================== VIEWS ===================== */
.view {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.view.active {
  display: flex;
  opacity: 1;
}

/* ===================== AUTH VIEW ===================== */
#auth-view {
  min-height: 100vh;
  width: 100vw;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: var(--bg-primary);
  background-image: url('./landscape.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

@media (max-width: 768px) {
  #auth-view {
    background-image: url('./potrait.png');
  }
}

.auth-bg-shapes .shape {
  display: none;
}

.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-container.animate-up {
  opacity: 1;
  transform: translateY(0);
}

.auth-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-icon {
  margin-bottom: 10px;
}

@keyframes growLogo {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUpSplash {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 5px;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: 14px;
}

.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 25px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.auth-form.active {
  display: flex;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.input-wrapper input {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 12px 14px 12px 40px !important;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 15px;
  font-family: var(--font-family);
  transition: var(--transition);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.input-wrapper input::placeholder {
  color: rgba(100, 116, 139, 0.7);
}

.btn-auth {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
}

.btn-auth:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.field-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.forgot-link {
  color: var(--primary);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* ===================== DASHBOARD LAYOUT ===================== */
#dashboard-view {
  width: 100%;
  height: 100vh;
  display: none; /* controlled by JS */
}

#dashboard-view.active {
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar-brand {
  height: 70px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  font-size: 28px;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.nav-menu {
  list-style: none;
  padding: 20px 12px;
  flex: 1;
}

.nav-item {
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover, .nav-item.active .nav-link {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
}

.nav-icon {
  font-size: 20px;
}

.sidebar-bottom {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.logout-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 70px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.topbar-title {
  font-size: 20px;
  font-weight: 600;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 24px;
  cursor: pointer;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--text-main);
  transform: rotate(90deg);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--primary);
}

.close-sidebar-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.hidden-desktop {
  display: none !important;
}

/* Profile Sidebar (Replaces Dropdown) */
.profile-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.profile-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.profile-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 350px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95); /* White glassmorphism */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.profile-sidebar.open {
  right: 0;
}

@media (max-width: 400px) {
  .profile-sidebar {
    width: 100vw; /* Auto adjust for very small screens */
    right: -100vw;
  }
}

.profile-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
}

.profile-sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a; /* Force dark text for white glassmorphism */
}

.close-profile-btn {
  background: rgba(0,0,0,0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.close-profile-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
}

.profile-sidebar-content {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
  padding-bottom: 15px;
}

.dropdown-name { font-weight: 700; color: #0f172a; font-size: 20px; }
.dropdown-role { font-size: 14px; color: var(--primary); margin-bottom: 4px; font-weight: 600; }
.dropdown-email { font-size: 13px; color: #64748b; word-break: break-all; }

.dropdown-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
  margin: 15px 0;
}

.dropdown-farms-title {
  font-size: 13px;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 15px;
  letter-spacing: 0.5px;
}

.dropdown-farms-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dropdown-farm-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0,0,0,0.05);
  transition: var(--transition);
}

.dropdown-farm-item:hover {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
}

.farm-item-icon {
  font-size: 22px;
  background: white;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.farm-item-details {
  display: flex;
  flex-direction: column;
}

.farm-item-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}

.farm-item-meta {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.no-farms {
  font-size: 14px;
  color: #64748b;
  font-style: italic;
  padding: 15px 0;
  text-align: center;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
  padding-bottom: 10px;
}

.dropdown-name { font-weight: 700; color: var(--text-main); font-size: 16px; }
.dropdown-role { font-size: 13px; color: var(--primary); margin-bottom: 4px; font-weight: 500; }
.dropdown-email { font-size: 12px; color: var(--text-muted); word-break: break-all; }

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}

.dropdown-farms-title {
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.dropdown-farms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Scrollbar for farms list */
.dropdown-farms-list::-webkit-scrollbar {
  width: 4px;
}
.dropdown-farms-list::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.3);
  border-radius: 4px;
}

.dropdown-farm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid transparent;
  transition: var(--transition);
}

.dropdown-farm-item:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

@media (prefers-color-scheme: dark) {
  .dropdown-farm-item {
    background: rgba(255, 255, 255, 0.03);
  }
}

.farm-item-icon {
  font-size: 18px;
  background: rgba(255, 255, 255, 0.5);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.farm-item-details {
  display: flex;
  flex-direction: column;
}

.farm-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.farm-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.no-farms {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px 0;
  text-align: center;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  background: var(--bg-primary);
}

/* Sections */
.section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.section.active {
  display: block;
}

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

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Blurred Reveal Animation */
.blurred-reveal {
  filter: blur(6px);
  opacity: 0.5;
  transition: filter 0.8s ease-out, opacity 0.8s ease-out;
  user-select: none;
}
.blurred-reveal.revealed {
  filter: blur(0);
  opacity: 1;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

.kpi-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-label {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.kpi-trend {
  font-size: 13px;
  font-weight: 500;
}

.kpi-trend.up { color: var(--green); }
.kpi-trend.down { color: var(--red); }

.kpi-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.kpi-icon-wrap.green { background: rgba(34, 197, 94, 0.1); color: var(--green); }
.kpi-icon-wrap.blue { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.kpi-icon-wrap.yellow { background: rgba(234, 179, 8, 0.1); color: var(--yellow); }
.kpi-icon-wrap.purple { background: rgba(139, 92, 246, 0.1); color: var(--purple); }

/* Quick Actions */
.quick-actions-row {
  margin-bottom: 30px;
}

.row-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.quick-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
  transform: translateY(-3px);
}

.action-icon {
  font-size: 24px;
}

/* Map specific styles */
.map-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.map-box {
  width: 100%;
  height: 500px;
  z-index: 1;
}

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    height: 100vh;
    width: 100%;
    transform: translateX(-100%);
  }
  
  .hidden-desktop {
    display: block !important;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .hamburger {
    display: block;
  }
  
  .topbar {
    padding: 0 20px;
  }
  
  .content-area {
    padding: 20px;
  }
}

/* Health Section Upload */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.upload-zone:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.ml-result { margin-top: 20px; padding: 20px; border-radius: var(--radius-md); background: rgba(255,255,255,0.5); backdrop-filter: blur(4px); }

/* Custom alert styling */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  background-color: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 14px;
  z-index: 99999;
  min-width: 250px;
  text-align: center;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Multi-step Signup Form */
.form-step {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.form-step.active {
  display: block;
}

/* Leaflet map overrides to match dark/glass theme */
.leaflet-container {
  font-family: var(--font-family);
  background: var(--bg-glass);
}
.leaflet-popup-content-wrapper {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.leaflet-popup-tip {
  background: var(--bg-glass);
}

/* Responsive Form Row */
.form-row-responsive {
  display: flex;
  gap: 10px;
}

@media (max-width: 768px) {
  .form-row-responsive {
    flex-direction: column;
    gap: 0;
  }
}

/* Signup Progress Bar */
.signup-progress-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  margin-bottom: 25px;
  overflow: hidden;
  position: relative;
}

.signup-progress-bar {
  height: 100%;
  width: 33.33%; /* Default Step 1 */
  background: linear-gradient(90deg, var(--primary), var(--blue));
  border-radius: 3px;
  transition: width 0.4s ease-in-out;
}

/* Attractive Next Button */
.btn-next {
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  border: none;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669 0%, var(--primary) 100%);
}

/* Added Farm Summary Card */
.farm-card {
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: fadeIn 0.3s ease-out;
}
.farm-card-info strong {
  color: var(--text-main);
  display: block;
  font-size: 14px;
}
.farm-card-info span {
  color: var(--text-muted);
  font-size: 12px;
}
.farm-card-delete {
  background: transparent;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s;
}
.farm-card-delete:hover {
  transform: scale(1.1);
}

/* Search Button Responsiveness */
.search-btn {
  margin: 0;
  padding: 0 15px;
  font-size: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

@media (max-width: 768px) {
  .search-btn {
    padding: 12px 15px;
    margin-top: 10px;
  }
}

/* Farm Selector Pills */
.farm-pills-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  justify-content: center;
}

@media (max-width: 768px) {
  .farm-pills-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
}

.farm-pill {
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.farm-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    #refresh-btn { display: none !important; }
}

/* MODAL STYLES */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}
