/* 騒音可視化画面用CSS */

/* 騒音レベルタブ */

/* モダンなデザインスタイル */
body {
    background-color: #f8f9fa;
}
/* メインコンテナ */
.main-container {
    background: linear-gradient(135deg, #0072BC 0%, #005587 100%);
    min-height: 100vh;
    padding: 10px 0;
}
/* コンテナの基本設定 */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}
/* ヘッダー */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 15px;
    margin-bottom: 10px;
}
/* タブ */
.tab-modern {
    border: none;
    background: transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
}
/* タブの上にカーソルを乗せたとき */
.tab-modern:hover {
    background: rgba(0, 114, 188, 0.1);
    color: #0072BC;
}
/* タブが選択されている時 */
.tab-modern.active {
    background: #0072BC;
    color: white;
    box-shadow: 0 4px 15px 0 rgba(0, 114, 188, 0.4);
}
/* 総合評価 */
.rating-section {
    background: linear-gradient(135deg, #0072BC 0%, #005587 100%);
    border-radius: 15px;
    padding: 20px;
    color: white;
    text-align: center;
    margin-bottom: 15px;
}
/* 総合評価-星 */
.rating-stars {
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}
/* 総合評価-スコア */
.rating-score {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-top: 4px;
    opacity: 0.9;
}
/* 物件レビューボタンのホバー効果 */
#reviewButton:hover {
    background: #f0f8ff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}
/* 曜日選択ボタンコンテナ */
.weekday-selector {
    display: flex;
    justify-content: center; /* 中央揃え */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 16px;
}
/* 横スクロールが発生している場合は左揃え */
.weekday-selector.scrollable {
    justify-content: flex-start;
}

/* 曜日選択ボタン */
.weekday-btn {
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 8px 10px;
    margin: 0 1px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 40px;
    font-size: 0.85rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* ボタンが縮小しないように */
}

/* 曜日選択ボタンの上にカーソルを乗せたとき */
.weekday-btn:hover {
    border-color: #0072BC;
    color: #0072BC;
    transform: translateY(-2px);
}
/* 曜日選択ボタンが選択されている時 */
.weekday-btn.active {
    background: #0072BC;
    border-color: #0072BC;
    color: white;
    box-shadow: 0 4px 15px 0 rgba(0, 114, 188, 0.4);
}
/* 時間別・曜日別騒音レベルグラフ＋騒音レベル指標の横並び */
.chart-and-legend {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
/* 時間別・曜日別騒音レベルグラフ-スクロール領域 */
.noise-scroll-area {
    position: relative;             /* 内部の absolute を正しく基準付け */
    overflow-y: visible;            /* デスクトップ時はスクロールなし */
    overscroll-behavior: contain;   /* ページスクロールへの波及を防ぐ */
    -webkit-overflow-scrolling: touch; /* iOSの慣性スクロール */
    flex: 1;                        /* グラフ部分が伸縮 */
    min-width: 0;                   /* flex子要素の縮小を許可 */
}
/* 左側-時間別・曜日別騒音レベルグラフ */
.chart-col {
  position: relative;
  width: 100%;
}
/* 騒音レベルグラフ */
#chartCanvasContainer {
    position: relative;
    height: 350px;
}
/* 右側-騒音レベル指標 */
.legend-col {
  width: 110px; /* 固定幅（デスクトップ） */
  flex: 0 0 110px; /* 拡大・縮小なし（デスクトップ） */
}
/* 騒音レベル指標 */
.noise-legend {
  display: flex;
  flex-direction: column; /* デスクトップは縦並び */
  gap: 4px;
}
/* 騒音レベル指標 */
.noise-indicator {
  display: flex;
  align-items: center;
  padding: 4px 16px;
  font-weight: 500;
  font-size: 0.75rem;
  white-space: nowrap;  /* 折り返さない */
  border-radius: 25px;   /* 角丸 */
}
/* 騒音レベル指標-個別 */
.noise-indicator span:first-child {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 騒音レベル指標-静か*/
.noise-indicator.comfort {
    background: rgba(0, 160, 233, 0.1);
    color: #00A0E9;
}
/* 騒音レベル指標-快適*/
.noise-indicator.quiet {
    background: rgba(3, 166, 90, 0.1);
    color: #03A65A;
}
/* 騒音レベル指標-普通*/
.noise-indicator.normal {
    background: rgba(255, 192, 0, 0.1);
    color: #FFC000;
}
/* 騒音レベル指標-やや騒がしい*/
.noise-indicator.loud {
    background: rgba(240, 135, 0, 0.1);
    color: #F08700;
}
/* 騒音レベル指標-騒がしい*/
.noise-indicator.veryloud {
    background: rgba(220, 0, 73, 0.1);
    color: #DC0049;
}
/* 超過回数バッジコンテナ */
.exceedance-box-container {
  position: absolute;
  display: none;  /* JavaScriptで制御 */
  pointer-events: auto;
  z-index: 10;
}

/* 閾値超過回数ラベル */
.exceedance-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

/* 超過回数バッジの基本スタイル */
.exceed-badge {
  min-width: 40px;
  height: 22px;
  /* padding: 0 4px; */
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  white-space: nowrap;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ホバー効果 */
.exceed-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* 0-10秒 - 青（超過なし〜ほぼ静か） */
.exceed-badge.zero {
  background-color: #BBDEFB;
  color: #1565C0;
  border-color: #64B5F6;
}

/* 11-90秒 - 緑（わずかな超過） */
.exceed-badge.low {
  background-color: #C8E6C9;
  color: #2E7D32;
  border-color: #81C784;
}

/* 91-300秒 - オレンジ（中程度の超過） */
.exceed-badge.medium {
  background-color: #FFE0B2;
  color: #E65100;
  border-color: #FFB74D;
}

/* 301秒以上(5分以上) - 赤（頻繁な超過） */
.exceed-badge.high {
  background-color: #FFCDD2;
  color: #C62828;
  border-color: #E57373;
}

/* 騒音再生ダイアログ-騒音リスト */
.audio-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    padding: 14px;
    margin-bottom: 12px;
    transition: 0 1px 2px rgba(0,0,0,.04);
}
/* カーソルを騒音再生ダイアログの騒音リストの上に乗せたとき */
.audio-card:hover {
    background: #e9ecef;
    transform: none
}
/* 騒音再生ダイアログ-騒音のデシベル値 */
.audio-item_db {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
}
/* オーディオプレーヤーのカスタマイズ */
audio::-webkit-media-controls-panel {
    background-color: white;
}

audio::-webkit-media-controls-mute-button,
audio::-webkit-media-controls-play-button,
audio::-webkit-media-controls-timeline-container,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-volume-slider-container,
audio::-webkit-media-controls-volume-slider,
audio::-webkit-media-controls-seek-back-button,
audio::-webkit-media-controls-seek-forward-button {
    display: block;
}

audio::-webkit-media-controls-overlay-play-button,
audio::-webkit-media-controls-fullscreen-button,
audio::-webkit-media-controls-toggle-closed-captions-button {
    display: none !important;
}

/* 音分類タブ */

/* 進捗バーのデザイン */
.progress-modern {
    height: 30px;
    border-radius: 15px;
    background: #f0f0f0;
    overflow: hidden;
}
/* 進捗バーのデザイン */
.progress-bar-modern {
    background: linear-gradient(90deg, #0072BC 0%, #005587 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* モバイル対応 (1024px以下) */
@media (max-width: 1024px) {
    /* スクロール領域の高さを350pxに統一（曜日表示のみ） */
    .noise-scroll-area:not(.weekly-view) {
        max-height: 350px;          /* 週間表示と同じ高さに統一 */
        overflow-y: auto;           /* 縦スクロール有効 */
    }

    /* 週間表示時はスクロール設定を解除 */
    .noise-scroll-area.weekly-view {
        max-height: none;
        overflow-y: visible;
    }

    /* 曜日別表示時はチャート高さを大きくしてスクロール可能に */
    #chartCanvasContainer:not(.weekly-view) {
        height: 700px;              /* 密集を防ぐため高さを確保 */
    }

    /* 週間表示時は350pxを維持 */
    #chartCanvasContainer.weekly-view {
        height: 350px;
    }

    /* 時間別・曜日別騒音レベルグラフ＋騒音レベル指標の横並び */
    .chart-and-legend {
        flex-direction: column;
    }

    /* モバイル時のスクロール領域（flex-direction: columnになった後に適用） */
    .noise-scroll-area {
        flex: 1 1 auto;
        width: auto;
    }
    /* 右側-騒音レベル指標 */
    .legend-col {
        display:flex;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 8px;
        justify-content:center;
    }
    /* 騒音レベル指標 */
    .noise-legend {
        display: flex;
        flex-direction: row;       /* モバイルは横並び */
        flex-wrap: nowrap;         /* 折り返しなし */
        overflow-x: auto;          /* 横スクロールON */
        -webkit-overflow-scrolling: touch;
        gap: 8px;                  /* 指標同士の余白 */
        padding: 0 8px;            /* スクロールしやすい余白 */
        justify-content: flex-start;/* 左揃え */
        align-items: center;       /* 垂直方向も中央揃え */
    }
    /* 各ボックス */
    .noise-indicator {
        display: flex;
        flex: 0 0 100px;           /* 固定幅 */
        font-size: 0.75rem;        /* PCと同じ文字サイズ */
        white-space: nowrap;       /* 折り返さない */
        font-weight: 500;
        border-radius: 25px;
        padding: 4px 16px;
        justify-content: center;
        align-items: center;       /* 垂直方向も中央揃え */
    }

    /* モバイル時のチャートラッパー（超過回数バッジ用の余白確保） */
    #chartWrapper {
        padding-left: 8px; /* Chart.js側のpadding.leftで余白を確保 */
    }

    /* モバイル時の超過回数バッジ */
    .exceed-badge {
        font-size: 11px;
        min-width: 26px;
        height: 20px;
        line-height: 20px;
        padding: 0 6px;
    }

    /* === 環境グラフ（温湿度・照度）のスクロール領域 === */
    /* 曜日別表示時はスクロール領域を有効化 */
    .env-scroll-area:not(.weekly-view) {
        max-height: 350px;
        overflow-y: auto;
    }

    /* 週間表示時はスクロール設定を解除 */
    .env-scroll-area.weekly-view {
        max-height: none;
        overflow-y: visible;
    }

    /* 曜日別表示時はチャート高さを大きくしてスクロール可能に */
    .chart-container:not(.weekly-view) {
        height: 700px;
    }

    /* 週間表示時は350pxを維持 */
    .chart-container.weekly-view {
        height: 350px;
    }
}

/* PC時のカーソルスタイル */
@media (min-width: 1025px) {
    .exceed-badge {
        cursor: pointer;
    }
}

/* === 環境グラフ（温湿度・照度）の基本スタイル === */
.env-scroll-area {
    position: relative;
    overflow-y: visible;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chart-container {
    position: relative;
    height: 350px;
}