/* ===============================
   Google Fonts の読み込み
=============================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

/* ===============================
   全体の基本設定
=============================== */
body {
  font-family: 'Noto Sans JP', sans-serif !important;
  margin: 0;
  padding: 0;
}
#main-header.container,
main.container {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* ===============================
   ヘッダー
=============================== */
#main-header {
  background-color: #526d82 !important;
  height: 50px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
#main-header .logo {
  /* ロゴはそのまま左寄せ */
}
#main-header .title {
  font-family: 'Montserrat', sans-serif !important;
  color: #FFFFFF !important;
  margin-left: 10px !important;
  font-size: 1.3rem !important;
}
#main-header .dropdown-toggle {
  background-color: #526d82 !important;
  border: none !important;
  color: #FFFFFF !important;
}
.dropdown-menu {
  background-color: #526d82 !important;
  border: none !important;
}
.dropdown-item {
  color: #FFFFFF !important;
}
.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}
.menu-icon {
  color: #FFFFFF !important;
  font-size: 1.3rem !important;
  margin-right: 10px !important;
}

#hamburgerMenu:focus {
  outline: none !important;
  box-shadow: none !important;
}

.speech-bubble {
  position: absolute;
  left: 50px; 
  top: 50%; 
  transform: translateY(-50%); 
  background-color: #fff;
  color: #324454;
  border-radius: 10px;
  padding: 5px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  
  opacity: 0;
  visibility: hidden;
  
  z-index: 10;  /* 吹き出し本体全体の z-index */
  white-space: nowrap;
  pointer-events: none;
}

/* 通常時のフォントサイズ */
.speech-bubble {
  font-size: 1rem;  /* 例: 通常のフォントサイズ */
}

/* 文字数が多い場合用のクラス */
.speech-bubble.long {
  font-size: 0.8rem;  /* フォントサイズを小さく調整 */
}

.speech-bubble.visible {
  opacity: 1;
  visibility: visible;
  border: 1px solid #526d82;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  z-index: 9;  /* 吹き出し本体より下に配置 */
  top: -6px;   /* この値を変更すると三角形の縦位置が調整できます */
  left: -10px;
  width: 20px;
  height: 30px;
  border-radius: 0 0 0 15px;
  box-shadow: -3px -15px 0 -7px #fff inset;
}


/* ===============================
   カレンダー
=============================== */
.month-display-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 15px !important;
  font-family: 'Noto Sans JP', sans-serif !important;
  color: #324454 !important;
  font-size: 1.2rem !important;
}
.month-nav {
  cursor: pointer !important;
  user-select: none;
  margin: 0 5px !important;
}
.calendar,
.calendar-grid {
  border: none !important;
}
.calendar-header {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  text-align: center !important;
  font-weight: bold !important;
  width: 100% !important;
  font-family: 'Noto Sans JP', sans-serif !important;
  background-color: #FFFFFF !important;
  color: #324454 !important;
  border: none !important;
}
.calendar-header .header-cell {
  padding: 5px 0 !important;
}
.calendar-day {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 90px;
  border-right: 1px solid #526d82;
  border-bottom: 1px solid #526d82;
  background-color: #fff;
  color: #324454;
  text-align: center;
}
.calendar-day:nth-child(7n) {
  border-right: none;
}
.empty-day {
  border-right: 1px solid #526d82;
  border-bottom: 1px solid #526d82;
  background-color: #f9f9f9;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 120px;
  text-align: center;
}
.empty-day:nth-child(7n) {
  border-right: none;
}
.day-info {
  grid-row: 1;
  justify-self: center;
  align-self: start;
  margin-top: 5px;
  font-size: 0.9rem;
  font-weight: bold;
}

.day-info.today {
  width: 20px;        /* 固定幅 */
  height: 20px;       /* 固定高さ */
  border: 1px solid #526d82;
  border-radius: 50%; /* 完全な円形にする */
  display: flex;      /* 中央にテキストを配置 */
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;  /* 必要に応じて調整 */
  /* 余分なpaddingは削除または調整 */
  padding: 0;
}

.day-summary {
  grid-row: 2;
  justify-self: center;
  align-self: center;
  min-height: 20px;
  font-size: 0.8rem;
  color: #324454;
}
.edit-button {
  grid-row: 3;
  justify-self: center;
  align-self: end;
  margin-bottom: 5px;
  background-color: #f9f9f9;
  border: 1px solid #526d82;
  border-radius: 4px;
  width: 25px;
  height: 25px;  
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}
.edit-button:hover {
  background-color: #526d82;
  color: #fff;
}

/* ===============================
   iPhone SE 対応（max-width: 375px）
=============================== */
@media (max-width: 375px) {
  .container {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
  #main-header .title {
    font-size: 1.2rem !important;
  }
  .month-display-wrapper {
    font-size: 1rem !important;
  }
  .calendar-header {
    font-size: 0.85em !important;
    margin-top: 5px;
  }
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr) !important;
    font-size: 0.75em !important;
  }
  .calendar-day {
    min-height: 90px !important;
    padding: 3px !important;
  }
  .day-info {
    font-size: 0.9em !important;
  }
  .edit-button {
    font-size: 0.7em !important;
    margin-bottom: 3px !important;
    justify-self: center !important;
    align-self: end !important;
  }
}

/* ---------------------------------
   モーダル全体のベース
---------------------------------- */
.modal-content {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.9rem;
  background-color: #fff;
}
.modal-form {
  box-sizing: border-box;
  width: 100%;
  padding: 15px;
}
.modal-section {
  margin-bottom: 15px;
}
.modal-footer {
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}

/* ---------------------------------
   種目入力行 (.exercise-row)
   各行をFlexで5列に分割
---------------------------------- */
.exercise-row {
  display: flex;
  gap: 10px;          /* カラム間の余白 */
  margin-bottom: 10px;
}
.exercise-row > div {
  flex: 1;            /* 5列を等幅に */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 入力欄 (Bootstrapの.form-controlを上書き) */
.exercise-row .form-control {
  width: auto !important;   /* デフォルトのwidth:100%を解除 */
  min-width: 0 !important;
  font-size: 0.85rem !important;
  text-align: center;       /* 文字を中央寄せ */
  box-sizing: border-box;
  padding: 0.3rem 0.5rem !important;
}

/* 種目の最小幅 (全角3~4文字程度) */
.exercise-name,
.exercise-name-select {
  max-width: 5.5em;
}
/* 負荷 (半角4~5文字分) */
.exercise-weight {
  max-width: 4em;
}
/* 回数 (半角2~3文字分) */
.exercise-reps {
  max-width: 3em;
}
/* セット (半角2文字分) */
.exercise-sets {
  max-width: 3em;
}

/* ゴミ箱ボタン (削除ボタン) */
.exercise-row .btn.btn-danger {
  font-size: 0.9rem;
  padding: 0.5rem 0.5rem;
  line-height: 1.2;
  background-color: #526d82;
  border-color: #526d82;
  color: #fff;
}
.exercise-row .btn.btn-danger:hover {
  background-color: #435f70;
  border-color: #435f70;
  color: #fff;
}
.exercise-row .btn.btn-danger i {
  font-size: 0.9rem;
}

/* ---------------------------------
   種目追加・保存ボタン (.custom-btn)
---------------------------------- */
.custom-btn {
  width: 30px;
  height: 30px;
  /* アイコンやテキストを上下中央に配置 */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 他のスタイル（背景色や枠線、色など） */ 
  background-color: #f9f9f9;
  border: 1px solid #526d82;
  color: #526d82;
  border-radius: 4px;
  padding: 0;
  font-size: 1rem;
}

.custom-btn2 {
  background-color: #fff;
  border: none; 
  color: #526d82;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  width: 30px;
  height: 30px;
  /* アイコンやテキストを上下中央に配置 */
  display: flex;
  align-items: center;
  justify-content: center;
  /* 他のスタイル（背景色や枠線、色など） */
  background-color: #fff;
  border: none ;
  color: #526d82;
  border-radius: 4px;
  padding: 0;
  font-size: 1rem;
}

.custom-btn:hover {
  background-color: #435f70;
  border-color: #435f70;
  color: #fff;
}

/* 隠しフィールド（modal-date） */
#modal-date {
  display: none;
}

/* ===============================
   モーダル全体のスタイル調整
=============================== */
.modal-custom {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.9rem;
  background-color: #fff;
  color: #526d82; /* モーダル内の文字色 */
}

/* -------------------------------
   モーダルヘッダーのカスタムスタイル
------------------------------- */
.modal-header-custom {
  background-color: #526d82 !important;
  color: #fff !important;
  /* ヘッダーと本文の間隔を狭めるためにパディングを調整 */
  padding-bottom: 0.5rem !important;
  margin-bottom: 0;
}

.modal-header-custom .modal-title {
  color: #fff !important;
}

/* -------------------------------
   モーダル本文の上部パディング調整
------------------------------- */
.modal-body {
  padding-top: 0.5rem !important;
}

/* ===============================
   プレースホルダーの文字色（既存の記述）
=============================== */
.exercise-weight::placeholder,
.exercise-reps::placeholder,
.exercise-sets::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

/* 部位選択（ドロップダウン）とメモ欄の文字サイズを統一 */
#bodyPartSelect,
#modalMemo {
  font-size: 0.9rem !important;
}

.modal-header .close span {
  color: #fff !important;
}

/* メモ */

.memo-page {
  font-family: 'Noto Sans JP', sans-serif;
  color: #324454;
}

.memos {
  margin-top: 15px;
}

/* ===============================
   ページインジケーター (earth.html用)
=============================== */
.page-indicator {
  text-align: center;
  padding: 10px 0;
}

.page-indicator .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  background-color: #bbb;
  border-radius: 50%;
  cursor: pointer; /* クリック可能であることを示すカーソル */
}

.page-indicator .dot.active {
  background-color: #526d82; /* アクティブなドットの色 */
}