/* ============================================================
   style.css — Vocab Master 1900 共通スタイル
   ============================================================ */

:root {
  --grad-1: #6366f1;
  --grad-2: #8b5cf6;
  --grad-3: #ec4899;
}

* { scroll-behavior: smooth; }

html, body {
  font-family: 'Noto Sans JP', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: #f8fafc;
  transition: background-color .3s ease, color .3s ease;
}

html.dark body {
  background: #0f1120;
}

/* ---------- スクロールバー ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--grad-1), var(--grad-2));
  border-radius: 8px;
}

/* ---------- グラデーションテキスト ---------- */
.text-gradient {
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2), var(--grad-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- グラスモーフィズム ---------- */
.glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}
html.dark .glass {
  background: rgba(24, 26, 46, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- フェード・スライドアニメーション ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeUp { animation: fadeUp .5s ease both; }

@keyframes popIn {
  0% { opacity: 0; transform: scale(.92); }
  100% { opacity: 1; transform: scale(1); }
}
.animate-popIn { animation: popIn .35s ease both; }

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

/* ---------- フラッシュカード 3D フリップ ---------- */
.flip-scene {
  perspective: 1600px;
}
.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .55s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.flip-card.is-flipped {
  transform: rotateY(180deg);
}
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 1.5rem;
}
.flip-face.back {
  transform: rotateY(180deg);
}

/* ---------- カードスワイプ用トランジション ---------- */
.card-slide-left {
  animation: slideLeft .28s ease forwards;
}
.card-slide-right {
  animation: slideRight .28s ease forwards;
}
@keyframes slideLeft {
  to { transform: translateX(-120%) rotate(-8deg); opacity: 0; }
}
@keyframes slideRight {
  to { transform: translateX(120%) rotate(8deg); opacity: 0; }
}

/* ---------- レベルバッジ ---------- */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ---------- 進捗バー ---------- */
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.25);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
  transition: width .5s ease;
}

/* ---------- 単語カード（辞書） ---------- */
.word-row {
  transition: background-color .18s ease, transform .18s ease;
}
.word-row:hover {
  transform: translateX(2px);
}

/* ---------- トースト通知 ---------- */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.toast {
  padding: .7rem 1.1rem;
  border-radius: .8rem;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,.3);
  animation: popIn .25s ease both;
}

/* ---------- チェックボタン等 ---------- */
.btn-press:active { transform: scale(.96); }

/* ---------- ロード中スケルトン ---------- */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 37%, #e2e8f0 63%);
  background-size: 400px 100%;
  animation: shimmer 1.4s infinite linear;
}
html.dark .skeleton {
  background: linear-gradient(90deg, #1e2140 25%, #262a4d 37%, #1e2140 63%);
  background-size: 400px 100%;
}

/* ---------- モバイルナビ ---------- */
.nav-link {
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--grad-1), var(--grad-2));
}
