/* ========================================================
   RyotaKaraOK - 共通スタイルシート (style.css)
   ======================================================== */

/* --- 基本設定 --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  position: relative;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  min-height: 100vh;
}

/* --- コンテナ & ヘッダー --- */
.app-container {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

header.sticky-top {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

[data-bs-theme="dark"] header.sticky-top {
  background: rgba(33, 37, 41, 0.95);
}

/* --- ページトップボタン --- */
#page_top {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
}

/* --- データ表示エリア --- */
#data {
  margin: 1rem auto 10rem;
  padding: 0 1rem;
}

.row {
  margin: 0.5rem 0;
}

/* --- 見出し（五十音行・日付） --- */
h2.row_name {
  margin: 1.5rem 0 0.5rem !important;
  font-size: 1.4rem;
  font-weight: bold;
  border-bottom: 2px solid var(--bs-border-color);
  padding-bottom: 0.3rem;
  cursor: pointer;
}

/* ページごとの見出しアクセントカラー */
.page-all-songs h2.row_name    { color: #0d6efd; }
.page-can-sing h2.row_name     { color: #198754; }
.page-anime h2.row_name        { color: #d63384; }
.page-practice h2.row_name     { color: #ffaa00; }
.page-first-sight h2.row_name  { color: #0dcaf0; }
.page-cannot-sing h2.row_name  { color: #6c757d; }
.page-history h2.row_name      { color: #212529; }

[data-bs-theme="dark"] .page-history h2.row_name {
  color: #f8f9fa;
}
[data-bs-theme="dark"] .page-cannot-sing h2.row_name {
  color: #adb5bd;
}

/* --- アーティスト & 楽曲グループ --- */
.artist {
  margin: 1rem 0 0.25rem 0.5rem;
}

.artist .artist_name {
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--bs-body-color);
}

.songs {
  display: none;
  margin: 0.3rem 0 0.5rem 1rem;
}

/* 履歴ページでは初期展開 */
.page-history .songs {
  display: block;
}

.song_item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--bs-border-color);
}

.song_name {
  margin-bottom: 0;
  color: var(--bs-secondary-color);
}

.copy-btn {
  font-size: 0.75rem;
  padding: 0.15rem 0.55rem;
  border-radius: 0.4rem;
  white-space: nowrap;
  transition: all 0.2s;
}

/* --- アニメソング固有スタイル --- */
.anime-group {
  margin: 1rem 0 0.25rem 0.5rem;
}

.anime_title {
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--bs-body-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.anime_title:hover {
  color: #d63384;
}

.page-anime .songs {
  margin: 0.4rem 0 0.8rem 1rem;
}

.page-anime .song_item {
  padding: 0.35rem 0;
}

.song_info {
  flex-grow: 1;
  padding-right: 0.5rem;
}

.page-anime .song_name {
  font-weight: 500;
  color: var(--bs-body-color);
  margin-bottom: 0.1rem;
}

.page-anime .artist_name {
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.page-anime .copy-btn {
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
}

/* --- 履歴固有スタイル --- */
.page-history .song_name {
  margin-bottom: 0.3rem;
}

span.ib {
  display: inline-block;
}

/* --- ポータル（トップページ） --- */
.page-portal {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.portal-card {
  max-width: 500px;
  width: 100%;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 2rem 2rem 2.5rem;
}

[data-bs-theme="dark"] .portal-card {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.portal-title {
  font-weight: bold;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--bs-body-color);
}

.menu-btn {
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}

.menu-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.menu-btn-warning {
  color: #997404;
  border-color: #ffc107;
}

.menu-btn-warning:hover {
  background-color: #ffc107;
  color: #000;
}

[data-bs-theme="dark"] .menu-btn-warning {
  color: #ffc107;
  border-color: #ffc107;
}

[data-bs-theme="dark"] .menu-btn-warning:hover {
  background-color: #ffc107;
  color: #000;
}

.menu-btn-info {
  color: #087990;
  border-color: #0dcaf0;
}

.menu-btn-info:hover {
  background-color: #0dcaf0;
  color: #000;
}

[data-bs-theme="dark"] .menu-btn-info {
  color: #0dcaf0;
  border-color: #0dcaf0;
}

[data-bs-theme="dark"] .menu-btn-info:hover {
  background-color: #0dcaf0;
  color: #000;
}

[data-bs-theme="dark"] .menu-btn-dark {
  color: #dee2e6;
  border-color: #6c757d;
}

[data-bs-theme="dark"] .menu-btn-dark:hover {
  background-color: #dee2e6;
  color: #212529;
}

/* --- 404 ページ --- */
.page-404 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.card-box {
  max-width: 420px;
  width: 100%;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .card-box {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* --- ローディングアニメーション --- */
.dot {
  animation-duration: 1s;
  animation-name: popin;
  animation-iteration-count: infinite;
}

@keyframes popin {
  from { width: 1em; margin-left: 0.5em; }
  50% { width: 1em; margin-left: 0; }
  to { width: 1em; margin-left: 0.5em; }
}

/* --- 並び順バッジ調整 --- */
[data-bs-theme="dark"] #current_order {
  background-color: #2b3035 !important;
  color: #dee2e6 !important;
  border-color: #495057 !important;
}
