/* === 共通全体スタイル === */
body {
    font-family: 'Noto Serif JP', serif;
    overflow-x: hidden;
    background-color: #f8f9fa;
}

.container {
    padding: 1rem;
}

.section-title {
    border-bottom: 3px solid orange;
    background-color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
    font-size: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
}

/* === 背景カラークラス === */
.bg-hinata { background-color: #d4f4ff !important; }
.bg-sakura { background-color: #f9d6e5 !important; }
.bg-nogi   { background-color: #e4dcf1 !important; }
.bg-default { background-color: #eaf4fc !important; }

/* === ナビゲーションバー === */
.navbar-hinata {
    background-color: #00bcd4 !important;
    color: white !important;
}

.navbar-sakura {
    background-color: #880e4f !important;
    color: white !important;
}

.navbar-nogi {
    background-color: #6f42c1 !important;
    color: white !important;
}

.navbar-default {
    background-color: #fffff9 !important;
    color: black !important;
}

.navbar-hinata #menu-button,
.navbar-sakura #menu-button,
.navbar-nogi #menu-button {
    color: white;
}

.navbar-default #menu-button {
    color: black;
}

#menu-button {
    font-size: 24px;
    background: transparent;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
}

/* === サイドバー全体 === */
#sidebar {
    position: fixed;
    top: 0;
    left: 0; /* 画面左端に固定 */
    width: 30%;
    max-width: 70vw;
    height: 100vh; /* 画面全体の高さ */
    background-color: #fffeffb5;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto; /* 縦スクロール可能に */
    transition: transform 0.3s ease;
    transform: translateX(-100%);
    z-index: 9999;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#sidebar.open {
    transform: translateX(0);
}

/* === メニュー部分 === */
.sidebar-main {
    flex-grow: 1;
}

/* === リンクの共通スタイル === */
#sidebar a,
.sidebar-footer a {
    display: block;
    margin: 10px 0;
    font-size: 18px;
    font-family: 'Arial', sans-serif;
    text-decoration: none;
    color: #333;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#sidebar a:hover,
.sidebar-footer a:hover {
    background-color: #b3dcf9;
    color: rgb(87, 1, 1);
}

/* === 見出し === */
#sidebar h3 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

/* === フッター（マイページリンク） === */
.sidebar-footer {
    padding-top: 10px;
    border-top: 1px solid #ccc;
}

.sidebar-user-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8px;
    object-fit: cover;
}

/* === トップへ戻るボタン === */
#back-to-top {
    position: fixed;
    bottom: 40px;
    right: 20px;
    z-index: 9999;
    background-color: rgba(163, 212, 247, 0.8);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: none;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#back-to-top:hover {
    background-color: rgba(163, 212, 247, 1.0);
}

/* === 写真ギャラリー === */
.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.photo-item {
    text-align: center;
    width: 150px;
    max-width: 100%;
}

.photo-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
}

.missing-photo {
    filter: grayscale(100%) brightness(80%);
    opacity: 0.7;
}

.photo-info {
    margin-top: 8px;
    font-size: 0.9em;
    color: #555;
}

.logout-icon {
    color: red;
}

/* === ビュー切り替えボタン === */
.btn-group .btn.active {
    background-color: #0d6efd;
    color: white;
    font-weight: bold;
}

/* === カード表示スタイル === */
#view-card .card {
    border: none;
    border-radius: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#view-card .card:hover {
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

#view-card .card-img-top {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    height: 220px;
    object-fit: cover;
}

#view-card .card-body {
    padding: 1rem 1.25rem;
}

#view-card .btn-danger {
    margin-top: 1rem;
}

/* === 表（テーブル）表示スタイル === */
#view-table table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: white;
    width: 100%;
    box-shadow: 0 0 5px rgba(0,0,0,0.05);
}

#view-table th,
#view-table td {
    vertical-align: middle;
    text-align: center;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

#view-table img {
    border-radius: 0.25rem;
    border: 1px solid #ddd;
    max-height: 80px;
}

/* セレクトボックスの文字が見えなくなる問題の対策 */
select.form-select,
select.form-select option {
    color: #000;
    background-color: #fff;
}

/* === モバイル対応 === */
@media (max-width: 768px) {
    .photo-item {
        width: 45%;
    }

    #sidebar {
        width: 50%;
    }

    #sidebar h3 {
        font-size: 20px;
    }

    #sidebar a {
        font-size: 16px;
    }

    .navbar-hinata,
    .navbar-sakura,
    .navbar-nogi,
    .navbar-default {
        flex-direction: column;
        text-align: center;
    }

    .section-title {
        font-size: 1.8rem;
    }

    #view-card .card-img-top {
        width: 100%;
        height: auto;
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
        object-fit: contain; /* cover ではなく contain に変更 */
        aspect-ratio: 4 / 3; /* 任意で固定比率を指定（対応ブラウザであれば） */
    }

    .toggle-buttons .toggle-btn {
        margin-left: 10px;
        background-color: #f0f0f0;
        color: #333;
        border-radius: 20px;
        padding: 6px 14px;
        font-weight: bold;
        transition: background-color 0.3s, color 0.3s, box-shadow 0.2s;
        border: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .toggle-buttons .toggle-btn:first-child {
        margin-left: 0;
    }

    .toggle-buttons .toggle-btn:hover {
        background-color: #e0e0e0;
        color: #000;
    }

    .toggle-buttons .toggle-btn.active {
        background-color: orange;
        color: white;
        box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.5);
    }
}

/* 全体背景と文字色 */
body.dark-mode {
  background-color: #181a1b !important; /* #121212より少し明るめ */
  color: #e0e0e0 !important;           /* 白に近いけどやや柔らかめの文字色 */
}

/* カードやリスト項目、ナビバー、ボーダー系 */
body.dark-mode .card,
body.dark-mode .list-group-item,
body.dark-mode .navbar-hinata,
body.dark-mode .navbar-sakura,
body.dark-mode .navbar-nogi,
body.dark-mode .navbar-default {
  background-color: #24292e !important; /* 少し青みがかったダークグレー */
  color: #e0e0e0 !important;
  border-color: #444c56 !important;
}

/* ダークモードのハンバーガーメニュー */
body.dark-mode #menu-button {
    color: #fff;        /* 文字色を白に */
    background: transparent; /* 背景を透明に（必要に応じて調整） */
    border: none;       /* ボーダーがあれば消す */
    font-size: 24px;    /* サイズ調整（必要なら） */
    cursor: pointer;
}

/* サイドバー背景とリンク */
body.dark-mode #sidebar {
  background-color: #24292e !important;
  color: #e0e0e0 !important;
}

body.dark-mode #sidebar a {
  color: #58a6ff !important; /* 明るい青 */
}

body.dark-mode #sidebar a:hover {
  color: #cdd9e5 !important; /* 薄いグレー */
}

/* サイドバーの見出し（h3など） */
body.dark-mode #sidebar h3 {
  color: #cdd9e5 !important; /* 薄いグレーで読みやすく */
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* 通常リンク */
body.dark-mode a {
  color: #58a6ff !important;
}

body.dark-mode a:hover {
  color: #cdd9e5 !important;
}

/* 入力フォーム、セレクトボックス */
body.dark-mode .form-control,
body.dark-mode select,
body.dark-mode input,
body.dark-mode textarea {
  background-color: #2d333b !important;
  color: #c9d1d9 !important;
  border: 1px solid #444c56 !important;
}

/* ボタン */
body.dark-mode .btn {
  background-color: #444c56 !important;
  color: #c9d1d9 !important;
  border-color: #444c56 !important;
}

body.dark-mode .btn:hover {
  background-color: #57606a !important;
}

/* グループ背景色の上書き（勝つように） */
body.dark-mode .bg-nogi,
body.dark-mode .bg-sakura,
body.dark-mode .bg-hinata {
  background-color: #24292e !important;
  color: #e0e0e0 !important;
}
/* === マイページ設定リンクをサイドバー風に === */
.setting-links a,
.setting-links .sidebar-like-link {
    display: block;
    margin: 10px 0;
    font-size: 18px;
    font-family: 'Arial', sans-serif;
    text-decoration: none;
    color: #333;
    padding: 8px 15px;
    border-radius: 5px;
    background-color: #f5f5f5;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.setting-links a:hover,
.setting-links .sidebar-like-link:hover {
    background-color: #a3d4f7;
    color: white;
    text-decoration: none;
}

.sidebar-like-link {
    background: none;
    border: none;
    padding: 0;
    width: auto;
    cursor: pointer;
}

.small-card {
  font-size: 12px;
}

.small-card button {
  font-size: 12px;
}

.dropdown-menu {
  font-size: 13px;
  position: absolute !important;
  z-index: 9999 !important;
}

/* アコーディオン全体 */
.custom-accordion .accordion-button {
  background-color: #fff;
  border-radius: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.custom-accordion .accordion-button:hover {
  background-color: #f8f9fa;
}

.custom-accordion .accordion-button:not(.collapsed) {
  background-color: #f1f3f5;
}

/* 矢印アニメーション */
.accordion-icon {
  transition: transform 0.2s ease;
}

.accordion-button:not(.collapsed) .accordion-icon {
  transform: rotate(180deg);
}

/* タグUI */
.missing-item {
  background: white;
  border-radius: 999px;
  padding: 6px 12px;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.85rem;
  border: 1px solid #e0e0e0;
  transition: all 0.15s ease;
}

.missing-item:hover {
  background: #f8f9fa;
}

.missing-item .costume {
  font-weight: 500;
}

.missing-item .type {
  color: #6c757d;
}

.app-footer {
  background-color: #f8f9fa;
  color: #6c757d;
  font-size: 14px;
}

.app-footer a {
  color: #6c757d;
  text-decoration: none;
}

.app-footer a:hover {
  text-decoration: underline;
}

.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none;
  border: none;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 18px;
  background-color: #6c757d;
  color: white;
  cursor: pointer;
  z-index: 1000;
}

.scroll-top-btn:hover {
  background-color: #5a6268;
}

.sidebar a.text-muted {
    opacity: 0.6;
}

.sidebar a.text-muted:hover {
    opacity: 1;
    color: #ffc107 !important;
}

/* =========================
   Bootstrap風TomSelect
========================= */

.ts-control {
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  min-height: 38px;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  box-shadow: none;
}

/* フォーカス */
.ts-control.focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}

/* ドロップダウン */
.ts-dropdown {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,.15);
}

/* アイテム */
.ts-dropdown .option {
  padding: 0.375rem 0.75rem;
}

/* ホバー */
.ts-dropdown .option.active {
  background-color: #0d6efd;
  color: white;
}

/* プレースホルダ */
.ts-control input::placeholder {
  color: #6c757d;
}

/* 矢印っぽい見た目（Bootstrap風） */
.ts-control::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #6c757d;
  transform: translateY(-50%);
}

/* 位置調整 */
.ts-wrapper {
  position: relative;
}

.section-title {
  background-color: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

.small-card {
  font-size: 0.85rem;
  min-height: 80px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  transition: 0.2s ease;
}

.plan-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  text-align: left;
}

.plan-list li {
  margin-bottom: 8px;
  font-size: 14px;
}

.highlight {
  border: 2px solid #0d6efd;
  transform: scale(1.03);
}

.border-premium {
  border: 2px solid #dc3545;
}

.badge-top {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #0d6efd;
  color: white;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.badge-top.danger {
  background: #dc3545;
}

.group-card {
  background: #fff;
  border: 2px solid #eee;
  border-radius: 16px;
  padding: 30px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.group-card:hover {
  transform: translateY(-3px);
  border-color: #333;
}

.group-card.active {
  border-color: #000;
  background: #111;
  color: #fff;
}

.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.custom-modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 16px;
  width: 90%;
  max-width: 380px;
  animation: fadeIn 0.2s ease;
}