/* Plumewatch - Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ===== Mobile header (hidden on desktop) ===== */
.header-mobile {
  display: none; /* shown only at mobile breakpoint */
  background: #1a237e;
  color: #fff;
  padding: 8px 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.header-mobile-title {
  font-size: 1rem;
  font-weight: 700;
}

.logo-mobile {
  height: 24px;
  width: auto;
  filter: brightness(0) invert(1);
}

.header-mobile-right a {
  color: #fff;
  opacity: 0.8;
  font-size: 0.8rem;
  text-decoration: underline;
}

/* ===== Main Layout — sidebar left, map right ===== */
.main {
  display: flex;
  height: 100vh;
  min-height: 400px;
}

/* ===== Left Sidebar ===== */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: #fff;
  overflow-y: auto;
  border-right: 1px solid #e0e0e0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 2px solid #1a237e;
}

.sidebar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a237e;
  line-height: 1.2;
}

.logo-desktop {
  height: 32px;
  width: auto;
}

.sidebar-brand-sub {
  font-size: 0.8rem;
  color: #666;
  margin-top: 2px;
}

.sidebar-about {
  font-size: 0.75rem;
  color: #1a237e;
  text-decoration: none;
  opacity: 0.7;
}

.sidebar-about:hover {
  opacity: 1;
  text-decoration: underline;
}

.sidebar h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a237e;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #e8eaf6;
}

.sidebar-whitepaper-btn {
  display: block;
  margin-top: 16px;
  padding: 10px 16px;
  background: #1a237e;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.sidebar-whitepaper-btn:hover {
  background: #283593;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-size: 0.7rem;
  color: #999;
  line-height: 1.5;
}

.sidebar-footer a {
  color: #1a237e;
  text-decoration: none;
}

/* ===== Map + Timeline column ===== */
.map-timeline-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.map-container {
  flex: 1;
  min-width: 0;
  position: relative;
}

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

.plant-marker {
  background: none;
  border: none;
}

.plant-icon {
  font-size: 28px;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
  cursor: pointer;
}

.pin-marker {
  background: none;
  border: none;
}

.pin-icon {
  width: 24px;
  height: 36px;
  position: relative;
}

.pin-icon::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background: #e53935;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.pin-icon::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  left: 8px;
}

/* ===== Risk Banner — overlaid on map ===== */
.risk-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  background: rgba(232, 245, 233, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease;
}

.risk-level {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 4px;
}

.risk-label {
  font-size: 1.5rem;
  font-weight: 700;
}

.risk-score {
  font-size: 1.1rem;
  opacity: 0.8;
}

.risk-detail {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 4px;
}

.risk-description {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== Conditions ===== */
.condition-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #f0f0f0;
}

.condition-label {
  color: #666;
}

.info-tip {
  position: relative;
  cursor: pointer;
  color: #999;
  font-size: 0.85em;
}

.info-tip-text {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  line-height: 1.4;
  width: 220px;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.info-tip:hover .info-tip-text,
.info-tip:focus .info-tip-text {
  display: block;
}

.condition-value {
  font-weight: 500;
}

.inversion-likely {
  color: #d32f2f;
  font-weight: 700;
}

.inversion-possible {
  color: #f57c00;
  font-weight: 600;
}

.inversion-unlikely {
  color: #388e3c;
}

/* ===== Wind Compass ===== */
.compass-container {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.compass-svg {
  width: 120px;
  height: 120px;
}

.compass-label {
  font-size: 12px;
  fill: #666;
  font-weight: 600;
}

.compass-speed {
  font-size: 20px;
  font-weight: 700;
  fill: #333;
}

.compass-unit {
  font-size: 10px;
  fill: #999;
}

/* ===== Plant Cards ===== */
.plant-card {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
}

.plant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

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

.plant-card-risk {
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

/* Chemical overlay toggles */
.chemical-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}

.chemical-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #444;
}

.chemical-toggle input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.chemical-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.chemical-name {
  line-height: 1.3;
}

.combined-swatch {
  background: radial-gradient(circle, #f44336 0%, #ff9800 50%, #4caf50 100%);
}


.chemical-divider {
  height: 1px;
  background: #ddd;
  margin: 2px 0;
}

/* Chemical legend on map */
.chemical-legend {
  background: rgba(255,255,255,0.92);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  font-size: 0.8rem;
  line-height: 1.5;
  color: #333;
}

.chemical-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chemical-legend-swatch {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px dashed rgba(0,0,0,0.3);
}

.plant-card-detail {
  font-size: 0.8rem;
  color: #666;
  padding: 2px 0;
}

.plant-card-weather-note {
  font-size: 0.78rem;
  color: #444;
  background: #f5f0e8;
  border-left: 3px solid #ff9800;
  padding: 6px 8px;
  margin-top: 6px;
  line-height: 1.4;
  border-radius: 0 4px 4px 0;
}

/* ===== Timeline ===== */
.timeline-container {
  flex: none;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 8px 0;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 6px;
}

.timeline-container h3 {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.scoring-mode-select {
  font-size: 0.75rem;
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  color: #444;
  cursor: pointer;
}

#timeline {
  display: flex;
  overflow-x: auto;
  padding: 0 12px 8px;
  gap: 2px;
  scrollbar-width: thin;
}

.timeline-cell {
  flex-shrink: 0;
  width: 52px;
  padding: 4px 2px;
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  border: 2px solid transparent;
  position: relative;
}

.timeline-cell:hover {
  background: #f0f0f0;
}

.timeline-cell.selected {
  background: #e8eaf6;
  border-color: #1a237e;
}

.timeline-day {
  font-size: 0.65rem;
  font-weight: 700;
  color: #1a237e;
  height: 14px;
}

.timeline-hour {
  font-size: 0.7rem;
  color: #666;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin: 4px auto;
}

.timeline-wind {
  display: inline-block;
  font-size: 0.8rem;
  color: #999;
  line-height: 1;
}

.timeline-temp {
  font-size: 0.7rem;
  color: #888;
}

/* ===== Loading / Error ===== */
.loading {
  text-align: center;
  padding: 20px;
  color: #666;
  font-style: italic;
}

.error {
  text-align: center;
  padding: 20px;
  color: #d32f2f;
}

/* ===== About Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

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

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  margin: 20px;
}

.modal h2 {
  margin-bottom: 12px;
  color: #1a237e;
}

.modal p {
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal .close-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ============================================
   Responsive — Tablet (sidebar on top)
   ============================================ */
@media (max-width: 768px) {
  .header-mobile {
    display: flex;
  }

  .sidebar-brand {
    display: none;
  }

  .main {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    order: 2; /* sidebar goes below map+timeline on mobile */
  }

  .map-timeline-column {
    flex: none;
    order: 1;
  }

  .map-container {
    flex: none;
    height: 55vh;
    min-height: 300px;
  }

  .sidebar-footer {
    text-align: center;
    padding-top: 10px;
  }
}

/* ============================================
   Responsive — Phone
   ============================================ */
@media (max-width: 480px) {
  .header-mobile {
    padding: 6px 12px;
  }

  .header-mobile-title {
    font-size: 0.9rem;
  }

  .risk-banner {
    padding: 0;
  }

  .risk-gauge {
    gap: 8px;
    padding: 6px 10px;
  }

  .risk-gauge-meter {
    width: 100px;
  }

  .risk-gauge-details {
    font-size: 0.72rem;
  }

  .risk-gauge-score {
    font-size: 22px;
  }

  .risk-gauge-label {
    font-size: 10px;
  }

  .compass-svg-animated {
    width: 100px;
    height: 100px;
  }

  .map-container {
    height: 50vh;
    min-height: 250px;
  }

  .sidebar {
    padding: 12px;
  }

  .sidebar h2 {
    font-size: 0.85rem;
    margin-bottom: 6px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }

  .compass-container {
    margin: 6px 0;
  }

  .plant-card {
    padding: 8px;
    margin-bottom: 8px;
  }

  .plant-card-name {
    font-size: 0.8rem;
  }

  .plant-card-detail {
    font-size: 0.75rem;
    padding: 1px 0;
  }

  .plant-card-weather-note {
    font-size: 0.73rem;
    padding: 5px 6px;
    margin-top: 4px;
  }

  .condition-row {
    font-size: 0.8rem;
    padding: 4px 0;
  }

  .timeline-container {
    padding: 6px 0;
  }

  .timeline-container h3 {
    font-size: 0.75rem;
    padding: 0 12px 4px;
  }

  #timeline,
  .timeline-enhanced {
    padding: 0 8px 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .timeline-cell {
    width: 48px;
    min-height: 44px;
    scroll-snap-align: start;
  }

  .timeline-hour {
    font-size: 0.65rem;
  }

  .timeline-dot {
    width: 12px;
    height: 12px;
  }

  .timeline-temp {
    font-size: 0.65rem;
  }

  .modal {
    margin: 8px;
    padding: 16px;
    max-height: 90vh;
    border-radius: 6px;
  }

  .modal h2 {
    font-size: 1.1rem;
  }

  .modal p {
    font-size: 0.82rem;
  }

  .modal .close-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
  }

  .leaflet-popup-content {
    font-size: 0.8rem;
    max-width: 280px !important;
    margin: 8px 12px !important;
  }
}

/* ============================================
   Landscape phone
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
  .main {
    flex-direction: row;
    height: calc(100vh - 36px);
  }

  .map-timeline-column {
    order: 1;
  }

  .map-container {
    height: auto;
    flex: 1;
    max-height: none;
  }

  .sidebar {
    width: 260px;
    order: 2;
    border-right: none;
    border-left: 1px solid #e0e0e0;
    border-bottom: none;
    overflow-y: auto;
  }
}

/* ============================================
   Dark mode
   ============================================ */
@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #e0e0e0;
  }

  .header-mobile {
    background: #0d1147;
  }

  .sidebar {
    background: #1e1e1e;
    border-color: #333;
  }

  .sidebar-brand h1 {
    color: #8c9eff;
  }

  .sidebar-brand-sub {
    color: #999;
  }

  .sidebar-brand {
    border-bottom-color: #5c6bc0;
  }

  .sidebar-about {
    color: #8c9eff;
  }

  .sidebar h2 {
    color: #8c9eff;
    border-bottom-color: #333;
  }

  .sidebar-footer {
    border-top-color: #333;
    color: #666;
  }

  .sidebar-footer a {
    color: #8c9eff;
  }

  .sidebar-whitepaper-btn {
    background: #3949ab;
  }

  .sidebar-whitepaper-btn:hover {
    background: #5c6bc0;
  }

  .plant-card {
    background: #262626;
    border-color: #444;
  }

  .plant-card-detail {
    color: #aaa;
  }

  .plant-card-weather-note {
    background: #2a2518;
    color: #ccc;
  }

  .condition-row {
    border-bottom-color: #333;
  }

  .condition-label {
    color: #aaa;
  }

  .timeline-container {
    background: #1e1e1e;
    border-color: #333;
  }

  .timeline-container h3 {
    color: #aaa;
  }

  .timeline-cell:hover {
    background: #333;
  }

  .timeline-cell.selected {
    background: #1a237e;
    border-color: #5c6bc0;
  }

  .timeline-day {
    color: #8c9eff;
  }

  .timeline-hour {
    color: #aaa;
  }

  .timeline-temp {
    color: #999;
  }

  .risk-banner {
    background: rgba(27, 46, 27, 0.75);
  }

  .risk-detail {
    color: #bbb;
  }

  .risk-gauge-time {
    color: #e0e0e0;
  }

  .risk-gauge-details {
    color: #bbb;
  }

  .modal {
    background: #1e1e1e;
    color: #e0e0e0;
  }

  .modal h2 {
    color: #8c9eff;
  }

  .risk-gauge-score {
    fill: currentColor;
  }

  .risk-gauge-label {
    fill: currentColor;
  }

  .risk-gauge-desc {
    opacity: 0.9;
  }

  .condition-row .warm { color: #ff8a65; }
  .condition-row .cool { color: #64b5f6; }
  .condition-row .humid { color: #4fc3f7; }

  .compass-svg-animated circle { stroke: #444; }
  .compass-svg-animated .compass-label { fill: #aaa; }
  .compass-svg-animated line[stroke="#ccc"] { stroke: #555; }

  .plant-card-animated { background: #262626; border-color: #444; }
  .plant-card-chevron { color: #888; }

  .timeline-enhanced { scrollbar-color: #555 #1e1e1e; }
  .timeline-now-dot { background: #64b5f6; }
}

/* ============================================
   Preact Component Styles
   ============================================ */

/* Risk Gauge */
.risk-gauge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
}

.risk-gauge-meter {
  flex-shrink: 0;
  width: 140px;
}

.risk-gauge-svg {
  width: 100%;
  height: auto;
}

.risk-gauge-arc {
  /* animated via JS requestAnimationFrame */
}

.risk-gauge-score {
  font-size: 28px;
  font-weight: 800;
}

.risk-gauge-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-gauge-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  color: #444;
}

.risk-gauge-time {
  font-weight: 600;
  color: #222;
}

.risk-gauge-wind {
  font-size: 0.78rem;
}

.risk-gauge-inv {
  font-size: 0.78rem;
}

.risk-gauge-desc {
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 1px;
}

.risk-gauge-loc-note {
  font-size: 0.7rem;
  color: #888;
  font-style: italic;
  margin-top: 2px;
}

/* Animated Compass */
.compass-wrap {
  display: flex;
  justify-content: center;
}

.compass-svg-animated {
  width: 120px;
  height: 120px;
  display: block;
  overflow: visible;
}

/* Condition highlights */
.condition-row .warm { color: #e65100; font-weight: 600; }
.condition-row .cool { color: #1565c0; font-weight: 600; }
.condition-row .humid { color: #0097a7; font-weight: 600; }
.condition-row .vol-very-high { color: #b71c1c; font-weight: 700; }
.condition-row .vol-high { color: #f44336; font-weight: 600; }
.condition-row .vol-moderate { color: #ff9800; }
.condition-row .vol-low { color: #4caf50; }
.condition-row .vol-very-low { color: #388e3c; }

/* Plant Card Animated */
.plant-card-animated {
  transition: box-shadow 0.2s, transform 0.15s;
}

.plant-card-animated:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.plant-card-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.plant-card-chevron {
  font-size: 0.65rem;
  color: #999;
  transition: transform 0.2s ease;
  display: inline-block;
}

.plant-card-chevron.open {
  transform: rotate(90deg);
}

.plant-card-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.plant-card-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
  animation: slideDown 0.2s ease-out;
}

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

/* Timeline Enhanced */
.timeline-enhanced {
  display: flex;
  overflow-x: auto;
  padding: 0 12px 8px;
  gap: 2px;
  scrollbar-width: thin;
}

.timeline-dot-wrap {
  display: flex;
  justify-content: center;
  padding: 2px 0;
}

.timeline-dot {
  transition: box-shadow 0.3s, transform 0.2s;
}

.timeline-cell:hover .timeline-dot {
  transform: scale(1.3);
}

.timeline-now-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a237e;
  margin: 2px auto 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* ============================================
   Observation Bar (between map and timeline)
   ============================================ */
.obs-bar {
  padding: 8px 12px;
  background: #1a237e;
  color: #fff;
}

.obs-bar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
  margin-bottom: 6px;
}

.obs-bar-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.obs-bar-likert {
  display: flex;
  gap: 4px;
}

.obs-bar-likert-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.obs-bar-likert-btn:hover {
  background: rgba(255,255,255,0.2);
}

.obs-bar-likert-btn.selected {
  background: rgba(255,255,255,0.3);
  border-color: #fff;
}

.obs-bar-likert-val {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.obs-bar-likert-lbl {
  font-size: 0.6rem;
  opacity: 0.8;
  line-height: 1;
  margin-top: 2px;
}

.obs-bar-chars {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.obs-bar-char-btn {
  padding: 3px 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 3px;
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.15s;
}

.obs-bar-char-btn:hover {
  background: rgba(255,255,255,0.2);
}

.obs-bar-char-btn.selected {
  background: rgba(255,255,255,0.3);
  border-color: #fff;
}

.obs-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.obs-bar-loc-btns {
  display: flex;
  gap: 4px;
}

.obs-bar-loc-btn {
  padding: 4px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.15s;
}

.obs-bar-loc-btn:hover {
  background: rgba(255,255,255,0.2);
}

.obs-bar-loc-btn.active {
  background: rgba(255,255,255,0.25);
  border-color: #fff;
}

.obs-bar-loc-label {
  font-size: 0.65rem;
  opacity: 0.7;
}

.obs-bar-submit {
  margin-left: auto;
  padding: 5px 18px;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.obs-bar-submit:hover {
  background: #43a047;
}

.obs-bar-submit:disabled {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  cursor: not-allowed;
}

.obs-bar-flash {
  text-align: center;
  padding: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.obs-bar-flash-ok { color: #81c784; }
.obs-bar-flash-err { color: #ef9a9a; }

/* ============================================
   Observation Logger (sidebar)
   ============================================ */
.obs-panel {
  margin-top: 16px;
}

.obs-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.obs-log-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  color: #1a237e;
  border: 2px solid #1a237e;
  text-align: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.obs-log-btn:hover {
  background: #1a237e;
  color: #fff;
}

.obs-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: #e8eaf6;
  color: #1a237e;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.obs-export-btn {
  font-size: 0.75rem;
  color: #1a237e;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.obs-export-btn:hover {
  color: #283593;
}

/* Observation Modal */
.obs-modal {
  max-width: 420px;
}

.obs-modal h2 {
  margin-bottom: 16px;
  font-size: 1.15rem;
}

.obs-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 16px 0 8px;
}

.obs-section-label:first-of-type {
  margin-top: 0;
}

/* Likert scale */
.obs-likert {
  display: flex;
  gap: 6px;
}

.obs-likert-btn {
  flex: 1;
  padding: 10px 4px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.obs-likert-btn:hover {
  border-color: #1a237e;
  background: #e8eaf6;
}

.obs-likert-btn.selected {
  border-color: #1a237e;
  background: #1a237e;
  color: #fff;
}

.obs-likert-value {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

.obs-likert-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.8;
}

/* Odor character checkboxes */
.obs-characters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.obs-char-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 16px;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}

.obs-char-btn:hover {
  border-color: #1a237e;
}

.obs-char-btn.selected {
  border-color: #1a237e;
  background: #e8eaf6;
  color: #1a237e;
  font-weight: 600;
}

/* Auto-captured context */
.obs-context {
  background: #f5f7ff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.78rem;
  color: #555;
  line-height: 1.6;
}

.obs-context-row {
  display: flex;
  justify-content: space-between;
}

.obs-context-label {
  color: #888;
}

.obs-context-value {
  font-weight: 500;
  color: #333;
}

/* Geo status */
.obs-geo {
  font-size: 0.75rem;
  color: #888;
  margin-top: 8px;
}

.obs-geo-ok { color: #388e3c; }
.obs-geo-pending { color: #f57c00; }
.obs-geo-denied { color: #999; }

/* Submit */
.obs-submit-btn {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  background: #1a237e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.obs-submit-btn:hover {
  background: #283593;
}

.obs-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.obs-success {
  text-align: center;
  padding: 24px 0;
  color: #388e3c;
  font-weight: 600;
  font-size: 1rem;
}

/* Dark mode observation styles */
@media (prefers-color-scheme: dark) {
  .obs-log-btn {
    color: #8c9eff;
    border-color: #5c6bc0;
  }

  .obs-log-btn:hover {
    background: #3949ab;
    color: #fff;
  }

  .obs-badge {
    background: #1a237e;
    color: #8c9eff;
  }

  .obs-export-btn {
    color: #8c9eff;
  }

  .obs-likert-btn {
    border-color: #444;
    background: #262626;
    color: #e0e0e0;
  }

  .obs-likert-btn:hover {
    border-color: #5c6bc0;
    background: #1a237e;
  }

  .obs-likert-btn.selected {
    border-color: #5c6bc0;
    background: #3949ab;
    color: #fff;
  }

  .obs-char-btn {
    border-color: #444;
    background: #262626;
    color: #ccc;
  }

  .obs-char-btn:hover {
    border-color: #5c6bc0;
  }

  .obs-char-btn.selected {
    border-color: #5c6bc0;
    background: #1a237e;
    color: #8c9eff;
  }

  .obs-context {
    background: #262626;
    border-color: #444;
    color: #bbb;
  }

  .obs-context-value {
    color: #e0e0e0;
  }

  .obs-context-label {
    color: #777;
  }

  .obs-submit-btn {
    background: #3949ab;
  }

  .obs-submit-btn:hover {
    background: #5c6bc0;
  }

  .obs-section-label {
    color: #999;
  }
}

/* Mobile observation styles */
@media (max-width: 480px) {
  .obs-likert {
    gap: 4px;
  }

  .obs-likert-btn {
    padding: 8px 2px;
    min-height: 48px;
  }

  .obs-likert-value {
    font-size: 1rem;
  }

  .obs-likert-label {
    font-size: 0.55rem;
  }

  .obs-char-btn {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

/* ─── Comparison View ─────────────────────────────────────── */

.obs-comparison-btn {
  width: 100%;
  margin-top: 6px;
  padding: 8px 12px;
  background: #37474f;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
}
.obs-comparison-btn:hover { background: #455a64; }

.comparison-view {
  margin-top: 12px;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.comparison-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.comparison-nav {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #555;
}
.comparison-nav:hover { background: #f0f0f0; }

.comparison-date {
  font-weight: 600;
  font-size: 0.9rem;
}

.comparison-location {
  text-align: center;
  font-size: 0.72rem;
  color: #888;
  margin-bottom: 8px;
}

.comparison-loading,
.comparison-empty,
.comparison-error {
  text-align: center;
  padding: 16px;
  color: #888;
  font-size: 0.85rem;
}
.comparison-error { color: #c62828; }

.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: fixed;
}

.comparison-table th {
  background: #f5f5f5;
  padding: 4px 3px;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: #555;
  border-bottom: 1px solid #e0e0e0;
}

.comparison-subheader th {
  font-weight: 400;
  font-size: 0.65rem;
  color: #999;
  padding: 2px 3px;
}

.comparison-table td {
  padding: 4px 3px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparison-table tbody tr:hover {
  background: #fafafa;
}

.comparison-hour {
  font-weight: 600;
  color: #333;
  text-align: left !important;
}

.comparison-score {
  font-weight: 700;
  font-size: 0.82rem;
  position: relative;
  white-space: nowrap;
}

.comparison-wind {
  font-size: 0.7rem;
  color: #666;
}

.comparison-rating {
  font-weight: 600;
}

.comparison-likert {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
}
.likert-1 { background: #e8f5e9; color: #2e7d32; }
.likert-2 { background: #fff3e0; color: #ef6c00; }
.likert-3 { background: #fff3e0; color: #e65100; }
.likert-4 { background: #fbe9e7; color: #c62828; }
.likert-5 { background: #ffebee; color: #b71c1c; }
