/* SunCast (internal: shootcast) — best-light timing modal
 * Pairs with shootcast.js and frontend/vendor/{leaflet,suncalc}/.
 * Class names keep the shootcast-* naming (the SunCast rename is user-facing
 * copy only). Mobile breakpoint: 768px, matches order-wizard. */

/* --- open button on Step 4 --- */

.shootcast-open-button {
  width: 100%;
  padding: 28px 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-warm) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shootcast-open-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.shootcast-open-button-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shootcast-open-button-subtitle {
  font-size: 0.88rem;
  font-weight: 400;
  opacity: 0.95;
  line-height: 1.4;
}

.shootcast-selected-summary {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  display: none;
}

.shootcast-selected-summary.visible { display: block; }

/* --- modal scaffolding --- */

.shootcast-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: shootcastFadeIn 0.2s ease;
}

.shootcast-modal.open { display: flex; }

@keyframes shootcastFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.shootcast-panel {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 1100px;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shootcast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.shootcast-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.shootcast-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
}

.shootcast-close:hover,
.shootcast-close:focus-visible {
  background: var(--gray-100);
  color: var(--gray-900);
  outline: none;
}

.shootcast-close:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.shootcast-body {
  overflow-y: auto;
  padding: 18px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.shootcast-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.shootcast-footer-status {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.shootcast-footer-status.ready {
  color: var(--success);
  font-weight: 700;
}

/* --- best-light readout banner (informational; neutral styling only) --- */

.shootcast-score-banner {
  padding: 14px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.shootcast-score-headline {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.shootcast-score-subline {
  font-size: 0.88rem;
  font-weight: 500;
  margin-top: 3px;
}

.shootcast-score-banner.none {
  background: var(--gray-50);
}
.shootcast-score-banner.none .shootcast-score-headline { color: var(--gray-900); }
.shootcast-score-banner.none .shootcast-score-subline  { color: var(--text-muted); }

/* --- day-chip strip (day name + date; tap to select) --- */

.shootcast-weather-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.shootcast-weather-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.shootcast-weather-card {
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
}

.shootcast-weather-card:hover,
.shootcast-weather-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.shootcast-weather-card.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

.shootcast-weather-card-day {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.shootcast-weather-card-date {
  font-size: 0.9rem;
  font-weight: 700;
}

.shootcast-weather-unavailable {
  padding: 14px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

/* --- main split: map + time chips --- */

.shootcast-main-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.shootcast-map-col { display: flex; flex-direction: column; gap: 8px; }

.shootcast-map-container {
  position: relative;
  width: 100%;
  height: 260px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.shootcast-map-container img { width: auto; max-width: none; }

#shootcast-map {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* map is locked (no pan/zoom); keep the grab cursor off */
  cursor: default;
}

.shootcast-sun-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  width: 100%;
  height: 100%;
}

/* Draggable camera marker. The img wrapper is Leaflet's marker element. */
.shootcast-camera-marker {
  width: 42px;
  height: 42px;
  background: white;
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shootcast-camera-marker:active { cursor: grabbing; }
.shootcast-camera-marker:hover { transform: scale(1.05); }

.shootcast-camera-marker.pulse {
  animation: shootcastCameraPulse 1.6s ease-in-out infinite;
}

@keyframes shootcastCameraPulse {
  0%, 100% { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  50%      { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25), 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.shootcast-sun-instructions {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0 6px;
  line-height: 1.45;
}

.shootcast-sun-instructions strong {
  color: var(--accent);
  font-weight: 700;
}

/* --- time chips column --- */

.shootcast-time-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shootcast-time-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.shootcast-modal-time-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.shootcast-modal-time-grid .time-slot {
  padding: 10px 6px;
  font-size: 0.86rem;
}

.shootcast-best-time-nudge {
  margin-top: 2px;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px dashed #fde68a;
  border-radius: var(--radius-md);
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  transition: var(--transition);
  text-align: left;
}

/* Respect the HTML `hidden` attribute — the `.shootcast-best-time-nudge`
   class rule above has `display: flex` which has the same CSS specificity
   as the browser's default `[hidden] { display: none }` and wins the
   cascade because author stylesheets come later. Without this, setting
   `nudge.hidden = true` in JS visibly hides nothing, and the handler's
   `if (nudge.hidden) return` early-returns on click — clicks silently drop.
   Specificity (0,2,0) — class + attribute — beats the bare class. */
.shootcast-best-time-nudge[hidden] { display: none; }

.shootcast-best-time-nudge:hover,
.shootcast-best-time-nudge:focus-visible {
  background: #fef3c7;
  border-color: #fcd34d;
  outline: none;
}

/* Confirmation variant: shown when the customer's selected time already is
   the peak hour for this camera angle. Green + non-interactive, so the chip
   doesn't flicker in/out as the peak rounds across the selected time. */
.shootcast-best-time-nudge.is-confirmed {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  cursor: default;
}

.shootcast-best-time-nudge.is-confirmed:hover,
.shootcast-best-time-nudge.is-confirmed:focus-visible {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.shootcast-best-time-nudge .nudge-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* --- responsive --- */

@media (max-width: 768px) {
  .shootcast-modal { padding: 0; }

  .shootcast-panel {
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .shootcast-body {
    padding: 14px 16px 16px;
    gap: 14px;
  }

  .shootcast-header { padding: 12px 16px; }
  .shootcast-footer { padding: 12px 16px; }
  .shootcast-score-banner { padding: 12px 16px; }

  .shootcast-weather-strip {
    grid-template-columns: repeat(7, 100px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .shootcast-weather-card { scroll-snap-align: start; min-height: 60px; }

  .shootcast-main-split {
    grid-template-columns: 1fr;
  }

  .shootcast-map-container { height: 240px; }
}
