/* style.css - GrassRoute: Earthy, sunlight-readable outdoor theme */

:root {
  --primary-deep: #1b4332;
  --primary: #2d6a4f;
  --primary-light: #52b788;
  --primary-pale: #d8f3dc;
  
  --accent-amber: #e76f51;
  --accent-gold: #f4a261;
  --accent-yellow: #e9c46a;
  
  --bg-sand: #fbfbf8;
  --surface: #ffffff;
  --surface-alt: #f4f6f3;
  --border-subtle: #e2e8e1;
  
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --text-dim: #6b7280;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg-sand);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.header-brand h1 {
  font-size: 1.5rem;
  color: var(--primary-deep);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.model-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.model-bar-container {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.model-progress-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-light), var(--accent-amber));
  width: 0%;
  transition: width 0.3s ease;
}

.model-status-text {
  padding: 0.45rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Navigation Tabs */
.nav-bar {
  display: flex;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 2px solid var(--border-subtle);
  padding: 0 1rem;
  gap: 0.5rem;
}

.nav-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--primary);
}

.nav-tab.active {
  color: var(--primary-deep);
  border-bottom-color: var(--primary);
}

/* Layout */
.app-layout {
  max-width: 1040px;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.tab-content {
  padding: 1.5rem 1rem;
}

.hidden {
  display: none !important;
}

/* Cards & Sections */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.hero-section {
  border-left: 5px solid var(--primary);
}

.hero-text h2 {
  font-size: 1.45rem;
  color: var(--primary-deep);
  margin-bottom: 0.5rem;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Forms & Inputs */
.quest-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--surface-alt);
  color: var(--text-main);
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.form-row-center {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-deep);
}

.btn-success {
  background: var(--primary-deep);
  color: #fff;
}
.btn-success:hover {
  background: #133024;
}

.btn-accent {
  background: var(--accent-amber);
  color: #fff;
}
.btn-accent:hover {
  background: #d45b3c;
}

.btn-outline {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline:hover {
  background: var(--primary-pale);
}

.btn-danger-outline {
  border-color: #ef4444;
  color: #ef4444;
  background: transparent;
}
.btn-danger-outline:hover {
  background: #fee2e2;
}

.btn-outline-light {
  border-color: rgba(255,255,255,0.7);
  color: #fff;
  background: transparent;
}
.btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
}

.action-buttons {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-idle {
  background: #e5e7eb;
  color: #4b5563;
}

.badge-active {
  background: var(--primary-pale);
  color: var(--primary-deep);
}

.badge-safe {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-bird {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-garden {
  background: #fef3c7;
  color: #92400e;
}

/* Quest Card */
.quest-card {
  background: var(--primary-pale);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  color: var(--primary-deep);
}

.tip-box {
  background: rgba(255,255,255,0.7);
  border-left: 3px solid var(--primary);
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* Fullscreen Pocket Mode */
.pocket-mode {
  position: fixed;
  inset: 0;
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.pocket-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.pocket-leaf-pulse {
  font-size: 3.5rem;
  animation: leafPulse 3s ease-in-out infinite;
}

@keyframes leafPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 15px rgba(82, 183, 136, 0.6)); }
}

.pocket-card h2 {
  font-size: 1.6rem;
  color: var(--primary-light);
}

.pocket-sub {
  font-size: 0.95rem;
  color: #94a3b8;
}

.pocket-timer {
  font-size: 4rem;
  font-weight: 800;
  font-family: monospace;
  color: #ffffff;
  letter-spacing: -0.02em;
  background: rgba(255,255,255,0.05);
  padding: 0.5rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
}

.pocket-stat {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.pocket-mission-box {
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #cbd5e1;
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
}

.pocket-instructions {
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Field Guide Search & Catalog */
.search-wrap {
  margin: 1rem 0;
}

.search-results-box {
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.search-summary {
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.quick-hit {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}
.quick-hit:last-child {
  border-bottom: none;
}

.catalog-title {
  margin-top: 1.75rem;
  margin-bottom: 0.25rem;
  color: var(--primary-deep);
  font-size: 1.25rem;
}

.catalog-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-header strong {
  font-size: 1.05rem;
  color: var(--text-main);
}

.card-sub {
  font-style: italic;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: -0.3rem;
}

.clue-tag {
  background: var(--surface-alt);
  border-left: 3px solid var(--accent-amber);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.84rem;
  margin-top: auto;
}

.mnemonic-box {
  background: var(--primary-pale);
  color: var(--primary-deep);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.88rem;
}

/* Frost Planner */
.frost-control-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.inline-group {
  flex: 1;
  min-width: 260px;
}

.frost-output-container {
  margin: 1rem 0 1.5rem 0;
}

.frost-card {
  background: #f0fdf4;
  border-color: #86efac;
}

.frost-advice {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #166534;
}

.checklist {
  margin-top: 0.5rem;
  padding: 0.5rem 0;
}

.checklist ul {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
}

.checklist li {
  margin-bottom: 0.35rem;
}

/* Naturalist Q&A */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.quick-q-chip {
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.2s;
}

.quick-q-chip:hover {
  background: var(--primary-pale);
  border-color: var(--primary-light);
  color: var(--primary-deep);
}

.q-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.naturalist-reply-box {
  background: var(--surface-alt);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Field Journal */
.journal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.journal-stats {
  display: flex;
  gap: 1rem;
}

.stat-badge {
  background: var(--primary-pale);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-deep);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.journal-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.journal-entry {
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.entry-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

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

.entry-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.entry-notes {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
}

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Spinner */
.pulsing-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  margin-right: 0.5rem;
}

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

/* Footer */
.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.render-badge {
  display: inline-block;
  background: #000;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .pocket-timer {
    font-size: 3rem;
  }
}
