/* PNW Mushroom Conditions
   Consolidated stylesheet: dashboard layout + modal styles */

/* ---------- Base ---------- */

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}

input,
button {
  font: inherit;
}


/* ---------- Main page shell ---------- */

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  background-color: #9ac2a3;
}


/* ---------- Header ---------- */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.app-header h1 {
  margin: 0;
}

.app-header p {
  margin: 4px 0 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.chanterelle-sprite {
  width: 85px;
  height: 85px;
  background-image: url("./Chanterelles.png");
  background-repeat: no-repeat;

  /* Sprite sheet: 3 columns × 2 rows */
  background-size: 300% 200%;

  flex-shrink: 0;
}


/* ---------- Location controls ---------- */

.location-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
}

.location-input {
  display: grid;
  gap: 6px;
}

.location-input input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
}

#check-conditions,
.about-model-button {
  min-height: 44px;
  padding: 10px 16px;
  cursor: pointer;
  background-color: #eccc63;
  border-width: 1px;
}

.coordinate-target {
  display: flex;
  align-items: center;
  justify-content: center;
}

.target-dot {
  width: 14px;
  height: 14px;
  background: red;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 2px red;
}

.preview-coordinate-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-dot {
  width: 12px;
  height: 12px;
  background: white;
  border: 3px solid #4f6f8f;
  border-radius: 50%;
  box-shadow: 0 0 0 1px white;
}

.geology-zoom-message {
  background: white;
  color: black;
  padding: 8px 12px;
  border: 2px solid red;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  z-index: 10000;
}

/* Desktop */
.about-model-mobile {
  display: none;
}

/* Mobile */
@media (max-width: 800px) {

  .about-model-desktop {
    display: none;
  }

  .about-model-mobile {
    display: block;
    width: 100%;
    margin: 16px 0 24px;
  }

  .about-model-mobile .about-model-button {
    width: 100%;
    padding: 14px 18px;
    background-color: #eccc63
  }
}


/* ---------- Dashboard ---------- */

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  gap: 20px;
  align-items: start;
}

.conditions-column {
  min-width: 0;
}

.overall-card,
.metric-card,
.map-card {
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #f1f1f1; /* Original mockup value was #fff */
}


/* ---------- Overall score ---------- */

.overall-card {
  padding: 20px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.overall-label {
  margin: 0 0 4px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.overall-score {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1;
}

.condition-label {
  font-size: 1.2rem;
  font-weight: 700;
}


/* ---------- Metric cards ---------- */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 16px 18px;
  min-width: 0;
}

.metric-card.wide {
  grid-column: 1 / -1;
}

.metric-card h2 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.metric-card p {
  margin: 7px 0;
  line-height: 1.35;
}

.metric-value {
  float: right;
  margin-left: 12px;
  font-weight: 600;
}

.veg-type {
  text-align: left;
  font-weight: 600;
}


/* ---------- Expandable metric details ---------- */

details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.metric-details {
  margin-top: 9px;
}


/* ---------- Map ---------- */

.map-card {
  padding: 16px;
  position: sticky;
  top: 16px;
}

.map-card h2 {
  margin-top: 0;
}

#map {
  width: 100%;
  height: 520px;
  border-radius: 9px;
  overflow: hidden;
}

.map-coordinates {
  margin: 12px 0 0;
  font-size: 0.9rem;
  opacity: 0.7;
}


/* ---------- About-the-model modal ---------- */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  position: relative;
  background: white;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  margin: 8vh auto;
  padding: 30px;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  border: none;
  background: none;
  font-size: 28px;
  cursor: pointer;
}

.modal-content h2 {
  margin-top: 0;
}

.modal-content h3 {
  margin-top: 28px;
  margin-bottom: 8px;
}

.modal-content h3 small {
  font-size: 0.8em;
  font-weight: normal;
}

.modal-content p {
  line-height: 1.55;
}

.modal-content hr {
  margin: 30px 0;
}

.bibliography {
  padding-left: 22px;
}

.bibliography li {
  margin-bottom: 18px;
  line-height: 1.5;
}


/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .page-shell {
    padding: 16px;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .map-card {
    position: static;
    order: -1;
  }

  #map {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .app-header {
    align-items: flex-start;
  }

  .location-controls {
    grid-template-columns: 1fr;
  }

  #check-conditions {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card.wide {
    grid-column: auto;
  }

  .overall-card {
    align-items: flex-start;
  }

  .modal-content {
    max-width: calc(100% - 24px);
    margin: 24px auto;
    padding: 24px;
  }

  .chanterelle-sprite {
    width: 70px;
    height: 70px;
  }
}

/* ---------- Forecast Placeholder ---------- */

.forecast-placeholder {
  max-width: 1000px;
  margin: 20px auto 0;
  padding: 18px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #9ac2a3;
}

.forecast-header h2 {
  margin: 0;
}

.forecast-header p {
  margin: 4px 0 16px;
  opacity: 0.7;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 8px;
}

.forecast-day {
  min-height: 95px;
  padding: 10px 6px;
  border: 1px solid #ccc;
  border-radius: 9px;
  background: #f5f5f2;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;

  text-align: center;
}

.forecast-score {
  font-size: 1.8rem;
  font-weight: 700;
}


/* Phone */
@media (max-width: 800px) {
  .forecast-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 6px;
  }

  .forecast-day {
    min-width: 105px;
    flex: 0 0 auto;
  }
}
