/* ====================================
   コード進行マスター — Custom Styles
   ==================================== */

/* スクロールバー */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

/* スクロールバー非表示ユーティリティ */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* テキスト選択色 */
::selection {
  background: rgba(168, 85, 247, 0.3);
  color: white;
}

/* スムーズスクロール */
html {
  scroll-behavior: smooth;
}

/* ボディの最低高さ */
body {
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* レッスンコンテンツ内のスタイリング */
.lesson-content p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.lesson-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #d8b4fe;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.lesson-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #c4b5fd;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.lesson-content strong {
  color: #ffffff;
  font-weight: 600;
}

.lesson-content ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.lesson-content li {
  color: #d1d5db;
  line-height: 1.8;
  margin-bottom: 0.25rem;
  padding-left: 0.25rem;
}

.lesson-content code {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 0.375rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  color: #c084fc;
}

.lesson-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.lesson-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #e2e8f0;
}

/* コードボタンのアニメーション */
.chord-btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chord-btn:active {
  transform: scale(0.95);
}

/* パルスアニメーション（再生中のコード） */
@keyframes chord-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.4); }
  50% { box-shadow: 0 0 20px 4px rgba(168, 85, 247, 0.2); }
}

.chord-btn.ring-2 {
  animation: chord-pulse 1s ease-in-out infinite;
}

/* カレンダーのアニメーション */
@keyframes calendar-pop {
  0% { transform: scale(0); }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Range input カスタマイズ */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #a855f7;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #c084fc;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #a855f7;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* フェードインアニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* プログレスバーのアニメーション */
@keyframes progress-shine {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* グロー効果 */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
  }
}

/* バウンスアニメーション（バッジ獲得時） */
@keyframes badge-bounce {
  0% { transform: scale(0) rotate(-30deg); }
  50% { transform: scale(1.2) rotate(10deg); }
  70% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* レスポンシブ調整 */
@media (max-width: 640px) {
  .lesson-content {
    font-size: 0.9375rem;
  }

  .lesson-content h2 {
    font-size: 1.125rem;
  }

  .lesson-content h3 {
    font-size: 1rem;
  }
}

/* 印刷スタイル（非表示要素） */
@media print {
  nav, button, .nav-btn, input[type="range"] {
    display: none !important;
  }
}
