/* Small supplemental rules only — the bulk of styling now comes from the legacy
   app's own theme (colors/main.css + style.css), loaded directly in index.html
   for exact visual parity. This file just covers gaps for our new UI states. */

body { padding-bottom: 70px; } /* clear the fixed .navbar */

#titlebar { padding-top: 15px; } /* park/spot page title (renderDetail) */

#authstatus { float: right; font-size: 0.85em; padding-top: 6px; }
#authstatus a { cursor: pointer; }

.type-toggle { list-style: none; margin: 5px 0 15px; padding: 0; overflow: hidden; }
.type-toggle li { margin: 5px; float: left; font-size: 1.2em; }
.type-toggle li.active { border-bottom: 1px solid black; }
.type-toggle a { cursor: pointer; }

/* Placeholder for missing/broken CloudFront images (seed data has no real uploads yet). */
img.thumb-fallback { background: #dfe7ee; min-height: 140px; object-fit: cover; }

.error { color: #d33; font-size: 0.9rem; }
.muted { color: #888; }

form.stack { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
form.stack input {
  border: 1px solid #ccc;
  padding: 8px;
  border-radius: 4px;
}

.event-item { padding: 10px 0; border-bottom: 1px solid #eee; }
.event-item .when { color: #1E90FF; font-size: 0.85rem; }

#map { width: 100%; height: 100%; min-height: 300px; } /* #mapWrap gets its size from fitMap() */
#mapWrap { height: 500px; }
/* Spots/Parks + Near Me. app.js renderMap hands them to Google as a TOP_RIGHT map control (next
   to the fullscreen button), styled exactly like map.cfm's inline styles. Before the map loads
   they sit top-right of #mapWrap. */
.map-controls { position: absolute; top: 0; right: 0; z-index: 5; }
.map-controls.in-map { position: static; }
#mapWrap .map-controls button {
  background-color: #fff;
  border: 2px solid #fff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  color: rgb(25,25,25);
  cursor: pointer;
  font-family: Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 38px;
  margin: 8px 5px 0 0;
  padding: 0 5px;
  text-align: center;
}
#mapWrap .map-controls #mapTypeToggle { margin-left: 50px; }
#mapWrap { position: relative; }

.nearby-widget { margin-bottom: 25px; }
.nearby-list { list-style: none; margin: 10px 0 0; padding: 0; }
.nearby-list li { cursor: pointer; }
.nearby-list .widget-content { padding: 10px 0; }
.nearby-list .widget-thumb { float: left; width: 140px; height: 100px; margin-right: 15px; background: #dfe7ee; }
.nearby-list .widget-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nearby-list .widget-text { min-height: 100px; overflow: hidden; }
.nearby-list .widget-text h5 { margin: 2px 0 5px; }
.nearby-list .widget-text .star-rating { margin-top: 5px; }

#addspotmap { width: 100%; height: 260px; }

/* Keep the three card action icons in one vertical column at the same right edge. results.cfm
   forces like/plus to right:20px inline (share's own CSS already sits there); without that the
   theme's like-icon and our plus-icon (right:30px) drift, so the share icon looks misaligned. */
.listing-item .like-icon,
.listing-item .plus-icon,
.listing-item .share-icon {
  right: 20px !important;
}

/* .share-icon isn't part of the shared theme — results.cfm defines it inline, replicated here verbatim. */
.share-icon {
  color: #fff;
  font-size: 19px;
  position: absolute;
  z-index: 101;
  right: 20px;
  bottom: 130px;
  cursor: pointer;
  background-color: rgba(24,24,24,0.4);
  display: block;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  transition: all 0.4s;
}
.share-icon:before {
  font-family: "FontAwesome";
  position: absolute;
  right: 0;
  left: 0;
  text-align: center;
  top: 9px;
  content: "\f064";
  transform: scale(0.95);
}

/* .plus-icon (roadtrip) isn't part of the shared theme either — same source as share-icon. */
.plus-icon {
  color: #fff;
  font-size: 19px;
  position: absolute;
  z-index: 101;
  right: 20px;
  bottom: 80px;
  cursor: pointer;
  background-color: rgba(24,24,24,0.4);
  display: block;
  height: 44px;
  width: 44px;
  border-radius: 50%;
  transition: all 0.4s;
}
.plus-icon:before {
  transition: opacity 0.3s, transform 0.4s cubic-bezier(.0,-.41,.19,2.5);
  font-family: "FontAwesome";
  position: absolute;
  right: 0;
  left: 0;
  text-align: center;
  top: 9px;
  content: "\f018";
  transform: scale(0.95);
}



/* "Get the iOS app" header (app.js initAppBanner), styled like Safari's Smart App Banner. */
#appbanner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f2f2f2; border-bottom: 1px solid #ccc; font-size: 0.9em; }
#appbanner img { border-radius: 9px; flex: none; }
#appbanner .appbanner-text { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
#appbanner .appbanner-get { background: #1E90FF; color: #fff; border-radius: 14px; padding: 4px 16px; font-weight: bold; text-decoration: none; }
#appbanner .appbanner-close { color: #888; font-size: 1.6em; line-height: 1; cursor: pointer; padding: 0 4px; text-decoration: none; }

/* Comments on the park/spot detail screen (app.js renderComments). */
#commentsPanel { margin-top: 25px; }
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.comment-form textarea { width: 100%; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; padding: 8px; font: inherit; resize: vertical; }
.comment-form .error:empty { display: none; }
.comment-form button { align-self: flex-start; }
.comment-list { list-style: none; margin: 0 0 15px; padding: 0; }
.comment-list li { padding: 10px 0; border-bottom: 1px solid #eee; }
.comment-meta { font-size: 0.9em; margin-bottom: 4px; }
.comment-hide { float: right; color: #d33; cursor: pointer; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Park/spot page media (app.js renderDetail): first photo, map, other photos, with a small gap. */
.detail-media > * { display: block; width: 100%; border: 0; margin: 0 0 8px; }

/* Roadtrip (app.js renderRoadtrip), laid out like roadtrip.cfm: label, then its box, stacked. */
.roadtrip-form { padding: 15px; text-align: left; }
.roadtrip-form b { display: block; margin: 10px 0 4px; }
.roadtrip-form select { display: block; width: 100%; max-width: 100%; border: 1px solid black; margin-bottom: 6px; }
.roadtrip-form select:not([multiple]) { -webkit-appearance: button; }
.roadtrip-form select[multiple] { min-height: 100px; }
.roadtrip-form #rsubmit { margin-top: 10px; }
#directions-panel { text-align: left; }

/* Loading spinner (index.html #loadspinner): a spinning ring fixed in the centre of the screen.
   It doesn't block taps, and it waits 150ms before appearing so quick requests don't flash it. */
#loadspinner {
  position: fixed; top: 50%; left: 50%; z-index: 1000;
  box-sizing: border-box; width: 64px; height: 64px; margin: -32px 0 0 -32px; padding: 12px;
  background: rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  pointer-events: none; animation: spinner-in 0s 0.15s both;
}
#loadspinner .spin {
  box-sizing: border-box; width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid #dfe7ee; border-top-color: #1E90FF;
  animation: spinner-turn 0.8s linear infinite;
}
@keyframes spinner-turn { to { transform: rotate(360deg); } }
@keyframes spinner-in { from { visibility: hidden; } to { visibility: visible; } }
