/* =============================================
   SMART FARMING ASSISTANT - DESIGN SYSTEM
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
  --green-900: #1B5E20;
  --green-800: #2E7D32;
  --green-700: #388E3C;
  --green-600: #43A047;
  --green-500: #4CAF50;
  --green-300: #81C784;
  --green-200: #A5D6A7;
  --green-100: #C8E6C9;
  --green-50: #E8F5E9;

  --brown-700: #5D4037;
  --brown-600: #6D4C41;
  --brown-400: #8D6E63;

  --orange-500: #FF9800;
  --orange-600: #FB8C00;
  --red-500: #F44336;
  --red-600: #E53935;
  --blue-500: #2196F3;
  --yellow-400: #FFEE58;
  --yellow-600: #F9A825;

  --bg-primary: #F1F8F1;
  --bg-card: #FFFFFF;
  --bg-card-glass: rgba(255, 255, 255, 0.75);
  --text-primary: #1A2E1A;
  --text-secondary: #4E6B4E;
  --text-muted: #8AA88A;
  --border: rgba(46, 125, 50, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.14);
  --shadow-green: 0 4px 20px rgba(46, 125, 50, 0.25);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  --transition: .22s cubic-bezier(.4, 0, .2, 1);
  --transition-spring: .35s cubic-bezier(.34, 1.56, .64, 1);

  --nav-height: 76px;
  --topbar-height: 68px;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans Devanagari', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

.btn-ripple {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}


.hidden {
  display: none !important;
}


#app {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-primary);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.18);
}

/* =============================================
   SCREENS
   ============================================= */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(30px);
  transition: opacity .3s ease, transform .3s ease;
  background: var(--bg-primary);
  overflow: hidden;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.screen.slide-out {
  opacity: 0;
  transform: translateX(-30px);
}

.screen-scroll {
  height: calc(100dvh - var(--topbar-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 16px;
  padding-bottom: calc(var(--nav-height) + 24px);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.screen-scroll::-webkit-scrollbar {
  display: none;
}

/* =============================================
   SCREEN HEADER
   ============================================= */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 10;
}

.screen-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--green-800);
}

.back-btn:hover {
  background: var(--green-50);
}

/* =============================================
   LOGIN SCREEN
   ============================================= */
#screen-login {
  background: linear-gradient(160deg, #E8F5E9 0%, #F1F8F1 40%, #DCEDC8 100%);
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.3;
}

.blob1 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #A5D6A7, #4CAF50);
  top: -80px;
  right: -80px;
}

.blob2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, #FFCDD2, #FF8A65);
  bottom: -60px;
  left: -60px;
}

.login-container {
  position: relative;
  z-index: 1;
  padding: 28px 20px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-container::-webkit-scrollbar {
  display: none;
}

.app-logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-logo-icon {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 4px 12px rgba(46, 125, 50, 0.35));
}

.app-logo-icon svg {
  width: 100%;
  height: 100%;
}

.app-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--green-900);
  line-height: 1.1;
}

.app-tagline {
  font-size: 13px;
  color: var(--green-700);
  font-weight: 500;
}

.farmer-illustration {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: white;
}

.farmer-illustration svg {
  width: 100%;
  height: auto;
  display: block;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card-glass);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: var(--transition-spring);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.lang-btn.active {
  border-color: var(--green-800);
  background: var(--green-50);
  box-shadow: 0 0 0 1px var(--green-800);
}

.lang-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.lang-flag {
  font-size: 20px;
}

.lang-name {
  font-size: 14px;
  font-weight: 600;
}

.input-group {
  display: flex;
  align-items: center;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.input-prefix {
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-800);
  border-right: 1.5px solid var(--border);
  background: var(--green-50);
  height: 52px;
  display: flex;
  align-items: center;
}

.input-group input {
  flex: 1;
  padding: 14px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-spring);
  box-shadow: var(--shadow-green);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(46, 125, 50, 0.4);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-full {
  width: 100%;
}

.btn-outline {
  padding: 10px 20px;
  border: 2px solid var(--green-700);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--green-700);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--green-50);
}

.login-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* =============================================
   DASHBOARD
   ============================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 44px;
  height: 44px;
  background: var(--green-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid var(--green-300);
}

.greeting {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.location-tag {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.notif-btn {
  width: 42px;
  height: 42px;
  background: var(--green-50);
  border: 1.5px solid var(--green-200);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.notif-btn:hover {
  background: var(--green-100);
}

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

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--red-500);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid white;
}

/* Dashboard scroll area */
#screen-dashboard .screen-scroll {
  height: calc(100dvh - var(--topbar-height));
  padding-top: 0;
}

/* ---- Alert Banner ---- */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  position: relative;
  z-index: 5;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alert-warning {
  background: linear-gradient(90deg, #FFF8E1, #FFFDE7);
  border-bottom: 2px solid #FFCA28;
}

.alert-danger {
  background: linear-gradient(90deg, #FFEBEE, #FFF3E0);
  border-bottom: 2px solid var(--red-500);
}

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

.alert-content {
  flex: 1;
}

.alert-content strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #E65100;
}

.alert-content p {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.alert-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
}

/* ---- Quick Stats ---- */
.quick-stats {
  display: flex;
  gap: 8px;
  padding: 12px 0 4px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.stat-green {
  background: #E8F5E9;
  color: var(--green-800);
  border: 1.5px solid var(--green-200);
}

.stat-blue {
  background: #E3F2FD;
  color: #1565C0;
  border: 1.5px solid #90CAF9;
}

.stat-orange {
  background: #FFF3E0;
  color: #E65100;
  border: 1.5px solid #FFCC80;
}

/* ---- Section Headers ---- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.badge-new {
  background: #E8F5E9;
  color: var(--green-800);
  animation: pulse-badge 2s ease infinite;
}

.badge-ai {
  background: linear-gradient(135deg, #7C4DFF, #E040FB);
  color: white;
}

@keyframes pulse-badge {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* ---- Hero Crop Card ---- */
.hero-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-green);
  position: relative;
}

.crop-hero {
  background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 50%, #388E3C 100%);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crop-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crop-hero-icon {
  font-size: 44px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: float 3s ease infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.crop-hero-text h3 {
  font-size: 22px;
  font-weight: 800;
  color: white;
}

.crop-hero-text p {
  font-size: 12px;
  color: #A5D6A7;
  margin-top: 2px;
}

.crop-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.tag-green {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.tag-blue {
  background: rgba(33, 150, 243, 0.3);
  color: white;
}

.profit-circle {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-full);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.profit-pct {
  font-size: 18px;
  font-weight: 800;
  color: #CCFF90;
}

.profit-label {
  font-size: 9px;
  color: #A5D6A7;
  font-weight: 600;
}

/* ---- Dashboard Cards Grid ---- */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dash-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 16px 14px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.card-weather::before {
  background: linear-gradient(90deg, #29B6F6, #0288D1);
}

.card-market::before {
  background: linear-gradient(90deg, #AB47BC, #7B1FA2);
}

.card-profit::before {
  background: linear-gradient(90deg, var(--green-500), var(--green-800));
}

.card-season::before {
  background: linear-gradient(90deg, #FF7043, #E64A19);
}

.dash-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.dash-card:active {
  transform: scale(0.97);
}

.dash-card-icon {
  font-size: 26px;
  margin-bottom: 8px;
}

.dash-card-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dash-card-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

.dash-card-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ---- Quick Actions ---- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-spring);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.quick-action-btn:hover {
  background: var(--green-50);
  border-color: var(--green-300);
  transform: translateY(-2px);
}

.qa-icon {
  font-size: 26px;
}

/* ---- Tips ---- */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: white;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.tip-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.tip-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tip-text strong {
  color: var(--text-primary);
}

/* =============================================
   CROP SUGGESTION SCREEN
   ============================================= */
.input-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.input-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
}

.field-input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  appearance: none;
}

.field-input:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.location-input-wrap {
  display: flex;
  gap: 8px;
}

.location-input-wrap .field-input {
  flex: 1;
}

.gps-btn {
  padding: 10px 14px;
  border: 1.5px solid var(--green-300);
  border-radius: var(--radius-sm);
  background: var(--green-50);
  font-size: 13px;
  font-weight: 600;
  color: var(--green-800);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.gps-btn:hover {
  background: var(--green-100);
}

.soil-chips,
.water-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-spring);
}

.chip-btn.active {
  background: var(--green-800);
  border-color: var(--green-800);
  color: white;
  transform: scale(1.04);
}

.chip-btn:hover:not(.active) {
  background: var(--green-50);
  border-color: var(--green-300);
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-min,
.slider-max {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 28px;
}

.ph-slider {
  flex: 1;
  appearance: none;
  height: 6px;
  background: linear-gradient(90deg, #f44336, #ffeb3b, #4caf50);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.ph-slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  background: white;
  border: 3px solid var(--green-700);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-spring);
}

.ph-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.ph-bar {
  display: flex;
  border-radius: var(--radius-full);
  overflow: hidden;
  height: 22px;
  gap: 2px;
}

.ph-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.ph-acid {
  background: #FFEBEE;
  color: #C62828;
}

.ph-neutral {
  background: var(--green-50);
  color: var(--green-800);
}

.ph-neutral.active {
  background: var(--green-200);
  font-weight: 700;
}

.ph-alk {
  background: #E8EAF6;
  color: #283593;
}

/* ---- Crop Results ---- */
.crop-results {
  margin-top: 16px;
}

.hidden {
  display: none !important;
}

.crop-result-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition-spring);
  animation: fadeSlideUp 0.4s ease forwards;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.crop-rank-1 {
  border-color: #FFD700;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.crop-rank-2 {
  border-color: #C0C0C0;
}

.crop-rank-3 {
  border-color: #CD7F32;
}

.rank-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.crop-result-body {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crop-result-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.crop-result-info {
  flex: 1;
}

.crop-result-info h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.crop-result-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.suitability-bar {
  height: 6px;
  background: var(--green-100);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.suit-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500), var(--green-800));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(.4, 0, .2, 1);
}

.suit-label {
  font-size: 10px;
  color: var(--green-700);
  font-weight: 600;
  margin-top: 3px;
  display: block;
}

.crop-result-badge {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.badge-high {
  background: #E8F5E9;
  color: var(--green-800);
  border: 1.5px solid var(--green-300);
}

.badge-med {
  background: #FFF8E1;
  color: #E65100;
  border: 1.5px solid #FFCA28;
}

.crop-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.extra-tag {
  padding: 4px 10px;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--green-800);
  font-weight: 500;
}

/* =============================================
   MARKET SCREEN
   ============================================= */
.commodity-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
}

.commodity-scroll::-webkit-scrollbar {
  display: none;
}

.comm-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.comm-chip.active {
  background: var(--green-800);
  border-color: var(--green-800);
  color: white;
}

.price-trend-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--border);
  margin-bottom: 4px;
}

.price-trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.price-trend-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-trend-header p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.price-change {
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.price-change.positive {
  background: #E8F5E9;
  color: var(--green-800);
}

.price-change.negative {
  background: #FFEBEE;
  color: var(--red-600);
}

.mini-chart {
  width: 100%;
}

.mini-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 2px;
}

.market-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
}

.market-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.market-best {
  border-color: var(--green-500);
  box-shadow: 0 4px 24px rgba(46, 125, 50, 0.2);
}

.market-best-badge {
  background: linear-gradient(90deg, var(--green-700), var(--green-900));
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 14px;
  letter-spacing: 0.5px;
}

.market-card-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.market-glow-bar {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--green-500), var(--green-900));
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
}

.market-icon {
  font-size: 32px;
}

.market-info {
  flex: 1;
}

.market-info h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.market-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.market-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--green-800);
  margin-top: 4px;
}

.market-price span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.price-diff {
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-primary);
}

.positive-diff {
  color: var(--green-800);
}

.neutral-diff {
  color: var(--text-muted);
}

.msp-card {
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  border: 1.5px solid var(--green-200);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 4px;
}

.msp-left {
  flex-shrink: 0;
  text-align: center;
}

.msp-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.msp-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--green-900);
}

.msp-right {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.msp-right strong {
  color: var(--green-800);
}

/* =============================================
   PROFIT SCREEN
   ============================================= */
.form-row {
  display: flex;
  gap: 12px;
}

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profit-result-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: 1.5px solid var(--border);
  margin-top: 16px;
  animation: fadeSlideUp 0.4s ease;
}

.profit-result-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.profit-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.pb-val {
  font-weight: 700;
  color: var(--text-primary);
}

.pb-val.cost {
  color: var(--red-500);
}

.pb-val.profit-val {
  color: var(--green-800);
  font-size: 20px;
}

.pb-val.roi-val {
  color: #7B1FA2;
  font-size: 16px;
}

.pb-divider {
  height: 1px;
  background: var(--border);
}

.pb-total {
  font-size: 15px;
  font-weight: 700;
  padding-top: 4px;
}

.pb-total span {
  color: var(--text-primary);
}

.profit-gauge-wrap {
  margin-top: 20px;
}

.profit-gauge {
  height: 32px;
  background: #f0f0f0;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

.gauge-fill {
  height: 100%;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  padding-left: 14px;
  transition: width 1s cubic-bezier(.4, 0, .2, 1);
}

.profit-fill {
  background: linear-gradient(90deg, var(--green-500), var(--green-800));
}

.loss-fill {
  background: linear-gradient(90deg, #EF9A9A, #E53935);
}

.gauge-label {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: white;
  mix-blend-mode: difference;
}

/* =============================================
   LAND PLANNING SCREEN
   ============================================= */
.plot-visual {
  display: flex;
  height: 130px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.plot-segment {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: white;
  min-width: 0;
  transition: flex 0.6s cubic-bezier(.4, 0, .2, 1);
}

.plot-crop-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.plot-crop-name {
  font-size: 11px;
  font-weight: 700;
}

.plot-crop-area {
  font-size: 10px;
  opacity: 0.8;
}

.plan-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: white;
  margin-bottom: 16px;
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
}

.plan-table thead {
  background: var(--green-50);
}

.plan-table th {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green-800);
  text-align: left;
  border-bottom: 1.5px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.plan-table td {
  padding: 11px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.plan-table tr:last-child td {
  border-bottom: none;
}

.table-total td {
  font-weight: 700;
  color: var(--text-primary);
  background: var(--green-50);
}

.table-crop {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.positive {
  color: var(--green-800);
  font-weight: 700;
}

/* ---- Timeline ---- */
.timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  padding-bottom: 20px;
  padding-left: 4px;
}

.timeline-item:last-child {
  padding-bottom: 8px;
}

.tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  background: var(--text-muted);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--text-muted);
  position: relative;
  z-index: 1;
}

.tl-done .tl-dot {
  background: var(--green-700);
  box-shadow: 0 0 0 2px var(--green-700);
}

.tl-active .tl-dot {
  background: var(--orange-500);
  box-shadow: 0 0 0 2px var(--orange-500), 0 0 0 6px rgba(255, 152, 0, 0.2);
  animation: pulse-dot 1.5s ease infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 0 2px var(--orange-500), 0 0 0 6px rgba(255, 152, 0, 0.2);
  }

  50% {
    box-shadow: 0 0 0 2px var(--orange-500), 0 0 0 10px rgba(255, 152, 0, 0.1);
  }
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.tl-done::before {
  background: var(--green-300);
}

.tl-content strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.tl-content p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tl-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
}

.tl-badge.done {
  background: var(--green-100);
  color: var(--green-800);
}

.tl-badge.active {
  background: #FFF3E0;
  color: #E65100;
}

.tl-badge.upcoming {
  background: #F3E5F5;
  color: #6A1B9A;
}

/* =============================================
   CALENDAR SCREEN
   ============================================= */
.phase-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  color: white;
}

.phase-icon {
  font-size: 40px;
}

.phase-label {
  font-size: 11px;
  color: #A5D6A7;
  font-weight: 600;
}

.phase-name {
  font-size: 18px;
  font-weight: 800;
}

.phase-days {
  font-size: 12px;
  color: #C8E6C9;
  margin-top: 4px;
}

.phase-progress-wrap {
  margin-left: auto;
  flex-shrink: 0;
}

.phase-progress-ring svg {
  width: 60px;
  height: 60px;
}

.cal-steps {
  padding: 8px 0;
}

.cal-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: white;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 3px;
  border: 1.5px solid var(--border);
  position: relative;
}

.cal-step.step-active {
  border-color: var(--orange-500);
  background: #FFF8E1;
  box-shadow: 0 2px 12px rgba(255, 152, 0, 0.15);
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.step-done-icon {
  background: var(--green-100);
}

.step-active-icon {
  background: #FFF3E0;
  animation: pulse-icon 1.5s ease infinite;
}

.step-upcoming-icon {
  background: #F3E5F5;
}

@keyframes pulse-icon {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

.step-connector {
  height: 4px;
  margin: 0 0 3px 24px;
  background: var(--border);
  border-radius: var(--radius-full);
}

.step-connector.done {
  background: var(--green-300);
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.step-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.step-alert {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #E65100;
  background: #FFF3E0;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* =============================================
   PEST DETECTION SCREEN
   ============================================= */
.pest-upload-area {
  background: white;
  border: 2.5px dashed var(--green-300);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pest-upload-area:hover {
  background: var(--green-50);
  border-color: var(--green-600);
}

.pest-upload-icon {
  font-size: 48px;
}

.pest-upload-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.pest-upload-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.pest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.pest-preselect {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  cursor: pointer;
  transition: var(--transition-spring);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.pest-preselect:hover {
  background: var(--green-50);
  border-color: var(--green-400);
  transform: translateY(-2px);
}

.pest-preselect-icon {
  font-size: 28px;
}

.pest-result {
  background: white;
  border-radius: var(--radius-lg);
  border: 2px solid var(--orange-500);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(255, 152, 0, 0.15);
  animation: fadeSlideUp 0.4s ease;
}

.pest-result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, #FFF3E0, #FFF8E1);
  padding: 16px;
  border-bottom: 1.5px solid #FFE0B2;
}

.pest-confidence {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--orange-600);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 60px;
  flex-shrink: 0;
}

.pest-conf-val {
  font-size: 18px;
  font-weight: 800;
  color: white;
}

.pest-conf-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.pest-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.pest-severity {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  display: inline-block;
}

.severity-high {
  background: #FFEBEE;
  color: var(--red-600);
}

.severity-med {
  background: #FFF3E0;
  color: #E65100;
}

.severity-low {
  background: var(--green-50);
  color: var(--green-800);
}

.pest-desc {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

.solution-steps {
  padding: 14px 16px;
}

.solution-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.solution-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sol-num {
  width: 24px;
  height: 24px;
  background: var(--green-800);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.sol-tip {
  font-size: 11px;
  color: var(--green-700);
  font-style: italic;
  display: block;
  margin-top: 2px;
}

.sol-tabs {
  display: flex;
  background: #f0f0f0;
  margin: 10px 16px;
  border-radius: var(--radius-md);
  padding: 3px;
}

.sol-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
}

.sol-tab.active {
  background: white;
  color: var(--green-800);
  box-shadow: var(--shadow-sm);
}

.chem-warning {
  margin: 14px 16px;
  padding: 10px 14px;
  background: #FFF3E0;
  border-radius: var(--radius-md);
  font-size: 11px;
  color: #E65100;
  font-weight: 600;
  line-height: 1.4;
  border-left: 3px solid #FF9800;
}

/* =============================================
   PROFILE SCREEN
   ============================================= */
.profile-hero {
  background: linear-gradient(160deg, var(--green-900), var(--green-700), var(--green-500));
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  color: white;
  margin-bottom: 16px;
}

.profile-avatar {
  font-size: 56px;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
}

.profile-location {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.profile-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px;
}

.p-stat {
  text-align: center;
}

.p-stat-val {
  font-size: 20px;
  font-weight: 800;
}

.p-stat-label {
  font-size: 11px;
  opacity: 0.75;
  font-weight: 500;
  margin-top: 2px;
}

.p-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.3);
}

.profile-section {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}

.profile-item:last-child {
  border-bottom: none;
}

.profile-item-info {
  flex: 1;
}

.profile-item-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.profile-item-val {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 1px;
}

.profile-edit-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  cursor: pointer;
  transition: var(--transition);
}

.profile-edit-btn:hover {
  background: var(--green-100);
}

.profile-links {
  background: transparent;
  border: none;
  gap: 8px;
  display: flex;
  flex-direction: column;
}

.profile-link-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition-spring);
}

.profile-link-btn:hover {
  background: var(--green-50);
  border-color: var(--green-300);
  transform: translateX(3px);
}

.logout-btn {
  color: var(--red-500);
}

.logout-btn:hover {
  background: #FFEBEE;
  border-color: #FFCDD2;
}

/* =============================================
   BOTTOM NAVIGATION
   ============================================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-height);
  background: white;
  border-top: 1.5px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  gap: 0;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  display: none;
}

.bottom-nav.visible {
  display: flex;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  position: relative;
}

.nav-item.active {
  color: var(--green-800);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-icon {
  font-size: 22px;
  transition: var(--transition-spring);
}

.nav-voice-space {
  flex: 1;
}

/* space for FAB */
.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 0;
  height: 3px;
  background: var(--green-700);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  transition: var(--transition);
}

.nav-item.active::after {
  width: 28px;
}

/* =============================================
   FLOATING VOICE BUTTON
   ============================================= */
.voice-fab {
  position: fixed;
  bottom: calc(var(--nav-height) - 26px);
  left: 50%;
  transform: translateX(-50%);
  width: 62px;
  height: 62px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green-600), var(--green-900));
  border: 3px solid white;
  cursor: pointer;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(46, 125, 50, 0.5);
  transition: var(--transition-spring);
}

.voice-fab.visible {
  display: flex;
}

.voice-fab:hover {
  transform: translateX(-50%) scale(1.08);
  box-shadow: 0 6px 28px rgba(46, 125, 50, 0.6);
}

.voice-fab:active {
  transform: translateX(-50%) scale(0.95);
}

.voice-inner {
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
}

.voice-inner svg {
  width: 100%;
  height: 100%;
}

.voice-pulse {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  background: rgba(46, 125, 50, 0.3);
  animation: voice-pulse-anim 2s ease infinite;
  pointer-events: none;
}

.pulse2 {
  animation-delay: 1s;
}

@keyframes voice-pulse-anim {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.voice-fab.listening .voice-pulse {
  background: rgba(255, 0, 0, 0.3);
  animation-duration: 0.8s;
}

.voice-fab.listening {
  background: linear-gradient(135deg, #E53935, #C62828);
}

/* =============================================
   VOICE OVERLAY
   ============================================= */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.voice-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.voice-overlay-content {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(.34, 1.1, .64, 1);
  overflow: hidden;
}

.voice-overlay.open .voice-overlay-content {
  transform: translateY(0);
}

.voice-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voice-overlay-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.overlay-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.overlay-close:hover {
  background: #f0f0f0;
}

.voice-animation-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  position: relative;
}

.voice-anim-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(46, 125, 50, 0.2);
  animation: ring-anim 2.5s ease infinite;
}

.r1 {
  width: 60px;
  height: 60px;
  animation-delay: 0s;
}

.r2 {
  width: 85px;
  height: 85px;
  animation-delay: 0.5s;
}

.r3 {
  width: 108px;
  height: 108px;
  animation-delay: 1s;
}

@keyframes ring-anim {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

.voice-anim-core {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--green-600), var(--green-900));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-green);
  position: relative;
  z-index: 1;
  animation: mic-breathe 1.5s ease infinite;
}

.voice-anim-core svg {
  width: 26px;
  height: 26px;
}

@keyframes mic-breathe {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.07);
  }
}

.voice-status {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--green-700);
  letter-spacing: 0.5px;
}

.chat-area {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.chat-area::-webkit-scrollbar {
  display: none;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.4;
  animation: fadeSlideUp 0.3s ease;
}

.bubble-user {
  align-self: flex-end;
  background: var(--green-800);
  color: white;
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
}

.bubble-ai {
  align-self: flex-start;
  background: var(--green-50);
  color: var(--text-primary);
  border: 1.5px solid var(--green-100);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
}

.voice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-chip {
  padding: 8px 14px;
  border: 1.5px solid var(--green-200);
  border-radius: var(--radius-full);
  background: var(--green-50);
  font-size: 12px;
  font-weight: 600;
  color: var(--green-800);
  cursor: pointer;
  transition: var(--transition);
}

.voice-chip:hover {
  background: var(--green-100);
}

.voice-text-input {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 8px 8px 16px;
  background: var(--bg-primary);
}

.voice-text-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--green-800);
  border: none;
  color: white;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-spring);
}

.send-btn:hover {
  background: var(--green-900);
  transform: scale(1.1);
}

/* =============================================
   ANIMATIONS & UTILITIES
   ============================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple-anim 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (min-width: 430px) {
  #app {
    border-radius: 24px;
    margin-top: 20px;
    height: calc(100dvh - 40px);
  }

  .voice-fab {
    bottom: calc(var(--nav-height) - 20px);
  }
}

@media (max-height: 700px) {
  .farmer-illustration {
    max-height: 140px;
  }

  .farmer-illustration svg {
    max-height: 140px;
  }
}

/* =============================================
   CROP HEALTH SCREEN
   ============================================= */
.health-score-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  margin-bottom: 4px;
}

.health-score-left {
  flex-shrink: 0;
}

.health-score-ring {
  width: 88px;
  height: 88px;
}

.health-score-ring svg {
  width: 100%;
  height: 100%;
}

.health-score-right {
  flex: 1;
}

.health-score-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.health-score-status {
  font-size: 16px;
  font-weight: 800;
  color: var(--green-800);
  margin: 4px 0 3px;
}

.health-score-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.health-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.health-chip {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.chip-green {
  background: #E8F5E9;
  color: var(--green-800);
  border: 1px solid var(--green-200);
}

.chip-yellow {
  background: #FFF8E1;
  color: #E65100;
  border: 1px solid #FFCC80;
}

/* Health Alert Cards */
.health-alert-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-sm);
}

.alert-yellow {
  background: #FFF8E1;
  border-color: #FFCA28;
}

.alert-red {
  background: #FFEBEE;
  border-color: var(--red-500);
}

.ha-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.ha-body {
  flex: 1;
}

.ha-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ha-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.ha-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.badge-warn {
  background: #FFF3E0;
  color: #E65100;
}

.badge-high {
  background: #FFEBEE;
  color: var(--red-600);
}

/* Soil Report */
.soil-report-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.soil-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.soil-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 110px;
  flex-shrink: 0;
}

.soil-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--green-50);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.soil-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.soil-val {
  font-size: 12px;
  font-weight: 700;
  width: 38px;
  text-align: right;
}

.good-val {
  color: var(--green-700);
}

.warn-val {
  color: #E65100;
}

.soil-advice {
  background: var(--green-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--green-800);
  font-weight: 500;
  border: 1px solid var(--green-200);
}

/* AI Scan Area */
.ai-scan-area {
  background: white;
  border: 2px dashed var(--green-300);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.ai-scan-area:hover {
  background: var(--green-50);
}

.ai-scan-icon {
  font-size: 40px;
}

.ai-scan-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-scan-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* =============================================
   COMMUNITY SCREEN
   ============================================= */
.post-create-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  margin-bottom: 16px;
}

.post-create-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.comm-avatar {
  width: 40px;
  height: 40px;
  background: var(--green-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 2px solid var(--green-300);
  flex-shrink: 0;
}

.post-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-primary);
  outline: none;
  transition: var(--transition);
}

.post-input:focus {
  border-color: var(--green-500);
  background: white;
}

.post-create-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.post-action-btn {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--green-50);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.post-action-btn:hover {
  background: var(--green-100);
  border-color: var(--green-300);
}

.post-action-btn.selected {
  background: var(--green-800);
  color: white;
  border-color: var(--green-800);
}

.post-submit-btn {
  margin-left: auto;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-spring);
  box-shadow: var(--shadow-green);
}

.post-submit-btn:hover {
  transform: translateY(-1px);
}

.post-submit-btn:active {
  transform: scale(0.96);
}

/* Community Feed & Post Cards */
.comm-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comm-post {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  animation: fadeSlideUp 0.4s ease;
}

.comm-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.comm-post-avatar {
  width: 38px;
  height: 38px;
  background: var(--green-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid var(--green-200);
  flex-shrink: 0;
}

.comm-post-meta {
  flex: 1;
}

.comm-post-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.comm-post-loc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.comm-badge {
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.badge-tip {
  background: #E8F5E9;
  color: var(--green-800);
}

.badge-question {
  background: #E3F2FD;
  color: #1565C0;
}

.comm-post-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}

.comm-post-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.comm-action {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-primary);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.comm-action:hover {
  background: var(--green-50);
  border-color: var(--green-300);
  color: var(--green-800);
}

.comm-action.liked {
  background: var(--green-50);
  border-color: var(--green-300);
  color: var(--green-800);
}

.like-count {
  font-weight: 700;
}