/* Galway Port Weather Dashboard — Styles
   =========================================== */

:root {
  --color-bg: #F3F7F9;
  --color-white: #FFFFFF;
  --color-title: #1577A0;
  --color-link: #2AABBC;
  --color-text: #1A1A2E;
  --color-text-muted: #7A8A9A;
  --color-border: #E0EBF1;
  --color-icon-bg: #DCF0F8;
  --color-icon: #4BA8C6;
  --color-chart: #5AB5D5;
  --color-chart-fill: rgba(90, 181, 213, 0.18);
  --color-compass-needle: #2AB86E;
  --radius-card: 8px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* HEADER */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  padding: 48px 20px 40px;
}

.site-header__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-title);
  line-height: 1.2;
  margin-bottom: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-link);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* TIMESTAMP DISPLAY */
.timestamp-display {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #7A8A9A;
  padding: 8px 16px;
  background: #F8FAFB;
  border-radius: 8px;
  border: 1px solid #E8F0F4;
  white-space: nowrap;
}

/* LAYOUT */
.dashboard {
  padding: 0 0 40px;
}

.section {
  margin-bottom: 0;
  padding: 0px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section__header {
  padding: 20px 0px 16px 0px;
  width: 100%;
  max-width: 1560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}

/* ── Date-Time Picker ────────────────────────────────────── */
:root {
  --dtp-radius-input: 8px;
  --dtp-radius-pill: 999px;
  --dtp-radius-panel: 12px;
  --dtp-shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.12);
  --dtp-sel-bg: #1A1A2E;
  --dtp-sel-text: #FFFFFF;
  --dtp-today-ring: #2AABBC;
}

.dtp-wrap {
  position: relative;
  display: inline-block;
}

/* Input trigger */
.dtp-input {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--dtp-radius-input);
  padding: 6px 12px;
  background: var(--color-white);
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s;
  white-space: nowrap;
}

.dtp-input:hover {
  border-color: #2AABBC;
}

.dtp-input:focus {
  outline: none;
  border-color: #2AABBC;
  box-shadow: 0 0 0 2px rgba(42, 171, 188, 0.18);
}

.dtp-input svg {
  flex-shrink: 0;
}

/* Panel (desktop dropdown) */
.dtp-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 2000;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--dtp-radius-panel);
  box-shadow: var(--dtp-shadow-panel);
  padding: 20px;
  width: 292px;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dtp-panel.dtp-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Mobile overlay */
.dtp-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(26, 26, 46, 0.45);
  backdrop-filter: blur(2px);
  align-items: flex-end;
}

.dtp-overlay.dtp-open {
  display: flex;
}

.dtp-sheet {
  background: var(--color-white);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: dtp-slide-up 0.25s ease;
}

@keyframes dtp-slide-up {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.dtp-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.dtp-sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.dtp-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.dtp-sheet-body {
  overflow-y: auto;
  flex: 1;
  padding: 20px;
}

.dtp-sheet-footer {
  padding: 12px 20px 20px;
  flex-shrink: 0;
  border-top: 1px solid var(--color-border);
}

.dtp-apply-btn {
  width: 100%;
  height: 48px;
  border-radius: var(--dtp-radius-pill);
  border: none;
  background: var(--dtp-sel-bg);
  color: var(--dtp-sel-text);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.dtp-apply-btn:hover {
  background: #2d2d4a;
}

/* Calendar */
.dtp-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.dtp-month-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.dtp-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.12s, border-color 0.12s;
  padding: 0;
}

.dtp-nav-btn:hover {
  background: var(--color-bg);
  border-color: #2AABBC;
  color: #2AABBC;
}

.dtp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.dtp-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 4px 0;
}

.dtp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.dtp-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text);
  border: none;
  background: none;
  font-family: 'Montserrat', sans-serif;
  transition: background 0.12s, color 0.12s;
  min-height: 36px;
}

.dtp-day:hover:not(.dtp-day--selected):not(.dtp-day--other) {
  background: var(--color-bg);
}

.dtp-day--other {
  color: var(--color-text-muted);
  opacity: 0.45;
  cursor: default;
}

.dtp-day--today:not(.dtp-day--selected) {
  box-shadow: 0 0 0 2px var(--dtp-today-ring);
}

.dtp-day--selected {
  background: var(--dtp-sel-bg) !important;
  color: var(--dtp-sel-text) !important;
}

/* Time pills */
.dtp-time-section {
  margin-top: 16px;
}

.dtp-time-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.dtp-time-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dtp-time-pill {
  height: 32px;
  padding: 0 14px;
  border-radius: var(--dtp-radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-white);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.dtp-time-pill:hover:not(.dtp-time-pill--selected) {
  border-color: #2AABBC;
  color: #2AABBC;
}

.dtp-time-pill--selected {
  background: var(--dtp-sel-bg);
  border-color: var(--dtp-sel-bg);
  color: var(--dtp-sel-text);
}

/* ── Step view container & transitions ──────────────────── */
.dtp-view {
  overflow: hidden;
}

@keyframes dtp-in-right {
  from {
    opacity: 0;
    transform: translateX(22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dtp-in-left {
  from {
    opacity: 0;
    transform: translateX(-22px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dtp-view--enter-right {
  animation: dtp-in-right 0.22s cubic-bezier(.4, 0, .2, 1) both;
}

.dtp-view--enter-left {
  animation: dtp-in-left 0.22s cubic-bezier(.4, 0, .2, 1) both;
}

/* Step header (time step) */
.dtp-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.dtp-back-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  flex-shrink: 0;
  padding: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.dtp-back-btn:hover {
  background: var(--color-bg);
  border-color: #2AABBC;
  color: #2AABBC;
}

.dtp-selected-date-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}

/* Time step scroll area */
.dtp-time-scroll {
  max-height: 220px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.dtp-time-scroll::-webkit-scrollbar {
  width: 4px;
}

.dtp-time-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.dtp-time-scroll .dtp-time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.dtp-time-scroll .dtp-time-pill {
  width: 100%;
  justify-content: center;
}

/* Mobile sheet: hide footer (auto-close on time pick) */
.dtp-sheet-footer {
  display: none;
}

/* Sheet title changes per step */
.dtp-sheet-title {
  transition: opacity 0.15s;
}

.section__cards {
  padding: 0;
  width: 100%;
  max-width: 1560px;
}

.cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cards-row--two {
  grid-template-columns: repeat(2, 1fr);
}

/* CARD */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.card__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card__icon {
  padding: 8px;
  border-radius: 8px;
  background: var(--color-icon-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.card__icon svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.card__label {
  font-size: 24px;
  line-height: 125%;
  font-weight: 400;
  color: var(--color-text-muted);
}

.card__value-wrap {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.card__value {
  font-size: 48px;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1;
}

.card__unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.card--wide {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 48px;
}

.card__compass {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card__compass>svg:first-child {
  position: absolute;
  top: 0;
  left: 0;
}

.card__compass .compass-arrows {
  position: absolute;
  left: 92px;
  top: 27px;
  transform-origin: 8px 73px;
}

/* CHART CARD */
.chart-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 48px;
}

.chart-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.chart-card__title {
  font-size: 24px;
  line-height: 125%;
  font-weight: 400;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-card__title-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-card__subtitle {
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  color: var(--color-text-muted);
}

.chart-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 24px -48px 24px;
}

.chart-card__current {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.chart-card__current .card__value {
  font-size: 48px;
}

.chart-svg {
  width: 100%;
  height: 145px;
  display: block;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  padding: 0 16px;
}

.chart-axis span {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ── Chart.js canvas wrapper ───────────────────────────── */
.chart-wrap {
  position: relative;
  width: 100%;
  height: 200px;
}

.chart-wrap canvas {
  display: block;
}

/* ── Custom Tooltip ────────────────────────────────────── */
#chart-tooltip {
  position: fixed;
  pointer-events: none;
  background: #FFFFFF;
  border: 1px solid #E0EBF1;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
  font-family: 'Montserrat', sans-serif;
  min-width: 140px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 1000;
}

#chart-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-time {
  font-size: 11px;
  font-weight: 500;
  color: #7A8A9A;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.tooltip-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.tooltip-value {
  font-size: 20px;
  font-weight: 600;
  color: #1A1A2E;
  line-height: 1;
}

.tooltip-unit {
  font-size: 12px;
  font-weight: 500;
  color: #7A8A9A;
}

/* BREAKPOINTS */
@media (max-width: 1440px) {

  .card {
    padding: 32px;
  }

  .card--wide {
    padding: 32px;
  }

  .chart-card {
    padding: 32px;
  }

  .chart-divider {
    margin-left: -32px;
    margin-right: -32px;
  }

  .card__value {
    font-size: 40px;
  }

  .chart-card__current .card__value {
    font-size: 40px;
  }

}

@media (max-width: 1280px) {
  .site-header {
    padding: 40px 20px 32px;
  }

  .site-header__title {
    font-size: 28px;
  }
}

@media (max-width: 1280px) {
  .card__compass {
    display: none;
  }
}

@media (max-width: 1024px) {
  .site-header {
    padding: 32px 20px 28px;
  }

  .site-header__title {
    font-size: 26px;
  }

  .card__value {
    font-size: 36px;
  }

  .card__compass {
    width: 160px;
    height: 160px;
    right: 10px;
  }

  .chart-card__current .card__value {
    font-size: 36px;
  }

  .card__icon {
    width: 56px;
    height: 56px;
  }

  .card__icon svg {
    width: 40px;
    height: 40px;
  }

  .card__label {
    font-size: 20px;
    line-height: 120%;
  }

  .chart-card__title {
    font-size: 20px;
    line-height: 120%;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 28px 20px 24px;
  }

  .site-header__title {
    font-size: 22px;
  }

  .section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .section__header {
    padding-left: 0px;
    padding-right: 0px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .section__cards {
    padding-left: 0px;
    padding-right: 0px;
  }

  .cards-row,
  .cards-row--two {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .card {
    padding: 32px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
  }

  .card--wide {
    padding: 32px;
  }

  .card__top {
    align-items: center;
  }

  .card__value-wrap {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
  }

  .card__value {
    font-size: 32px;
  }

  .card__compass {
    display: none;
  }

  .chart-card {
    padding: 24px;
  }

  .chart-divider {
    margin-left: -24px;
    margin-right: -24px;
  }

  .chart-card__header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .chart-card__current .card__value {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .site-header__title {
    font-size: 20px;
  }

  .card {
    padding: 20px 24px;
  }

  .card--wide {
    padding: 20px 24px;
  }

  .card__value {
    font-size: 28px;
  }

  .chart-card {
    padding: 20px;
  }

  .chart-divider {
    margin-left: -20px;
    margin-right: -20px;
  }

  .chart-card__current .card__value {
    font-size: 28px;
  }
}

@media (max-width: 360px) {
  .section__header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .section__cards {
    padding-left: 16px;
    padding-right: 16px;
  }

  .card {
    padding: 16px 20px;
  }

  .card__value {
    font-size: 26px;
  }
}