/* ========================
   LAYOUT
   ======================== */

#plan-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 56px);
  min-height: 0;
}

#map {
  flex: 1;
  height: 100%;
}

#sidebar {
  width: 300px;
  min-width: 300px;
  background: #fff;
  border-left: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
}

/* ========================
   PARK HEADER (always visible)
   ======================== */

.sidebar-park-header {
  padding: 10px 12px;
  border-bottom: 1px solid #dee2e6;
  flex-shrink: 0;
}

/* ========================
   PANELS (setup / planning)
   ======================== */

#setup-panel,
#plan-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0 12px;
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid #dee2e6;
  flex-shrink: 0;
  background: #fff;
}

/* ========================
   SIDEBAR SECTIONS
   ======================== */

.sidebar-section {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-section:last-child {
  border-bottom: none;
}

.sidebar-label {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin-bottom: 6px;
}

.sidebar-loading {
  padding: 16px 0;
  color: #888;
  font-size: 12px;
}

/* ========================
   TIME INPUTS
   ======================== */

.time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.time-label {
  font-size: 11px;
  color: #666;
  width: 18px;
  flex-shrink: 0;
}

/* ========================
   RIDES SECTION
   ======================== */

.rides-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.rides-header .sidebar-label {
  margin-bottom: 0;
}

.bulk-btns {
  display: flex;
  gap: 3px;
}

/* ========================
   RIDE ROWS
   ======================== */

.ride-row {
  padding: 5px 0;
  border-bottom: 1px solid #f8f8f8;
  cursor: pointer;
}

.ride-row:last-child {
  border-bottom: none;
}

.ride-row:hover {
  background: #fafafa;
  border-radius: 3px;
}

.ride-row-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}

.ride-type-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ride-name-text {
  flex: 1;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ride-val-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.4;
}

.ride-val-badge.val-zero  { background: #f0f0f0; color: #bbb; }
.ride-val-badge.val-low   { background: #fff3cd; color: #856404; }
.ride-val-badge.val-med   { background: #ffe0b2; color: #e65100; }
.ride-val-badge.val-high  { background: #c8e6c9; color: #2e7d32; }

.ride-range {
  width: 100%;
  height: 3px;
  cursor: pointer;
  accent-color: #333;
}

/* ========================
   MEALS & SHOWS
   ======================== */

.events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.events-header .sidebar-label {
  margin-bottom: 0;
}

.event-entry {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 5px;
}

.event-entry input[type="time"] {
  width: 78px;
  padding: 2px 4px;
  font-size: 11px;
  flex-shrink: 0;
}

.event-entry .event-name-input {
  flex: 1;
  min-width: 0;
  padding: 2px 4px;
  font-size: 11px;
}

.event-entry .event-dur-input {
  width: 42px;
  padding: 2px 4px;
  font-size: 11px;
  flex-shrink: 0;
}

.event-remove {
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
  color: #dc3545;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
}

.event-remove:hover {
  opacity: 1;
}

/* ========================
   SMALL BUTTON
   ======================== */

.btn-xs {
  padding: 2px 7px;
  font-size: 10px;
  border-radius: 3px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  color: #555;
  line-height: 1.4;
}

.btn-xs:hover {
  background: #f5f5f5;
  border-color: #999;
}

/* ========================
   MAP MARKERS
   ======================== */

.park-marker-wrapper {
  position: relative;
  width: 12px;
  height: 12px;
}

.marker-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  transition: transform 0.1s;
}

.marker-dot:hover {
  transform: scale(1.5);
}

.marker-dot.completed {
  background: #999 !important;
  opacity: 0.4 !important;
  border-color: rgba(255, 255, 255, 0.4);
}

.marker-label {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  text-shadow:
    0 0 4px rgba(0, 0, 0, 1),
    0 0 4px rgba(0, 0, 0, 1),
    1px 1px 0 rgba(0, 0, 0, 1);
  pointer-events: none;
  line-height: 1;
}

/* Hide labels when zoomed out */
#map.hide-labels .marker-label {
  display: none;
}

/* Layer visibility toggles */
#map.hide-ATTRACTION .marker-type-ATTRACTION { display: none; }
#map.hide-RESTAURANT .marker-type-RESTAURANT { display: none; }
#map.hide-SHOW       .marker-type-SHOW       { display: none; }

/* Toggle control panel */
.map-toggle-panel {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  padding: 6px 8px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  border: none;
  background: none;
  color: #222;
  white-space: nowrap;
  text-align: left;
  transition: opacity 0.15s;
}

.map-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.map-toggle-btn.toggled-off {
  opacity: 0.35;
}

.toggle-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Leaflet tooltip override */
.leaflet-tooltip.park-tooltip {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  padding: 3px 8px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

.leaflet-tooltip.park-tooltip::before {
  display: none;
}

/* ========================
   POPUP
   ======================== */

.attraction-popup {
  min-width: 150px;
  font-size: 12px;
  line-height: 1.5;
}

.popup-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
}

.popup-meta {
  color: #555;
  margin-bottom: 8px;
}

.popup-complete-btn {
  width: 100%;
  padding: 4px 10px;
  font-size: 12px;
  margin-top: 6px;
}

/* ========================
   PLANNING MODE
   ======================== */

.clock-section {
  text-align: center;
  padding-top: 14px;
  padding-bottom: 14px;
}

.virtual-clock {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #111;
  line-height: 1;
  margin-bottom: 5px;
}

.clock-activity {
  font-size: 11px;
  color: #888;
  min-height: 16px;
}

.next-card {
  background: #f8f9fa;
  border-left: 3px solid #28a745;
  border-radius: 0 4px 4px 0;
  padding: 7px 10px;
  font-size: 12px;
}

.next-card .next-name {
  font-weight: 600;
}

.next-card .next-meta {
  color: #888;
  font-size: 11px;
  margin-top: 1px;
}

/* ========================
   ITINERARY
   ======================== */

.itinerary-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 11px;
}

.itinerary-item:last-child {
  border-bottom: none;
}

.itinerary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.itinerary-time {
  color: #888;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

.itinerary-name {
  flex: 1;
  line-height: 1.35;
}

.itinerary-dur {
  color: #bbb;
  flex-shrink: 0;
  font-size: 10px;
  margin-top: 1px;
}
