/* ===================================================
   海都トレーニングアプリ 共通スタイルシート
   =================================================== */

:root {
  --primary: #1a3a4a;
  --primary-light: #2d5a6e;
  --accent: #c8773a;
  --accent-dark: #a85f2a;
  --bg: #faf8f3;
  --card-bg: #ffffff;
  --section-bg: #f0ebe0;
  --text: #2d2d2d;
  --text-muted: #6b7280;
  --border: #e2d9c8;
}

* { box-sizing: border-box; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  margin: 0;
  padding: 0;
  color: var(--text);
}

/* ===== ヘッダー ===== */
.app-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.app-header-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  line-height: 1.3;
}

.app-header p.subtitle {
  margin: 3px 0 0;
  font-size: 10px;
  opacity: 0.65;
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-btn {
  position: absolute;
  left: 20px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 13px;
  background: rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.2s;
  white-space: nowrap;
}
.back-btn:hover { background: rgba(255,255,255,0.25); }

/* ===== コンテナ ===== */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ===== INDEX: カテゴリセクション ===== */
.category-section {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--section-bg);
  border-bottom: 1px solid var(--border);
}

.category-icon { font-size: 17px; }

.category-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--primary);
  flex: 1;
}

.category-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ===== INDEX: メニューボタン ===== */
.menu-btn {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid #f5f0e8;
  transition: background 0.15s;
  gap: 14px;
}
.menu-btn:last-child { border-bottom: none; }
.menu-btn:hover { background: #fdf9f4; }

.btn-icon {
  font-size: 22px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.btn-body { flex: 1; }

.btn-text {
  font-weight: bold;
  font-size: 15px;
  color: var(--text);
  line-height: 1.3;
}

.btn-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

.btn-arrow {
  color: #c8bfb0;
  font-size: 13px;
  flex-shrink: 0;
}

/* スタイルブックボタン（特別） */
.menu-btn.book {
  background: linear-gradient(135deg, #fdf6ec, #faf0e0);
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid #f5f0e8;
}
.menu-btn.book .btn-text { color: var(--accent-dark); }
.menu-btn.book .btn-arrow { color: var(--accent); }
.menu-btn.book:hover { background: linear-gradient(135deg, #faeede, #f5e8d0); }

/* ツールセクション */
.category-section.tools .category-header { background: #eae8e4; }
.category-section.tools .menu-btn { border-bottom-color: #edebe7; }
.category-section.tools .menu-btn:hover { background: #f5f4f1; }

/* ===== LESSON: ページ説明文 ===== */
.lesson-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 16px 0 20px;
  line-height: 1.7;
}

/* ===== LESSON: 動画エリア ===== */
.video-box {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.video-box iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.fullscreen-btn {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--primary-light);
  text-decoration: none;
  border: 1px solid var(--primary-light);
  padding: 5px 14px;
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.fullscreen-btn:hover { background: var(--primary-light); color: white; }

/* ===== LESSON: クイズカード ===== */
.quiz-card {
  background: linear-gradient(135deg, #fdf6ec 0%, #faf0e0 100%);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 24px 20px;
  margin-top: 32px;
  margin-bottom: 16px;
  text-align: center;
}

.quiz-title {
  font-size: 17px;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 10px;
}

.quiz-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.7;
}

.quiz-btn {
  display: block;
  width: 85%;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 15px 0;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(200, 119, 58, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.quiz-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(200, 119, 58, 0.45);
}

.hint {
  font-size: 11px;
  color: #b0a898;
  margin-top: 14px;
}

/* ===== LESSON: 前後ナビゲーション ===== */
.page-nav {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.nav-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: bold;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  text-align: center;
  line-height: 1.4;
}
.nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-btn.next { border-color: var(--primary); color: var(--primary); }
.nav-btn.next:hover { background: var(--primary); color: white; }

/* ===== LESSON: 動画スピナー ===== */
.video-wrapper { position: relative; border-radius: 12px; overflow: hidden; }

.video-spinner {
  position: absolute;
  inset: 0;
  background: #111;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  z-index: 2;
}

.spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== INDEX: 完了バッジ ===== */
.completion-badge {
  background: #2e7d32;
  color: white;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.completion-badge.hidden { display: none; }

/* ===== LOGIN ページ ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 36px 28px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

.login-card h2 {
  font-size: 18px;
  color: var(--primary);
  margin: 0 0 6px;
}

.login-card .login-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 24px;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 16px;
  text-align: center;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}
.login-input:focus { border-color: var(--primary); }

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
}
.login-btn:hover { opacity: 0.88; }

.login-error {
  color: #c0392b;
  font-size: 12px;
  margin-top: 12px;
  display: none;
}

.login-back {
  display: block;
  margin-top: 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
}
.login-back:hover { color: var(--primary); }

/* ===== フッター ===== */
.footer {
  text-align: center;
  font-size: 11px;
  color: #c0b8ac;
  padding: 20px 0 30px;
}
