/* Guitar Fretboard Key Visualizer - Custom Styles */

/* フレットボード全体 */
.fretboard-container {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 8px;
  padding: 1rem;
}

/* 弦の行 */
.string-row {
  position: relative;
}

.string-row:hover {
  background: rgba(251, 191, 36, 0.05);
}

/* フレット */
.fret {
  position: relative;
  transition: all 0.15s ease;
}

.fret:hover {
  background: rgba(251, 191, 36, 0.1) !important;
}

/* 開放弦（ナット） */
.fret[data-fret="0"] {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
  border-right: 4px solid #64748b !important;
}

/* 音のマーカー */
.note-marker {
  transform: scale(0.8);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.note-marker.opacity-100 {
  transform: scale(1);
  animation: pulse-glow 2s infinite;
}

/* アニメーション */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
  }
}

/* ルート音の特別なアニメーション */
.note-marker.from-red-500 {
  animation: pulse-root 1.5s infinite;
}

@keyframes pulse-root {
  0%, 100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
  }
}

/* コードマーカー（四角枠） */
.chord-marker {
  pointer-events: none;
  box-sizing: border-box;
}

.chord-marker.opacity-100 {
  animation: pulse-chord 1.5s infinite;
}

@keyframes pulse-chord {
  0%, 100% {
    box-shadow: 0 0 4px rgba(34, 211, 238, 0.4);
  }
  50% {
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.7);
  }
}

/* フレットマーカー（ポジションマーク） */
.fret .absolute.w-2.h-2 {
  opacity: 0.6;
}

/* セレクトボックスのスタイル */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

select:focus {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
}

/* トグルスイッチ */
.peer:checked ~ div {
  transition: all 0.3s ease;
}

/* ダイアトニックコードボタン */
.diatonic-btn {
  transition: all 0.2s ease;
}

.diatonic-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.diatonic-btn.bg-emerald-600 {
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .fretboard-container {
    padding: 0.5rem;
  }
  
  .note-marker {
    width: 1.5rem !important;
    height: 1.5rem !important;
    font-size: 0.5rem !important;
  }
  
  .fret {
    height: 2.5rem !important;
  }
  
  .string-row > div:first-child {
    width: 3rem !important;
    font-size: 0.6rem !important;
  }
  
  .diatonic-btn {
    min-width: 55px !important;
    padding: 0.5rem !important;
    font-size: 0.75rem;
  }
}

/* スクロールバーのスタイル */
::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* フェードイン効果 */
.fretboard-container {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ホバー時のツールチップ風エフェクト */
.note-marker:hover {
  z-index: 20;
  transform: scale(1.2) !important;
}

/* 弦の太さの視覚化 */
.string-row:nth-child(2) .absolute.w-full { height: 1px !important; }
.string-row:nth-child(3) .absolute.w-full { height: 1.2px !important; }
.string-row:nth-child(4) .absolute.w-full { height: 1.5px !important; }
.string-row:nth-child(5) .absolute.w-full { height: 1.8px !important; }
.string-row:nth-child(6) .absolute.w-full { height: 2.2px !important; }
.string-row:nth-child(7) .absolute.w-full { height: 2.5px !important; }
