/* ==========================================================================
   NATIVEPLANR BOTANICAL DESIGN SYSTEM
   Inspired by Midwestern Prairie Restoration Layouts & Print Field Guides
   ========================================================================== */

/* Core Document Elements */
body {
  background-color: #fbf9f5;
  color: #2c2520;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  padding: 1.5rem;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Typography Hierarchy */
h1, h2, h3, h4, .panel-headline {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
  color: #1e3f29; /* Dark Forest Green */
  font-weight: 700;
  margin-top: 0;
}

p {
  color: #4a3f35; /* Soft Muted Charcoal Bark */
}

/* Editorial Container Card layout */
.canvas-viewport, .parameter-form {
  background-color: #f3f0e7; /* Seedling Parchment Paper */
  border: 1px solid #dfdacb;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(44, 37, 32, 0.05);
}

/* Touch-Friendly Inputs & Labels */
.parameter-form label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e3f29;
  display: block;
  margin-bottom: 0.4rem;
}

.parameter-form input, .parameter-form select {
  background-color: #fbf9f5;
  color: #2c2520;
  border: 1px solid #cfc4b2;
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.parameter-form input:focus {
  border-color: #689f7d;
  outline: none;
}

/* The Restoration Action Button */
.action-button {
  background-color: #386b4a; /* Prairie Canopy Green */
  color: #fbf9f5;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.action-button:hover {
  background-color: #244b31;
}

/* ==========================================================================
   SIMULATION GRID CANVAS LAYOUTS (MOBILE-SAFE & RESPONSIVE)
   ========================================================================== */
.simulation-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
}

/* Warnings and Metas Panel Elements */
.pipeline-warning-banner {
  background-color: #fffaf0;
  border: 1px solid #d69e2e;
  color: #744210;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.matrix-metadata-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.9rem;
  border-bottom: 2px solid #dfdacb;
  padding-bottom: 0.75rem;
  color: #4a3f35;
}

.meta-badge {
  background-color: #e9f2ec;
  color: #1e3f29;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.75rem;
  border: 1px solid #689f7d;
}

/* Viewport Controls */
.viewport-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eaddcd; /* Deeper Warm Parchment Base */
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #2c2520;
}

.zoom-btn {
  background: #fbf9f5;
  border: 1px solid #cfc4b2;
  color: #2c2520;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.zoom-btn:hover {
  background: #f3f0e7;
}

/* Mobile Panning Container */
.mobile-viewport-container {
  width: 100%;
  overflow: auto;
  background-color: #eaddcd; /* Soft Dirt/Mulch Underlay */
  border: 1px solid #cfc4b2;
  border-radius: 6px;
  padding: 1.5rem;
  box-sizing: border-box;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}

/* The Matrix Structural Blueprint */
.spatial-grid-matrix {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 12), minmax(52px, 1fr)); /* Larger touch targets for field work */
  grid-template-rows: repeat(var(--grid-rows, 12), minmax(52px, 1fr));
  gap: 6px;
  width: max-content;
  margin: 0 auto;
  transform-origin: top center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Plant Blueprint Cells */
.matrix-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 500;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  user-select: none;
  padding: 2px;
  text-align: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

/* Native Zone Color Rulesets */
.zone-edge { 
  background-color: #e9f2ec; 
  color: #1e3f29; 
  border: 1px solid #689f7d; 
}
.zone-center { 
  background-color: #f3ebf7; 
  color: #4c2d59; 
  border: 1px solid #ad83be; 
}
.zone-fill { 
  background-color: #fdf6e2; 
  color: #634413; 
  border: 1px solid #dca341; 
}
.zone-open { 
  background-color: #f5efe4; 
  color: #a69988; 
  border: 1px dashed #cfc4b2; 
}

/* Micro Typography for Botanical Labels */
.tile-label {
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1;
  word-break: break-all;
  text-transform: uppercase;
}
.tile-label-empty {
  font-size: 0.75rem;
  font-weight: bold;
}

/* Botanical Legend Block Layout */
.zone-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  background: #fdfbf7;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid #dfdacb;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #4a3f35;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

/* Loading/Error states matching paper texture rulesets */
.loading-shroud {
  padding: 3rem 1rem;
  text-align: center;
  color: #1e3f29;
  font-family: Georgia, serif;
  font-style: italic;
}

.canvas-error-state {
  border: 1px dashed #c53030;
  background: #fff5f5;
  color: #9b2c2c;
  padding: 2rem;
  border-radius: 4px;
  text-align: center;
}
