/* ═══════════════════════════════════════════════════════════
   forecast-grid.css
   Styles for the ForecastGrid component: Current button + 2×7
   AM/PM forecast grid that replaces the day pills row and the
   injected window-selector row.
═══════════════════════════════════════════════════════════ */

/* ── Outer wrapper ─────────────────────────────────────── */

.fg-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.10);
}

/* ── Current / Live METAR button ───────────────────────── */

.fg-current-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
  cursor: pointer;
  transition: background 120ms;
  min-height: 40px;
  text-align: left;
}

.fg-current-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.fg-current-btn:focus-visible {
  outline: 2px solid var(--focus-ring, #45f0d0);
  outline-offset: -2px;
}

.fg-current-btn--sel {
  background: rgba(69, 240, 208, 0.10);
  border-left: 3px solid #45f0d0;
  padding-left: 17px; /* 20px - 3px border = same visual indent */
  border-bottom-color: rgba(69, 240, 208, 0.18);
}

.fg-current-btn--sel .fg-current-label {
  color: #45f0d0;
}

.fg-current-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45f0d0;
  box-shadow: 0 0 6px #45f0d0;
  flex-shrink: 0;
  opacity: 0.35;
}

.fg-current-btn--sel .fg-current-dot {
  opacity: 1;
  animation: fg-pulse 2s ease-in-out infinite;
}

@keyframes fg-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}


.fg-current-label {
  font-family: var(--font-display, 'Chakra Petch', sans-serif);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* ── Grid wrapper ──────────────────────────────────────── */

.fg-grid-wrap {
  padding: 7px 16px 9px;
  /* Must be visible so the ⓘ tooltip can overflow the grid bounds */
  overflow: visible;
}

/* ── Grid layout: 1 label col + 7 day cols ─────────────── */

.fg-grid {
  display: grid;
  grid-template-columns: 20px repeat(7, 1fr);
  gap: 3px;
  overflow: visible;
}

/* ── Top-left spacer ───────────────────────────────────── */

.fg-corner { /* empty */ }

/* ── Day header cells ──────────────────────────────────── */

.fg-day-header {
  text-align: center;
  font-family: var(--font-display, 'Chakra Petch', sans-serif);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  padding-bottom: 3px;
  line-height: 1.25;
}

.fg-day-header--empty {
  color: rgba(255, 255, 255, 0.22);
}

/* ── AM / PM row labels ────────────────────────────────── */

.fg-row-label {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative; /* needed for tooltip positioning */
  overflow: visible;
}

/* ── ⓘ info icon ───────────────────────────────────────── */

.fg-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 8.5px;
  font-style: normal;
  color: rgba(255, 255, 255, 0.45);
  cursor: default;
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

/* Tooltip — shown on hover (desktop) or .fg-info--open (touch) */
.fg-info::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 7px);
  top: 50%;
  transform: translateY(-50%);
  background: #1A2535;
  border: 1px solid rgba(0, 147, 215, 0.35);
  border-radius: 4px;
  padding: 4px 9px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.6875rem;
  font-weight: 400;
  white-space: nowrap;
  color: #96C7E8;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms;
}

.fg-info:hover::after,
.fg-info--open::after {
  opacity: 1;
}

/* ── Forecast cells ────────────────────────────────────── */

.fg-cell {
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 100ms, background 80ms;
  position: relative;
  outline: none;
}

.fg-cell:hover:not(.fg-cell--disabled) {
  filter: brightness(1.3);
}

.fg-cell:focus-visible {
  outline: 2px solid var(--focus-ring, #45f0d0);
  outline-offset: 1px;
}

/* Color variants */
.fg-cell--good  { background: rgba(69, 240, 208, 0.20); border-color: rgba(69, 240, 208, 0.14); }
.fg-cell--mixed { background: rgba(245, 158, 11, 0.20); border-color: rgba(245, 158, 11, 0.14); }
.fg-cell--bad   { background: rgba(255, 128, 128, 0.16); border-color: rgba(255, 128, 128, 0.11); }
.fg-cell--none  { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.06); }

/* Empty / no-data cells — not interactive */
.fg-cell--disabled {
  cursor: default;
  pointer-events: none;
}

/* ── Selected cell: teal outline + brightened fill ─────── */

.fg-cell--sel {
  outline: 2px solid #0093d7;
  outline-offset: 1px;
  z-index: 1;
}

.fg-cell--good.fg-cell--sel  { background: rgba(69, 240, 208, 0.44); border-color: rgba(69, 240, 208, 0.55); }
.fg-cell--mixed.fg-cell--sel { background: rgba(245, 158, 11, 0.44); border-color: rgba(245, 158, 11, 0.50); }
.fg-cell--bad.fg-cell--sel   { background: rgba(255, 128, 128, 0.38); border-color: rgba(255, 128, 128, 0.42); }

/* ── Skeleton loading state ────────────────────────────── */

.fg-skel {
  background: rgba(255, 255, 255, 0.06);
  border-color: transparent;
  cursor: default;
  pointer-events: none;
  animation: fg-shimmer 1.4s ease-in-out infinite;
}

.fg-day-header.fg-skel {
  height: 10px;
  border-radius: 3px;
  margin: 2px 2px 5px;
}

@keyframes fg-shimmer {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   Mobile refinements
   - Taller touch targets (≥36px cells)
   - Larger ⓘ touch area
   - Pulsing dot scales up slightly for visibility
═══════════════════════════════════════════════════════════ */

@media (max-width: 639px) {
  .fg-cell {
    height: 36px;
    border-radius: 5px;
  }

  .fg-current-btn {
    min-height: 46px;
    padding: 11px 20px;
  }

  .fg-current-btn--sel {
    padding-left: 17px;
  }

  .fg-info {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .fg-current-dot {
    width: 8px;
    height: 8px;
  }

  .fg-grid-wrap {
    padding: 7px 12px 10px;
  }
}

/* Touch devices: remove hover brightness since it gets stuck on tap */
@media (hover: none) {
  .fg-cell:hover:not(.fg-cell--disabled) {
    filter: none;
  }
  .fg-current-btn:hover {
    background: transparent;
  }
  .fg-current-btn--sel:hover {
    background: rgba(0, 147, 215, 0.08);
  }
}
