/* ==================== ツールチップ ==================== */

/* 基本ツールチップ */
.tooltip-container {
  position: relative;
  cursor: pointer;
  display: flex;
  justify-self: start;
}

.tooltip-icon {
  font-size: 1.5em;
  color: var(--color-black);
  transition: color 0.3s ease;
}

.tooltip-container:hover .tooltip-icon {
  color: #c7661a;
}

.tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 130%;
  left: 0;
  background-color: #fff;
  color: #171F2A;
  padding: 12px;
  border-radius: 8px;
  min-width: 190px;
  max-width: 320px;
  word-break: break-word;
  z-index: 100;
  transition: opacity 0.3s ease, left 0.3s ease;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  font-size: 0.85em;
}

.tooltip-container:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* 地図ビュー専用のツールチップ配置 */
#mapView .tooltip-container {
  display: flex;
  padding: 0 var(--spacing-xl);
  transition: all var(--transition-speed) ease;
}

#mapView:has(.map-wrapper.with-list) .tooltip-content {
  left: 0;
}

#mapView:has(.map-wrapper.with-list) .tooltip-container {
  justify-content: flex-start;
  padding-left: var(--spacing-xl);
}

/* 凡例 */
.legend-item:not(:last-child) {
  margin-bottom: 8px;
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 2px;
}

/* 端末ステータス一覧の凡例色 */
.legend-color.green {
  background-color: #b8e6d5;
}

.legend-color.yellow {
  background-color: #fff9c4;
}

.legend-color.gray {
  background-color: #e0e0e0;
}

.legend-color.red {
  border: 2px solid #ffb3ba;
  background-color: transparent;
}

.legend-color.beige {
  background-color: #eee3d6;
}

/* 日本地図の凡例色（実際の地図表示と同じ色） */
#mapView .legend-color.green {
  background-color: #c5e4a1ff;
}

#mapView .legend-color.orange {
  background-color: #ffcb86ff;
}

#mapView .legend-color.red {
  background-color: #da615dff;
  border: none;
}

#mapView .legend-color.beige {
  background-color: #e2c8a0ff;
}

#mapView .legend-color.gray {
  background-color: #c0bebeff;
}

/* ==================== レスポンシブ対応 ==================== */

@media (max-width: 768px) {
  #mapView .tooltip-container {
    padding: 0 var(--spacing-md);
  }
}
