/* スタンダードなデザイン */

.map{
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.overlay_button_blue{
    padding: 6px 6px;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background-color: rgba(0, 123, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    width: auto;
    height: auto;
    text-align: center;
}



#previewModal {
  position: fixed;       /* 画面に固定 */
  top: -10%;
  left: 0;
  width: 100vw;          /* ビューポートの横幅いっぱい */
  height: 100vh;         /* ビューポートの縦幅いっぱい */
  overflow: hidden;      /* スクロールしない */
  display: flex;         /* 中身を中央配置などにする場合 */
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  z-index: 1001;
}
/*
[class="folium-map leaflet-container leaflet-touch leaflet-retina leaflet-fade-anim leaflet-grab leaflet-touch-drag leaflet-touch-zoom"]{
  height: 100%;width: 100%;position: absolute;top: 0;left: 0; 
}
*/

.overlay_button_red{
    padding: 6px 6px;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 0, 0, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    width: auto;
    height: auto;
    text-align: center;
}

.bottom-buttons,.bottom-buttons-day{
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 10px;
    height:auto;
  }

  .map-button {
    padding: 6px 6px;
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background-color: rgba(0, 123, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    width: auto;
    height: auto;
    text-align: center;
  }

  .map-text {
    
    padding: 6px 6px;
    font-size: 24px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    appearance: none;                 /* ← ブラウザ標準のダサい矢印を消す（好みで） */
    
    text-align: center;
    height: auto;
    max-width: 60vw;          /* ← 画面幅の60%までに制限 */
    width: 100%;              /* ← 内容が多ければ最大幅まで伸びる */
  }

  .map-select {
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    appearance: none;                 /* ← ブラウザ標準のダサい矢印を消す（好みで） */
    text-align: center;
    height: auto;
    z-index: 2000;
    max-width: 60%;          /* ← 画面幅の60%までに制限 */
    width: auto;
    
  }

  .map-select-list {
    font-size: 20px;
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    width: auto;
    appearance: none;                 /* ← ブラウザ標準のダサい矢印を消す（好みで） */
    text-align: center;
  }

  .map_reset {
    position: absolute;
    bottom: 20px;
    left: 15px;
    z-index: 1000;

    display: flex;
    justify-content: center;
    align-items: center;
    
    font-size: 16px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    white-space: nowrap;
  }

  .camera-button {
    position: absolute;
    bottom: 20px;
    right: 15px;
    z-index: 1000;
    
    font-size: 20px;
    background-color: #0056b3;
    color: white;
    border: none;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    white-space: nowrap;
  }

  #previewImage {
    max-width: 20%;
    max-height: 20%;
    object-fit: contain; /* 縦横比を保持して全体を収める */
    display: block;
    margin: auto;
  }

  .help{
    content: "?";
    /*position: absolute;*/
    white-space: nowrap;
    z-index: 1000;
    font-size: 14px;
    /*right: 8%;*/
    display: block;
    /*display: inline-block;
    vertical-align: 2px;*/
    width: 1.5em;
    height: 1.5em;
    text-align: left;
    line-height: 1.5;
    border-radius: 50%;
    background: #4287f5;
    color: #007bff;
    font-weight: bold;
  }

  /* 通常のボタンスタイル */
    button {
      /*padding: 10px 20px;*/
      font-size: 16px;
      cursor: pointer;
      border: none;
      border-radius: 5px;
      background-color: #007BFF;
      color: white;
      transition: background-color 0.3s, opacity 0.3s;
    }

    /* 押せないボタンのスタイル */
    button:disabled {
      background-color: #999;
      /* 暗くする */
      cursor: not-allowed;
      /* カーソルを変更 */
      opacity: 0.6;
      /* 透明度を下げる */
    }

    .camera-button {
      display: inline-block;
      padding: 12px 24px;
      background-color: #007bff;
      /* 青色 */
      color: white;
      border-radius: 10px;
      font-size: 16px;
      cursor: pointer;
      text-align: center;
      transition: background-color 0.3s ease;
    }


    /* キャンセル：背景なし、赤文字 */
    .cancel {
      background-color: transparent;
      color: #dc3545;
      /* Bootstrap赤 */
      border: 2px solid #dc3545;
      padding: 10px 16px;
      border-radius: 8px;
      font-size: 18px;
      cursor: pointer;
    }

    /* その他：赤背景、白文字 */
    .other {
      background-color: #dc3545;
      color: white;
      border: none;
      padding: 10px 16px;
      border-radius: 8px;
      font-size: 14px;
      cursor: pointer;
    }

    /* OK：緑背景、白文字 */
    .ok {
      background-color: #28a745;
      color: white;
      border: none;
      padding: 10px 16px;
      border-radius: 8px;
      font-size: 18px;
      cursor: pointer;
    }

    .modal {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      /* 半透明な背景 */
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
    }

    .modal-content {
      background-color: white;
      padding: 20px;
      border-radius: 12px;
      text-align: center;
      max-width: 90%;
      width: 400px;
      box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
      z-index: -500;
    }

    .modal-content img {
      max-width: 100%;
      height: auto;
      border-radius: 8px;
    }

    .button-row {
      display: flex;
      justify-content: space-between;
      margin-top: 20px;
    }

    .button-row button {
      flex: 1;
      margin: 0 5px;
    }

    .modal-content img {
      max-width: 100%;
      max-height: 70vh;
      /* ← 画面の高さの70%までに制限！ */
      height: auto;
      border-radius: 8px;
      object-fit: contain;
      /* はみ出さず見せる */
    }

    .help::before {
      content: "?";
      font-size: 85%;
      margin-right: 5px;
      display: inline-block;
      vertical-align: 2px;
      width: 1.5em;
      height: 1.5em;
      text-align: left;
      line-height: 1.5;
      border-radius: 50%;
      background: #4287f5;
      color: #FFF;
      font-weight: bold;
    }

/*
#map_day\[1\],
#map_day\[2\],
#map_day\[3\],
#map_day\[4\],
#map_day\[5\],
#map_day\[6\],
#map_day\[7\]
*/
button {
    width: 120px;
    height: 40px;
    background-color: #007bff;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}

select {
    width: 30%;
    padding: 10px;
    font-size: 16px;
}

#no-swipe-zone {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px; /* 画面左端のみ */
  height: 100%;
  z-index: 9999;
  touch-action: none; /* 左端のスワイプを吸収 */
}


/* --- 通知本体のスタイル --- */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background-color: #ffffff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.215, 0.610, 0.355, 1), 
                opacity 0.5s ease;
    z-index: 1001;
    
    /* 【変更点】ポップアップ全体の最大幅を大きくしました */
    max-width: 550px; 
    width: 90%;
}

.toast-notification.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-icon {
    flex-shrink: 0;
    margin-right: 12px;
    color: #007aff;
}

.toast-message {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 500;
    /* ▼▼▼ 変更点 ▼▼▼ */
    flex-grow: 1;       /* 利用可能なスペースを埋めるように拡張 */
    text-align: left;   /* テキストを左揃えにする */
}

/* --- 閉じるボタンのスタイル --- */
.toast-close-button {
  display: flex;           /* 中央揃えのために追加 */
  align-items: center;     /* 中央揃えのために追加 */
  justify-content: center; /* 中央揃えのために追加 */
  width: 32px;             /* 固定幅で上書き */
  height: 32px;            /* 固定高で上書き */
  background: transparent;
  border: none;
  padding: 0;              /* paddingをリセット */
  margin: 0;
  margin-left: 20px;
  font-size: 2.5rem;
  line-height: 1;
  border-radius: 50%;      /* 正方形なので綺麗な円になる */
  
  /* ▼▼▼ 元々あったスタイル ▼▼▼ */
  flex-shrink: 0;
  color: #888;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toast-close-button:hover {
    color: #333;
}

.show-toast-button {
    margin-top: 2rem;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background-color: #007aff;
    color: white;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.toast-close-button:hover {
    color: #333;
}

/* オーバーレイ */
  .overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: -500;
  }
  .overlay-content {
    background: white;
    border-radius: 12px;
    padding: 15px;
    width: 90vw;       /* 画面幅の90% */
    height: 90vh;      /* 画面高さの90% */
    max-width: 1200px; /* 最大サイズ制限 */
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .overlay-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .overlay-body {
    flex: 1;
    overflow: auto; /* 内容が溢れたらスクロール */
  }
  #calendar { display: none; }
  /* カレンダー */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
  }
  .calendar-cell {
    border: 1px solid #ccc;
    padding: 5px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    font-size: 12px;
    border-radius: 6px;
  }
  .calendar-cell.empty {
    background: #f9f9f9;
  }
  /* 値ごとの色分け */
  .val-low   { background: #cce5ff; } /* 小さい値 */
  .val-mid   { background: #99cc99; } /* 中間値 */
  .val-high  { background: #ff9999; } /* 大きい値 */
  .val-zero  { background: white; }


  /* チュートリアル用のスタイル */
  #tutorial-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.0); z-index: 1001; }
  #tutorial-overlay_map { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.0); z-index: -1001; }
  #tutorial-highlight {
      position: absolute; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
      z-index: 1002; transition: all 0.3s ease-in-out; outline: 3px solid rgba(29, 161, 242, 0.8);
      animation: tutorial-pulse 1.7s infinite; pointer-events: none;
  }
  .tutorial-target-element {  z-index: 1003; }
  /* ツールチップ (【修正】トースト通知スタイルに変更) */
#tutorial-tooltip {
    /* 位置を画面上部中央に固定 */
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);

    /* 横幅を画面サイズに応じて調整 */
    max-width: 550px; 
    width: 90%;

    /* ご提示いただいたスタイルと、既存のスタイルを統合 */
    display: flex;
    flex-direction: column; /* タイトルとテキストを縦に並べる */
    align-items: center;
    padding: 16px;
    background-color: #ffffff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: opacity 0.3s ease;
    z-index: 1003; /* 常に最前面 */
}
  @keyframes tutorial-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }
  #tooltip-title { font-size: 20px; font-weight: bold; margin-bottom: 8px; color: #007bff; }
  #tooltip-text { font-size: 18px;margin-bottom: 14px; line-height: 1.6; }
  .tooltip-nav { display: flex; justify-content: space-between; align-items: center; }
  .tooltip-nav-buttons { display: flex; gap: 8px; }
  #next-step-btn {font-size: 18px;}
  /* 【追加】チュートリアルの特定テキストを赤くするためのCSS */
  .text-danger {
    color: #dc3545; /* 赤色の指定 */
    font-weight: bold; /* 少し太字にすると、より目立ちます */
  }



/* ここからスマホ対応用に追加 */
@media (max-width: 768px) {
  .overlay_button_blue,
  .overlay_button_red,
  .map-button,
  .map-text,
  .map-select,
  .map-select-list,
  .map_reset,
  .camera-button,
  button,
  select {
      font-size: 18px; /* スマホ用にフォント小さめ */
  }

  .map-text {
      font-size: 16px;
  }

  .bottom-buttons {
      flex-direction: column; /* ボタンを縦並びに */
      bottom: 10px; /* 余白少なめ */
      gap: 6px;
  }

  .bottom-buttons-day{
    left: 40%;
    bottom: 10px; /* 余白少なめ */
    gap: 6px;
  }

  .help{
    content: "?";
    /*position: absolute;*/
    white-space: nowrap;
    z-index: 1000;
    font-size: 14px;
    right: 18%;
    display: inline-block;
    vertical-align: 2px;
    top:30px;
  }

  .map_reset, .camera-button {
      bottom: 10px;
      font-size: 18px;
      padding: 10px 16px;
  }

  button {
      width: 75px;
      height: 36px;
      font-size: 14px;
  }

  select {
      width: 80%;
  }

  #previewImage {
    max-width: 50%;
    max-height: 50%;
  }
}