/* ==========================================================================
   NIDA WIND DASHBOARD - 1.5x LARGER ARROW STYLESHEET
   ========================================================================== */

.nwd-dashboard {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}

.nwd-dashboard * {
  box-sizing: border-box;
}

.nwd-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nwd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.nwd-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.nwd-badge--live {
  background-color: #ef4444;
  color: #ffffff;
}

.nwd-badge--forecast {
  background-color: #0284c7;
  color: #ffffff;
}

/* ── Live Split Grid (Jūra vs. Marios) ──────────────────────────────────── */
.nwd-split-grid {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 8px;
}

.nwd-split-col {
  flex: 1;
  min-width: 0;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nwd-col-title strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.nwd-col-sub {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 4px;
  margin-bottom: 6px;
  line-height: 1.35;
}

.nwd-col-sub span {
  display: block;
}

/* Standalone Centered Direction Arrow Row (1.5x Size) */
.nwd-arrow-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 4px 0;
  height: 60px; /* Fixed height container to cleanly fit taller arrow */
}

.nwd-live-arrow {
  display: inline-block;
  font-size: 57px; /* 1.5x larger than 38px */
  font-weight: 900;
  line-height: 1;
  color: #0284c7;
  font-stretch: condensed; /* Keeps width controlled while preserving tall height */
}

.nwd-main-stat {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 12px;
}

.nwd-value {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.nwd-value .nwd-sub {
  font-size: 24px;
  font-weight: 600;
  color: #475569;
}

.nwd-unit {
  font-size: 16px;
  font-weight: 500;
  color: #64748b;
}

/* ── Tap-to-expand station value (Jūra / Ecowitt) ───────────────────────── */
.nwd-value--tap {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  -webkit-tap-highlight-color: transparent;
  border-radius: 6px;
}

.nwd-value--tap:disabled {
  cursor: default;
}

.nwd-value--tap:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 3px;
}

.nwd-chart-hint {
  display: inline-block;
  margin-left: 5px;
  font-size: 13px;
  color: #94a3b8;
}

.nwd-chart-hint::after {
  content: '⌄';
}

/* ── Station history bottom sheet / modal ────────────────────────────────
   Mobile: slides up from the bottom of the screen.
   Wider screens (≥640px): centered modal card instead. ────────────────── */
.nwd-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nwd-sheet-backdrop.nwd-open {
  opacity: 1;
  visibility: visible;
}

.nwd-history-panel.nwd-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9991;
  background: #ffffff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.25);
  padding: 10px 18px 24px;
  max-height: 75vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(.32,.72,0,1);
  visibility: hidden;
}

.nwd-history-panel.nwd-sheet.nwd-open {
  transform: translateY(0);
  visibility: visible;
}

.nwd-sheet-handle {
  width: 36px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 0 auto 14px;
}

.nwd-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.nwd-sheet-header span {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.nwd-sheet-close {
  background: #f1f5f9;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .nwd-history-panel.nwd-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 90vw;
    max-width: 860px; /* mirrors .nwd-dashboard's 900px frame minus its own side padding */
    border-radius: 16px;
    padding: 22px 28px 28px;
    transform: translate(-50%, -46%) scale(0.96);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
  }
  .nwd-history-panel.nwd-sheet.nwd-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  .nwd-sheet-handle { display: none; }
  .nwd-sheet-header span { font-size: 18px; }
}

.nwd-history-chart {
  background: #f9fafb;
  border: 1px solid #eef2f6;
  border-radius: 10px;
  padding: 12px 10px 8px;
}

.nwd-history-status {
  font-size: 13px;
  color: #94a3b8;
  text-align: center;
  padding: 40px 0;
}

.nwd-history-svg {
  display: block;
  width: 100%;
  height: auto;
}

.nwd-hist-line-wind {
  fill: none;
  stroke: #0284c7;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.nwd-hist-line-gust {
  fill: none;
  stroke: #f59e0b;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.nwd-hist-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.nwd-hist-axis-label {
  font-size: 12px;
  fill: #94a3b8;
}

.nwd-hist-arrow {
  font-size: 14px;
  fill: #64748b;
}

.nwd-hist-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}

.nwd-hist-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nwd-hist-legend i {
  display: inline-block;
  width: 12px;
  height: 2px;
  border-radius: 1px;
}

.nwd-hist-legend .nwd-dot-wind { background: #0284c7; }
.nwd-hist-legend .nwd-dot-gust { background: #f59e0b; }

.nwd-sub-stats {
  display: flex;
  gap: 12px;
  font-size: 15px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
  margin-bottom: 8px;
}

.nwd-sub-item {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.nwd-sub-label {
  color: #64748b;
  font-weight: 500;
}

.nwd-sub-item strong {
  color: #0f172a;
  font-weight: 700;
}

.nwd-col-footer {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  margin-top: 4px;
}

/* ── Forecast Tabs ──────────────────────────────────────────────────────── */
.nwd-day-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px 0;
  border-bottom: 2px solid #e5e7eb;
}

.nwd-day-tab {
  background: #f3f4f6;
  border: none;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s ease;
  outline: none;
}

.nwd-day-tab:hover {
  color: #111827;
  background: #e5e7eb;
}

.nwd-day-tab--active {
  color: #0284c7;
  background: #e0f2fe;
  border-bottom: 3px solid #0284c7;
}

.nwd-day-panel { display: none; }
.nwd-day-panel--active { display: block; }

/* ── Clean Table Layout ─────────────────────────────────────────────────── */
.nwd-wg-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
}

.nwd-wg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: center;
}

.nwd-wg-table th, 
.nwd-wg-table td {
  padding: 6px 3px;
  white-space: nowrap;
  vertical-align: middle;
}

.nwd-wg-table th {
  text-align: left;
  font-weight: 600;
  color: #475569;
  min-width: 120px;
}

.nwd-bold {
  font-weight: 700 !important;
}

.nwd-regular {
  font-weight: 400 !important;
}

.nwd-wg-tr--h td {
  font-weight: 700;
  color: #0f172a;
}

.nwd-wg-box {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 4px;
  color: #000000;
  min-width: 28px;
}

.nwd-wg-arr {
  display: inline-block;
  font-weight: bold;
  font-size: 14px;
  color: #000000;
}

.nwd-wg-cloud {
  display: inline-block;
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: #334155;
}

.nwd-wg-wet {
  color: #0284c7;
}

/* ── Tall Vertical Star Rating Stack ────────────────────────────────────── */
.nwd-stars-td {
  height: 48px;
}

.nwd-stars-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 1px;
}

.nwd-star {
  font-size: 11px;
  line-height: 10px;
}

.nwd-star--normal {
  color: #f59e0b;
}

.nwd-star--pro {
  color: #ef4444;
}

/* ── Footers & Maps ─────────────────────────────────────────────────────── */
.nwd-map-wrap {
  position: relative;
  width: 100%;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
}

.nwd-map-img {
  width: 100%;
  display: none;
}

.nwd-map-img--active {
  display: block;
}

.nwd-map-time {
  font-weight: 700;
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

.nwd-map-slider {
  width: 100%;
  margin-top: 4px;
}

.nwd-footer {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.nwd-footer a {
  color: #64748b;
  text-decoration: underline;
}

/* ── Mobile Responsive Overrides ────────────────────────────────────────── */
@media (max-width: 600px) {
  .nwd-card {
    padding: 10px;
  }

  .nwd-split-grid {
    gap: 8px;
  }

  .nwd-split-col {
    padding: 10px 8px;
  }

  .nwd-col-title strong {
    font-size: 15px;
  }

  .nwd-col-sub {
    font-size: 10px;
    margin-bottom: 4px;
  }

  .nwd-arrow-row {
    margin: 2px 0;
    height: 52px;
  }

  .nwd-live-arrow {
    font-size: 51px; /* 1.5x larger than 34px */
  }

  .nwd-main-stat {
    margin-bottom: 8px;
  }

  .nwd-value {
    font-size: 28px;
  }

  .nwd-value .nwd-sub {
    font-size: 18px;
  }

  .nwd-unit {
    font-size: 13px;
  }

  .nwd-sub-stats {
    flex-direction: column;
    gap: 3px;
    font-size: 15px;
    padding-top: 6px;
  }
}
/* ── Pull-to-refresh indicator (iOS home-screen bookmark) ───────────────── */
.nwd-ptr-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: 6px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity 0.15s ease;
  z-index: 9999;
  pointer-events: none;
}

.nwd-ptr-arrow {
  display: inline-block;
  font-size: 16px;
  line-height: 1;
  color: #0284c7;
}

.nwd-ptr-indicator.nwd-ptr-ready .nwd-ptr-arrow {
  color: #16a34a;
}

.nwd-ptr-indicator.nwd-ptr-spinning .nwd-ptr-arrow {
  animation: nwd-ptr-spin 0.6s linear infinite;
  color: #0284c7;
}

@keyframes nwd-ptr-spin {
  to { transform: rotate(360deg); }
}
