/* AgriGrid Dynamics - Modern Industrial & Agrivoltaic Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Theme Tokens: Dark (Default) */
  --bg-primary: #070B14;
  --bg-secondary: #0D1527;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-elevated: #111D36;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(16, 185, 129, 0.3);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent-emerald: #10B981;
  --accent-cyan: #06B6D4;
  --accent-amber: #F59E0B;
  --glow-emerald: rgba(16, 185, 129, 0.15);
  --glow-cyan: rgba(6, 182, 212, 0.15);
  --grid-line: rgba(255, 255, 255, 0.04);
  --nav-backdrop: rgba(7, 11, 20, 0.85);
}

[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-elevated: #FFFFFF;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-accent: rgba(16, 185, 129, 0.35);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --accent-emerald: #059669;
  --accent-cyan: #0891B2;
  --accent-amber: #D97706;
  --glow-emerald: rgba(16, 185, 129, 0.08);
  --glow-cyan: rgba(6, 182, 212, 0.08);
  --grid-line: rgba(15, 23, 42, 0.035);
  --nav-backdrop: rgba(248, 250, 252, 0.88);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background Engineering Grid Texture */
.tech-grid-bg {
  background-image: 
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Radial Glow Backdrops */
.radial-glow-emerald {
  background: radial-gradient(circle at 50% 30%, rgba(16, 185, 129, 0.12) 0%, transparent 65%);
}

.radial-glow-cyan {
  background: radial-gradient(circle at 75% 40%, rgba(6, 182, 212, 0.12) 0%, transparent 65%);
}

/* Glassmorphism Cards */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  transition: all 0.25s ease;
}

.glass-panel:hover {
  border-color: var(--border-accent);
}

.glass-panel-glow {
  position: relative;
}
.glass-panel-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4), rgba(6, 182, 212, 0.2), transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Telemetry Font */
.font-mono-telemetry {
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

/* Pulse Indicators */
@keyframes radarPulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.4; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.live-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
  position: relative;
}

.live-beacon::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid #10B981;
  animation: radarPulse 2s infinite ease-in-out;
}

/* Canvas Container */
.canvas-wrapper {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.95) 0%, rgba(11, 20, 38, 0.98) 100%);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .canvas-wrapper {
  background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
}

/* Custom Sliders */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
}

[data-theme="light"] input[type="range"] {
  background: rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #FFFFFF;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Gradient Text */
.gradient-text-emerald {
  background: linear-gradient(135deg, #34D399 0%, #10B981 50%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-cyan {
  background: linear-gradient(135deg, #38BDF8 0%, #06B6D4 50%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Nav Active Link indicator */
.nav-link.active {
  color: var(--accent-emerald);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: #10B981;
  border-radius: 2px;
  box-shadow: 0 0 8px #10B981;
}

/* Floating animation */
@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.float-animation {
  animation: floatGentle 4s ease-in-out infinite;
}
