@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,400;1,9..144,700;1,9..144,900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  /* Dynamic, modern color palette inspired by nature and tech */
  --primary: hsl(150, 78%, 40%);
  --primary-hover: hsl(150, 78%, 35%);
  --primary-glow: hsla(150, 78%, 40%, 0.3);
  --secondary: hsl(35, 92%, 55%);
  --secondary-hover: hsl(35, 92%, 50%);
  --background: hsl(210, 20%, 98%);
  --surface: hsl(0, 0%, 100%);
  --surface-hover: hsl(210, 20%, 96%);
  --text-main: hsl(222, 47%, 11%);
  --text-muted: hsl(215, 16%, 47%);
  --border: hsl(214, 32%, 91%);
  --danger: hsl(348, 83%, 47%);
  --success: hsl(150, 78%, 40%);
  --warning: hsl(35, 92%, 55%);
  
  --font-heading: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-ui: 'Space Grotesk', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 25px var(--primary-glow);
  
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='dark'] {
  --background: hsl(222, 47%, 11%);
  --surface: hsl(217, 33%, 17%);
  --surface-hover: hsl(217, 33%, 22%);
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 65%);
  --border: hsl(217, 33%, 25%);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* 🌿 Plant botanical hero title — Fraunces italic, rich & organic */
.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(34, 100, 50, 0.15);
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--transition);
}

button {
  font-family: var(--font-ui);
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* Utilities */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.glass-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 1rem;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background: var(--secondary-hover);
  transform: translateY(-2px);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 var(--primary-glow); }
  70% { box-shadow: 0 0 0 15px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }

/* Views container */
#app-container {
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

.view {
  display: none;
  min-height: 100vh;
  width: 100%;
}

.view.active {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.4s ease-out forwards;
}

/* --- Landing Page --- */
.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.landing-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 60%);
  z-index: -1;
  animation: spin 30s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* --- Login Page --- */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--background) 0%, var(--surface-hover) 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 3rem;
  text-align: center;
}

.login-card h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--background);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.form-group {
  text-align: left;
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--text-main);
  font-family: var(--font-body);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* --- Dashboard Layout --- */
.dashboard {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 280px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-main);
  letter-spacing: 0.01em;
}

.sidebar-logo i {
  color: var(--primary);
  font-size: 2rem;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.nav-item i {
  font-size: 1.25rem;
}

.dashboard-main {
  flex: 1;
  background: var(--background);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

[data-theme='dark'] .topbar {
  background: rgba(30, 41, 59, 0.7);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.content-area {
  padding: 2.5rem;
  flex: 1;
  overflow-y: auto;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Main Dashboard Elements */
.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Grid Layouts */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* Tables */
.table-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.table-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  font-size: 0.9375rem;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: hsla(150, 78%, 40%, 0.1); color: var(--success); }
.badge-warning { background: hsla(35, 92%, 55%, 0.1); color: var(--warning); }
.badge-danger { background: hsla(348, 83%, 47%, 0.1); color: var(--danger); }
.badge-primary { background: var(--primary-glow); color: var(--primary); }

/* Forms & Specific Sections */
.form-section {
  max-width: 800px;
}

.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--background);
}

.file-upload:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.file-upload i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* Marketplace specific */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.product-img {
  width: 100%;
  height: 200px;
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 4rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.product-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.product-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.product-meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* Disease Detection Box */
.disease-result {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
  display: none;
}

.disease-result.detected {
  display: block;
  background: hsla(348, 83%, 47%, 0.1);
  border: 1px solid var(--danger);
}

.disease-result.healthy {
  display: block;
  background: hsla(150, 78%, 40%, 0.1);
  border: 1px solid var(--success);
}

/* Interactive Hero Image CSS */
.interactive-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-xl);
  perspective: 1000px;
}

.hero-interactive-img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
}

.interactive-image-wrapper:hover .hero-interactive-img {
  transform: rotateY(-5deg) rotateX(2deg) scale(1.02);
}

/* Floating Badges */
.float-badge {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  z-index: 10;
  transition: transform 0.3s;
  pointer-events: none;
}

@keyframes floatUpAndDown {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

@keyframes floatDownAndUp {
  0% { transform: translateY(0px); }
  50% { transform: translateY(15px); }
  100% { transform: translateY(0px); }
}

.float-up {
  animation: floatUpAndDown 6s ease-in-out infinite;
}

.float-down {
  animation: floatDownAndUp 7s ease-in-out infinite;
}

