/* TerraPulse AI - Touch Grass CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette - Forest & Autumn Glow Dark Theme */
  --bg-dark: #090e0b;
  --bg-card: rgba(18, 28, 22, 0.75);
  --bg-card-hover: rgba(26, 41, 32, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(74, 124, 89, 0.25);
  --border-glow: rgba(74, 222, 128, 0.4);

  --accent-primary: #34d399; /* Emerald Green */
  --accent-glow: #059669;
  --accent-gold: #f59e0b; /* Autumn Gold */
  --accent-rust: #ea580c; /* Foliage Crimson */
  --accent-sky: #38bdf8; /* Trail Blue */
  --text-main: #f0fdf4;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 25px rgba(52, 211, 153, 0.15);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(52, 211, 153, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(245, 158, 11, 0.06) 0%, transparent 45%);
}

/* Background Hero Overlay */
.hero-bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: blur(8px);
  z-index: -1;
  pointer-events: none;
}

/* App Container */
.app-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Navigation Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-gold));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-tag {
  background: rgba(52, 211, 153, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Status Pill Indicators */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse 2s infinite;
}

.pulse-dot.offline {
  background-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 0.6rem;
  background: rgba(12, 20, 15, 0.8);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(5, 150, 105, 0.3));
  color: #ffffff;
  border: 1px solid var(--accent-primary);
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.2);
}

/* Tab Views Container */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
  display: block;
}

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

/* Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .grid-2col, .grid-3col {
    grid-template-columns: 1fr;
  }
}

/* Glass Card Component */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(74, 222, 128, 0.35);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* Upload & Camera Dropzone */
.dropzone {
  border: 2px dashed rgba(52, 211, 153, 0.4);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(52, 211, 153, 0.08);
}

.dropzone-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
}

.dropzone-text {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dropzone-subtext {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.file-input {
  display: none;
}

/* Sample Image Presets */
.sample-presets {
  margin-top: 1.25rem;
}

.preset-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.preset-chip:hover {
  background: rgba(52, 211, 153, 0.2);
  border-color: var(--accent-primary);
  color: #ffffff;
}

/* AI Neural Processing Box */
.ai-processing-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-primary);
  margin-top: 1.25rem;
  display: none;
}

.ai-processing-box.active {
  display: block;
}

.log-line {
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.log-line::before {
  content: '>';
  color: var(--accent-gold);
}

/* Result Display Section */
.preview-image-container {
  width: 100%;
  height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-glass);
  background: #000;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bounding-box {
  position: absolute;
  border: 2px solid var(--accent-primary);
  background: rgba(52, 211, 153, 0.15);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
  border-radius: 4px;
}

.bounding-label {
  position: absolute;
  top: -24px;
  left: 0;
  background: var(--accent-primary);
  color: #000;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
}

.result-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
}

.result-scientific {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.confidence-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.confidence-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.details-table td {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.details-table td:first-child {
  color: var(--text-muted);
  width: 40%;
}

.details-table td:last-child {
  font-weight: 600;
  text-align: right;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-glow));
  color: #042f1a;
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #1a0f00;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-block {
  width: 100%;
}

/* Foliage Canvas & Map Generator */
.map-canvas-container {
  width: 100%;
  height: 320px;
  background: #0d1510;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  position: relative;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

#trailMapCanvas {
  width: 100%;
  height: 100%;
}

/* Pocket Audio Companion Player */
.pocket-companion {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.pocket-companion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.audio-cue-box {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border-left: 4px solid var(--accent-gold);
  margin-bottom: 0.85rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.form-select, .form-input, .form-range {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-select:focus, .form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

/* Companion Plant Matrix */
.plant-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.plant-card-mini {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.plant-card-mini:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  background: rgba(52, 211, 153, 0.1);
}

.plant-icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.plant-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.plant-pair {
  font-size: 0.72rem;
  color: var(--accent-primary);
  margin-top: 0.2rem;
}

/* Logbook Entry List */
.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.log-item:hover {
  border-color: rgba(52, 211, 153, 0.4);
}

.log-item-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.log-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.log-item-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.log-item-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Badges Grid */
.badges-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.badge-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem 0.85rem;
  text-align: center;
  transition: var(--transition);
}

.badge-card.unlocked {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(0, 0, 0, 0.4));
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.badge-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  filter: grayscale(100%);
  opacity: 0.4;
}

.badge-card.unlocked .badge-icon {
  filter: grayscale(0%);
  opacity: 1;
}

.badge-title {
  font-size: 0.82rem;
  font-weight: 800;
}

.badge-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* Open AI Benchmarking & Why Open Innovation Section */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.25rem;
}

.comparison-table th {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.85rem 1rem;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  border-bottom: 2px solid var(--border-glass);
}

.comparison-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.comparison-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tag-open {
  color: var(--accent-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tag-closed {
  color: #f87171;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Screen Dimmer / Pocket Mode Overlay */
.pocket-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #020403;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.pocket-overlay.active {
  display: flex;
}

.pocket-dim-icon {
  font-size: 5rem;
  color: var(--accent-primary);
  margin-bottom: 1.5rem;
  animation: pulse 3s infinite;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-glass);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer a {
  color: var(--accent-primary);
  text-decoration: none;
}
