/**
 * 地点予報サイドパネル スタイル
 */

/* ==========================================================================
   パネル本体
   ========================================================================== */

.forecast-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out, visibility 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.forecast-panel.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

/* モバイル: サイズ調整 */
@media (max-width: 768px) {
  .forecast-panel {
    width: 95%;
    max-height: 85vh;
  }
}

/* ==========================================================================
   オーバーレイ
   ========================================================================== */

.forecast-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.forecast-panel-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   ヘッダー
   ========================================================================== */

.forecast-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, #1976D2, #2196F3);
  color: #fff;
  flex-shrink: 0;
}

.forecast-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: bold;
}

.forecast-panel-icon {
  display: flex;
  align-items: center;
}

.forecast-panel-icon svg {
  width: 18px;
  height: 18px;
}

.forecast-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.forecast-panel-close:hover {
  opacity: 1;
}

/* ==========================================================================
   ローディング
   ========================================================================== */

.forecast-panel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  flex: 1;
}

.forecast-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e0e0;
  border-top-color: #1976D2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.forecast-panel-loading p {
  margin-top: 16px;
  color: #666;
  font-size: 14px;
}

/* ==========================================================================
   エラー
   ========================================================================== */

.forecast-panel-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}

.forecast-panel-error p {
  color: #d32f2f;
  margin-bottom: 16px;
  font-size: 14px;
}

.forecast-retry-btn {
  background: #1976D2;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.forecast-retry-btn:hover {
  background: #1565C0;
}

/* ==========================================================================
   コンテンツ
   ========================================================================== */

.forecast-panel-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 観測地点情報 */
.forecast-station-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.station-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fff;
  border-radius: 12px;
  font-size: 11px;
  color: #555;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.station-badge svg {
  flex-shrink: 0;
}

/* ==========================================================================
   タブ
   ========================================================================== */

.forecast-tabs {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
}

.forecast-tab {
  flex: 1;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.forecast-tab:hover {
  background: #f5f5f5;
  color: #333;
}

.forecast-tab.active {
  color: #1976D2;
  border-bottom-color: #1976D2;
}

/* ==========================================================================
   日別コンテンツ
   ========================================================================== */

.forecast-day-content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
}

.forecast-section {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.forecast-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-title {
  font-size: 12px;
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.no-data {
  color: #999;
  font-size: 11px;
  text-align: center;
  padding: 8px;
}

/* ==========================================================================
   天気セクション（予報パネル用コンパクトスタイル）
   ========================================================================== */

.forecast-panel .weather-info-section {
  background: linear-gradient(135deg, #fef9e7 0%, #e0f2fe 50%, #fef9e7 100%);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

.forecast-panel .weather-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.forecast-panel .weather-main-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.forecast-panel .weather-main-icon svg {
  width: 28px;
  height: 28px;
}

.forecast-panel .weather-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.forecast-panel .weather-main-category {
  font-size: 11px;
  font-weight: 500;
  color: #4b5563;
  line-height: 1.5;
}

/* 天気テキスト整形 - 天気種類ごとの色（サイズ統一） */
.forecast-panel .weather-main-category .weather-sunny {
  color: #d97706;
}

.forecast-panel .weather-main-category .weather-cloudy {
  color: #6b7280;
}

.forecast-panel .weather-main-category .weather-rainy {
  color: #2563eb;
}

.forecast-panel .weather-main-category .weather-snowy {
  color: #0891b2;
}

.forecast-panel .weather-main-category .weather-thunder {
  color: #dc2626;
}

.forecast-panel .weather-main-category .weather-connector {
  color: #6b7280;
}

.forecast-panel .weather-temp-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forecast-panel .weather-main-temp {
  font-size: 15px;
  font-weight: 700;
}

.forecast-panel .weather-temp-range {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 15px;
  font-weight: 700;
}

.forecast-panel .weather-temp-range .temp-min {
  color: #3b82f6;
}

.forecast-panel .weather-temp-range .temp-separator {
  color: #9ca3af;
  font-weight: normal;
}

.forecast-panel .weather-temp-range .temp-max {
  color: #ef4444;
}

.forecast-panel .weather-pop-item {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 6px;
  border-radius: 4px;
}

.forecast-panel .weather-pop-icon {
  display: flex;
  align-items: center;
  color: #3b82f6;
}

.forecast-panel .weather-pop-icon svg {
  width: 14px;
  height: 14px;
}

.forecast-panel .weather-pop-value {
  font-size: 11px;
  font-weight: 600;
  color: #3b82f6;
}

/* ==========================================================================
   潮位グラフ・満潮干潮時刻（コンパクト）
   ========================================================================== */

.forecast-panel .tide-graph-container svg {
  width: 100%;
  height: 100%;
}

/* 潮位時刻表示 */
.forecast-panel .tide-times-row {
  display: flex;
  justify-content: space-around;
  font-size: 10px;
  color: #666;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
}

.forecast-panel .tide-time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}

.forecast-panel .tide-time-label {
  font-weight: 600;
  font-size: 9px;
}

/* 満潮ラベル（青系） */
.forecast-panel .tide-time-item.high-tide .tide-time-label {
  color: #1976D2;
}

/* 干潮ラベル（オレンジ系） */
.forecast-panel .tide-time-item.low-tide .tide-time-label {
  color: #e65100;
}

.forecast-panel .tide-time-value {
  font-size: 11px;
  color: #333;
  font-weight: 600;
}

.forecast-panel .tide-level-value {
  font-size: 9px;
  color: #666;
}

/* ==========================================================================
   潮位情報ブロック（コンパクト）
   ========================================================================== */

.forecast-panel .tide-info-block {
  background: linear-gradient(135deg, #e8f4fd 0%, #fef9e7 50%, #e8f4fd 100%);
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
}

.forecast-panel .tide-info-block .tide-graph-section {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
  border-radius: 0;
}

.forecast-panel .tide-info-block .tide-graph-container {
  position: relative;
  height: 40px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  margin-bottom: 8px;
}

.forecast-panel .sun-tide-compact {
  padding: 0 0 6px 0;
}

.forecast-panel .sun-tide-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.forecast-panel .sun-item,
.forecast-panel .tide-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.forecast-panel .sun-item svg,
.forecast-panel .tide-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.forecast-panel .tide-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.forecast-panel .sun-tide-label {
  font-size: 9px;
  color: #6b7280;
  font-weight: 500;
}

.forecast-panel .sun-tide-value {
  font-size: 11px;
  font-weight: 600;
  color: #1f2937;
}

/* 日の出・日の入りクリック可能スタイル */
.forecast-panel .sun-item-clickable {
  background: none;
  border: none;
  padding: 4px;
  margin: -4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.forecast-panel .sun-item-clickable:hover {
  background: rgba(0, 0, 0, 0.05);
}

.forecast-panel .sun-item-clickable:active {
  background: rgba(0, 0, 0, 0.1);
}

/* 潮名クリック可能スタイル */
.forecast-panel .tide-item-clickable {
  background: none;
  border: none;
  padding: 4px;
  margin: -4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.forecast-panel .tide-item-clickable:hover {
  background: rgba(0, 0, 0, 0.05);
}

.forecast-panel .tide-item-clickable:active {
  background: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   風セクション（コンパクト）
   ========================================================================== */

.forecast-panel .wind-info-section {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 50%, #e0f2fe 100%);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}

/* 風セクション クリック可能スタイル */
.forecast-panel .wind-info-clickable {
  display: block;
  width: 100%;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.forecast-panel .wind-info-clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.forecast-panel .wind-info-clickable:active {
  transform: translateY(0);
}

.forecast-panel .wind-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forecast-panel .wind-main-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.forecast-panel .wind-main-icon svg {
  width: 18px;
  height: 18px;
}

.forecast-panel .wind-main-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.forecast-panel .wind-main-value {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.forecast-panel .wind-main-label {
  font-size: 10px;
  color: #6b7280;
  font-weight: 500;
}

.forecast-panel .wind-direction-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.forecast-panel .wind-periods {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.forecast-panel .wind-period-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 5px 8px;
  border-radius: 6px;
  flex: 1;
}

.forecast-panel .wind-period-label {
  font-size: 9px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
}

.forecast-panel .wind-period-value {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}

.forecast-panel .wind-period-value .wind-direction-arrow {
  width: 11px;
  height: 11px;
}

/* ==========================================================================
   課金プラン案内モーダル
   ========================================================================== */

.upgrade-prompt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.upgrade-prompt-content {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.upgrade-prompt-icon {
  color: #f59e0b;
  margin-bottom: 16px;
}

.upgrade-prompt-icon svg {
  width: 48px;
  height: 48px;
}

.upgrade-prompt-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 12px 0;
}

.upgrade-prompt-message {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 24px 0;
}

.upgrade-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.upgrade-prompt-btn {
  display: block;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.upgrade-prompt-btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.upgrade-prompt-btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.upgrade-prompt-btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
}

.upgrade-prompt-btn-secondary:hover {
  background: #e5e7eb;
}

/* ==========================================================================
   出典表示
   ========================================================================== */

.forecast-attribution {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* ==========================================================================
   ユーティリティ
   ========================================================================== */

.hidden {
  display: none !important;
}
