@import url('https://unpkg.com/leaflet@1.9.4/dist/leaflet.css');
@import url('../../../css/basic-tools.css?v=20260924-3');

.wind-flow-tool {
  max-width: 900px;
  margin: 0 auto;
}

/* =========================================================
   공통 카드
   ========================================================= */

.wind-search-panel,
.wind-current-section,
.wind-change-section,
.wind-guide,
.wind-source {
  margin-top: 14px;
  padding: 15px;

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.76);
}

/* =========================================================
   검색
   ========================================================= */

.wind-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 10px;
}

.wind-search-head strong,
.wind-search-head span {
  display: block;
}

.wind-search-head strong {
  font-size: 14px;
}

.wind-search-head span {
  margin-top: 2px;

  color: #64748b;

  font-size: 12px;
}

.wind-location-button {
  padding: 8px 10px;

  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;

  background: #fff;

  color: inherit;

  font: inherit;
  font-size: 12px;

  cursor: pointer;
}

.wind-location-button:disabled {
  opacity: 0.55;

  cursor: wait;
}

.wind-search-row {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    72px;

  gap: 8px;
}

.wind-search-row input {
  width: 100%;
  min-width: 0;

  box-sizing: border-box;

  padding: 11px 12px;

  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 11px;

  background: #fff;

  color: inherit;

  font: inherit;
  font-size: 14px;

  outline: none;
}

.wind-search-row input:focus {
  border-color: rgba(14, 165, 233, 0.5);

  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.08);
}

.wind-search-results {
  display: grid;

  gap: 6px;

  margin-top: 8px;
}

.wind-search-item {
  width: 100%;

  padding: 9px 10px;

  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 10px;

  background: #fff;

  color: inherit;

  text-align: left;

  cursor: pointer;
}

.wind-search-item strong,
.wind-search-item span {
  display: block;
}

.wind-search-item strong {
  font-size: 12px;
}

.wind-search-item span {
  overflow: hidden;

  margin-top: 2px;

  color: #64748b;

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.wind-recent {
  margin-top: 8px;
}

.wind-recent-label {
  display: block;

  margin-bottom: 5px;

  color: #94a3b8;

  font-size: 12px;
}

.wind-recent-items {
  display: flex;
  flex-wrap: wrap;

  gap: 5px;
}

.wind-recent-button {
  padding: 5px 8px;

  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 999px;

  background: rgba(15, 23, 42, 0.025);

  color: inherit;

  font: inherit;
  font-size: 12px;

  cursor: pointer;
}

.wind-status {
  min-height: 17px;

  margin: 8px 0 0;

  color: #64748b;

  text-align: center;

  font-size: 12px;
}

/* =========================================================
   지도
   ========================================================= */

.wind-map-section {
  overflow: hidden;

  margin-top: 14px;

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;

  background: #eef3f5;
}

.wind-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 10px 12px;

  background: #fff;
}

.wind-map-toolbar strong,
.wind-map-toolbar span {
  display: block;
}

.wind-map-toolbar strong {
  font-size: 13px;
}

.wind-map-toolbar span {
  margin-top: 1px;

  color: #94a3b8;

  font-size: 12px;
}

.wind-layer-buttons {
  display: flex;

  gap: 5px;
}

.wind-layer-buttons button {
  padding: 5px 8px;

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;

  background: rgba(15, 23, 42, 0.03);

  color: #64748b;

  font: inherit;
  font-size: 12px;

  cursor: pointer;
}

.wind-layer-buttons button.is-active {
  border-color: rgba(14, 165, 233, 0.22);

  background: rgba(14, 165, 233, 0.09);

  color: #0369a1;
}

.wind-map-shell {
  position: relative;

  height: 500px;

  background: #e9f0f2;
}

.wind-map {
  width: 100%;
  height: 100%;
}

.wind-map .leaflet-tile-pane {
  filter: saturate(0.56) contrast(0.94) brightness(1.04);
}

.wind-map .leaflet-control-attribution {
  opacity: 0.68;

  font-size: 12px;
}

.wind-map .leaflet-control-zoom a {
  color: #334155;
}

/* =========================================================
   Canvas
   ========================================================= */

.wind-shade-canvas,
.wind-particle-canvas {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  pointer-events: none;
}

.wind-shade-canvas {
  z-index: 410;
}

.wind-particle-canvas {
  z-index: 420;
}

/* =========================================================
   조회용 마커
   ========================================================= */

.wind-probe-icon {
  border: 0 !important;
  background: transparent !important;
}

.wind-probe-marker {
  position: relative;

  width: 34px;
  height: 42px;

  cursor: grab;

  user-select: none;
}

.wind-probe-marker:active {
  cursor: grabbing;
}

.wind-probe-pin {
  position: absolute;

  top: 0;
  left: 5px;

  width: 24px;
  height: 24px;

  border: 3px solid #fff;
  border-radius: 50% 50% 50% 4px;

  background: #0284c7;

  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.28);

  transform: rotate(-45deg);
}

.wind-probe-pin::after {
  content: '';

  position: absolute;

  top: 6px;
  left: 6px;

  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #fff;
}

.wind-probe-label {
  position: absolute;

  left: 50%;
  bottom: -2px;

  padding: 2px 5px;

  border-radius: 999px;

  background: rgba(15, 23, 42, 0.84);

  color: #fff;

  font-size: 12px;
  font-weight: 700;

  white-space: nowrap;

  transform: translateX(-50%);
}

/* =========================================================
   지도 도움말
   ========================================================= */

.wind-map-help {
  position: absolute;

  z-index: 640;

  top: 10px;
  left: 50%;

  padding: 5px 8px;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.85);

  color: #64748b;

  font-size: 12px;

  pointer-events: none;

  transform: translateX(-50%);

  backdrop-filter: blur(8px);
}

/* =========================================================
   로딩
   ========================================================= */

.wind-map-loading {
  position: absolute;

  z-index: 700;

  top: 42px;
  left: 50%;

  display: flex;
  align-items: center;

  gap: 7px;

  padding: 7px 10px;

  border-radius: 999px;

  background: rgba(255, 255, 255, 0.93);

  color: #475569;

  font-size: 12px;

  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.12);

  transform: translateX(-50%);

  backdrop-filter: blur(8px);
}

.wind-map-loading[hidden] {
  display: none;
}

.wind-loader {
  width: 11px;
  height: 11px;

  border: 2px solid rgba(14, 165, 233, 0.2);
  border-top-color: #0284c7;
  border-radius: 50%;

  animation: wind-spin 0.8s linear infinite;
}

@keyframes wind-spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================================================
   풍속 범례
   ========================================================= */

.wind-map-legend {
  position: absolute;

  z-index: 650;

  right: 9px;
  bottom: 9px;

  min-width: 265px;

  padding: 7px 9px 8px;

  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.91);

  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.08);

  backdrop-filter: blur(9px);
}

.wind-legend-title {
  margin-bottom: 5px;

  color: #64748b;

  font-size: 12px;
}

.wind-legend-title strong {
  color: #334155;
}

.wind-legend-items {
  display: grid;

  grid-template-columns: repeat(6, 1fr);

  gap: 3px;
}

.wind-legend-item {
  min-width: 0;

  text-align: center;
}

.legend-color {
  display: block;

  height: 6px;

  margin-bottom: 3px;

  border-radius: 3px;
}

.wind-legend-item > span:last-child {
  display: block;

  color: #475569;

  font-size: 12px;

  white-space: nowrap;
}

.legend-c1 {
  background: rgb(15, 159, 146);
}

.legend-c2 {
  background: rgb(8, 145, 178);
}

.legend-c3 {
  background: rgb(37, 99, 235);
}

.legend-c4 {
  background: rgb(124, 58, 237);
}

.legend-c5 {
  background: rgb(225, 29, 72);
}

.legend-c6 {
  background: rgb(159, 18, 57);
}

/* =========================================================
   시간 컨트롤
   ========================================================= */

.wind-timebar {
  display: grid;

  grid-template-columns:
    auto
    minmax(0, 1fr);

  align-items: center;

  gap: 12px;

  padding: 10px 12px 12px;

  background: #fff;
}

.wind-time-controls {
  display: flex;
  align-items: center;

  gap: 5px;
}

.wind-step,
.wind-play {
  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;

  cursor: pointer;
}

.wind-step {
  width: 30px;
  height: 30px;

  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 9px;

  background: rgba(15, 23, 42, 0.035);

  color: #334155;

  font-size: 20px;
  line-height: 1;
}

.wind-play {
  width: 36px;
  height: 36px;

  border-radius: 50%;

  background: #0f172a;

  color: #fff;

  font-size: 12px;
}

.wind-step:disabled {
  opacity: 0.28;

  cursor: default;
}

.wind-time-main {
  min-width: 0;
}

.wind-time-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 5px;
}

.wind-time-labels strong {
  font-size: 12px;
}

.wind-time-labels span {
  color: #64748b;

  font-size: 12px;
}

#windTimeSlider {
  width: 100%;

  accent-color: #0284c7;
}

.wind-time-ticks {
  display: flex;
  justify-content: space-between;

  margin-top: 1px;

  color: #94a3b8;

  font-size: 12px;
}

/* =========================================================
   섹션 헤더
   ========================================================= */

.wind-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 11px;
}

.wind-section-head h3 {
  margin: 0;

  font-size: 15px;
}

.wind-section-head span {
  color: #94a3b8;

  font-size: 12px;
}

/* =========================================================
   현재 바람
   ========================================================= */

.wind-current-card {
  display: grid;

  grid-template-columns:
    145px
    minmax(0, 1fr);

  gap: 16px;

  align-items: center;
}

.wind-compass {
  text-align: center;
}

.wind-compass-ring {
  position: relative;

  width: 118px;
  height: 118px;

  margin: 0 auto;

  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 50%;

  background: radial-gradient(
    circle,
    rgba(14, 165, 233, 0.08),
    rgba(255, 255, 255, 0.7) 67%
  );

  box-shadow: inset 0 0 0 7px rgba(15, 23, 42, 0.025);
}

.wind-compass-ring > span {
  position: absolute;

  color: #64748b;

  font-size: 12px;
  font-weight: 700;
}

.wind-compass-ring .north {
  top: 6px;
  left: 50%;

  transform: translateX(-50%);
}

.wind-compass-ring .south {
  bottom: 6px;
  left: 50%;

  transform: translateX(-50%);
}

.wind-compass-ring .east {
  top: 50%;
  right: 7px;

  transform: translateY(-50%);
}

.wind-compass-ring .west {
  top: 50%;
  left: 7px;

  transform: translateY(-50%);
}

.wind-arrow {
  position: absolute;

  top: 50%;
  left: 50%;

  color: #0284c7;

  font-size: 55px;

  line-height: 1;

  transform: translate(-50%, -50%) rotate(0deg);

  transform-origin: center;

  transition: transform 0.35s ease;
}

.wind-compass small {
  display: block;

  margin-top: 5px;

  color: #94a3b8;

  font-size: 12px;
}

.wind-current-main > span {
  color: #64748b;

  font-size: 12px;
}

.wind-current-main > strong {
  display: block;

  margin-top: 3px;

  font-size: 25px;

  letter-spacing: -0.03em;
}

.wind-current-main > p {
  margin: 5px 0 0;

  color: #64748b;

  font-size: 12px;
  line-height: 1.5;
}

.wind-current-values {
  display: grid;

  grid-template-columns: repeat(3, 1fr);

  gap: 6px;

  margin-top: 12px;
}

.wind-current-values > div {
  padding: 8px 6px;

  border-radius: 9px;

  background: rgba(15, 23, 42, 0.035);

  text-align: center;
}

.wind-current-values span,
.wind-current-values strong {
  display: block;
}

.wind-current-values span {
  color: #94a3b8;

  font-size: 12px;
}

.wind-current-values strong {
  margin-top: 3px;

  font-size: 12px;
}

.wind-feel-link {
  display: block;

  margin-top: 11px;
  padding: 8px 10px;

  border-radius: 9px;

  background: rgba(14, 165, 233, 0.06);

  color: #0369a1;

  text-align: center;
  text-decoration: none;

  font-size: 12px;
  font-weight: 700;
}

/* =========================================================
   시간별 테이블
   ========================================================= */

.wind-table-help {
  margin: -4px 0 9px;

  color: #94a3b8;

  font-size: 12px;
}

.wind-table-wrap {
  overflow-x: auto;

  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
}

.wind-forecast-table {
  width: 100%;
  min-width: 570px;

  border-collapse: collapse;

  background: rgba(255, 255, 255, 0.56);

  table-layout: fixed;
}

.wind-forecast-table th {
  padding: 8px 7px;

  border-bottom: 1px solid rgba(15, 23, 42, 0.08);

  background: rgba(15, 23, 42, 0.035);

  color: #64748b;

  font-size: 12px;
  font-weight: 700;

  text-align: center;
}

.wind-forecast-table td {
  padding: 8px 7px;

  border-bottom: 1px solid rgba(15, 23, 42, 0.055);

  color: #334155;

  font-size: 12px;

  text-align: center;
}

.wind-forecast-table tbody tr {
  cursor: pointer;

  transition: background 0.15s ease;
}

.wind-forecast-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.045);
}

.wind-forecast-table tbody tr.is-current {
  background: rgba(14, 165, 233, 0.095);
}

.wind-forecast-table tbody tr.is-current td {
  color: #075985;

  font-weight: 700;
}

.wind-forecast-table th:nth-child(1) {
  width: 31%;
}

.wind-forecast-table th:nth-child(2) {
  width: 11%;
}

.wind-forecast-table th:nth-child(3) {
  width: 24%;
}

.wind-forecast-table th:nth-child(4),
.wind-forecast-table th:nth-child(5) {
  width: 17%;
}

.wind-table-time strong,
.wind-table-time span {
  display: block;
}

.wind-table-time strong {
  font-size: 12px;
}

.wind-table-time span {
  margin-top: 1px;

  color: #94a3b8;

  font-size: 12px;
}

.wind-table-direction {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 5px;
}

.wind-table-arrow {
  display: inline-block;

  color: #0284c7;

  font-size: 16px;

  line-height: 1;

  transform-origin: center;
}

.wind-table-direction-text {
  display: inline-block;

  text-align: left;
}

.wind-table-direction-text strong,
.wind-table-direction-text small {
  display: block;
}

.wind-table-direction-text strong {
  font-size: 12px;
}

.wind-table-direction-text small {
  margin-top: 1px;

  color: #94a3b8;

  font-size: 12px;
}

.wind-table-empty {
  padding: 20px !important;

  color: #94a3b8 !important;
}

/* =========================================================
   가이드
   ========================================================= */

.wind-guide summary {
  cursor: pointer;

  font-size: 13px;
  font-weight: 700;
}

.wind-guide-body {
  margin-top: 10px;

  color: #64748b;

  font-size: 12px;
  line-height: 1.6;
}

.wind-guide-example {
  display: grid;

  grid-template-columns:
    1fr
    auto
    1fr;

  align-items: center;

  gap: 10px;

  margin: 11px 0;
  padding: 10px;

  border-radius: 11px;

  background: rgba(14, 165, 233, 0.045);

  text-align: center;
}

.wind-guide-example span,
.wind-guide-example strong {
  display: block;
}

.wind-guide-example span {
  color: #94a3b8;

  font-size: 12px;
}

.wind-guide-example strong {
  margin-top: 3px;

  color: #334155;

  font-size: 12px;
}

.wind-guide-flow {
  color: #0284c7;

  font-size: 17px;
}

/* =========================================================
   자료
   ========================================================= */

.wind-source {
  color: #64748b;

  font-size: 12px;
  line-height: 1.55;
}

.wind-source strong {
  color: #334155;
}

.wind-source p {
  margin: 5px 0 0;
}

/* =========================================================
   Popup
   ========================================================= */

.wind-popup {
  min-width: 135px;
}

.wind-popup strong {
  display: block;

  margin-bottom: 3px;

  font-size: 12px;
}

.wind-popup span {
  display: block;

  color: #64748b;

  font-size: 12px;
}

/* =========================================================
   모바일
   ========================================================= */

@media (max-width: 650px) {
  .wind-map-shell {
    height: 440px;
  }

  .wind-map-legend {
    right: 7px;
    bottom: 7px;

    min-width: 225px;

    padding: 6px 7px;
  }

  .wind-timebar {
    grid-template-columns: 1fr;

    gap: 8px;
  }

  .wind-time-controls {
    justify-content: center;
  }

  .wind-current-card {
    grid-template-columns:
      115px
      minmax(0, 1fr);
  }

  .wind-compass-ring {
    width: 100px;
    height: 100px;
  }

  .wind-arrow {
    font-size: 46px;
  }
}

@media (max-width: 470px) {
  .wind-search-row {
    grid-template-columns:
      minmax(0, 1fr)
      62px;
  }

  .wind-map-toolbar {
    align-items: flex-start;
  }

  .wind-map-shell {
    height: 400px;
  }

  .wind-map-help {
    display: none;
  }

  .wind-map-legend {
    right: 6px;
    bottom: 6px;

    min-width: 205px;
  }

  .wind-legend-item > span:last-child {
    font-size: 12px;
  }

  .wind-current-card {
    grid-template-columns: 1fr;
  }

  .wind-current-main {
    text-align: center;
  }

  .wind-current-values {
    max-width: 360px;

    margin-right: auto;
    margin-left: auto;
  }
}
