/* ========================================
   楽器診断 スタイルシート
   ======================================== */

/* ===== カラー変数 ===== */
:root {
  --primary-color: #9333ea;
  --primary-light: #a855f7;
  --primary-dark: #7e22ce;
  --secondary-color: #ec4899;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --background: #faf5ff;
  --surface: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* ===== 基本設定 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== ヒーローセクション ===== */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  margin-bottom: 40px;
  border-radius: 0 0 30px 30px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.95;
  margin-bottom: 10px;
}

.hero-description {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ===== バナースロット ===== */
.banner-slot {
  margin: 30px auto;
  text-align: center;
}

/* ===== 診断コンテナ ===== */
#quiz-container {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
}

/* ===== プログレスバー ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 30px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  transition: width 0.5s ease;
}

/* ===== 質問 ===== */
.question-number {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

.question-text {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--text-primary);
}

/* ===== 選択肢ボタン ===== */
.options-container {
  display: grid;
  gap: 16px;
  margin-bottom: 30px;
}

.option-btn {
  width: 100%;
  padding: 20px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  background: white;
  border: 3px solid var(--border-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.option-btn:hover {
  border-color: var(--primary-color);
  background: #faf5ff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.option-btn.selected {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: transparent;
  transform: scale(0.98);
}

.back-btn {
  padding: 12px 24px;
  font-size: 1rem;
  background: transparent;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.back-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ===== 結果表示 ===== */
.result-container {
  text-align: center;
}

.result-title {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.top-result {
  margin-bottom: 40px;
}

.instrument-emoji {
  font-size: 8rem;
  margin-bottom: 20px;
  animation: bounce 1s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.instrument-name {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.instrument-main-name {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.instrument-personality {
  font-size: 1.4rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ===== 楽器詳細 ===== */
.instrument-details {
  max-width: 700px;
  margin: 0 auto 40px;
  text-align: left;
}

.instrument-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 30px;
  padding: 20px;
  background: #faf5ff;
  border-radius: 12px;
}

.instrument-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-item {
  background: white;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* ===== 特性タグ ===== */
.matched-traits h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.trait-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.trait-tag {
  padding: 8px 16px;
  background: #e5e7eb;
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.trait-tag.matched {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

/* ===== マッチ理由 ===== */
.match-reasons {
  margin: 30px 0;
  padding: 20px;
  background: #fef3c7;
  border-left: 4px solid var(--accent-color);
  border-radius: 8px;
}

.match-reasons h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.reasons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.reasons-list li {
  padding: 8px 0;
  font-size: 1rem;
  color: var(--text-primary);
  position: relative;
  padding-left: 24px;
}

.reasons-list li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* ===== 診断方法論 ===== */
.diagnosis-methodology {
  margin: 30px 0;
  padding: 24px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
}

.diagnosis-methodology h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.diagnosis-methodology > p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.methodology-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.methodology-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-primary);
}

.methodology-list li:last-child {
  border-bottom: none;
}

.methodology-list strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* ===== 他の楽器候補 ===== */
.other-results {
  margin: 40px 0;
}

.other-results h4 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.other-instruments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.other-instrument-card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.other-instrument-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.other-emoji {
  font-size: 3rem;
  margin-bottom: 12px;
}

.other-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.other-personality {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* ===== アクションボタン ===== */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-top: 40px;
}

.btn {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ===== 楽器一覧ページ ===== */
.instruments-header {
  text-align: center;
  margin-bottom: 40px;
}

#instrument-count {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.filters-container {
  margin-bottom: 30px;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

#category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  padding: 10px 20px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

#sort-select {
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

#instruments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.instrument-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.instrument-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.card-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-category {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.card-personality {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 600;
}

.card-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.card-stat {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
}

/* ===== モーダル ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f3f4f6;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
}

.modal-close:hover {
  background: #e5e7eb;
  transform: rotate(90deg);
}

.modal-header {
  text-align: center;
  padding: 40px 20px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 20px 20px 0 0;
}

.modal-emoji {
  font-size: 5rem;
  margin-bottom: 16px;
}

.modal-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.modal-personality {
  font-size: 1.2rem;
  opacity: 0.95;
}

.modal-body {
  padding: 30px;
}

.modal-description {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding: 16px;
  background: #faf5ff;
  border-radius: 12px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.modal-stat {
  background: white;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  text-align: center;
}

.modal-traits {
  margin-bottom: 24px;
}

.modal-traits h4 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-actions .btn {
  flex: 1;
}

/* ===== 相性診断ページ ===== */
.compatibility-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 40px;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.selector-container {
  margin-bottom: 40px;
}

.selector-container h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  text-align: center;
  color: var(--text-primary);
}

.instrument-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 20px;
  background: white;
  border-radius: 16px;
  border: 2px solid var(--border-color);
}

.instrument-select-btn {
  padding: 16px 12px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.instrument-select-btn:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}

.instrument-select-btn.selected {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: transparent;
}

.select-emoji {
  font-size: 2.5rem;
}

.select-name {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

#check-compatibility-btn {
  display: block;
  margin: 40px auto;
  padding: 16px 40px;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

#check-compatibility-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

#check-compatibility-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#compatibility-result {
  display: none;
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  margin-top: 40px;
}

.compatibility-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.compat-instrument {
  text-align: center;
}

.compat-emoji {
  font-size: 5rem;
  margin-bottom: 12px;
}

.compat-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.compat-heart {
  font-size: 3rem;
  animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.compatibility-score {
  text-align: center;
  margin-bottom: 40px;
}

.score-label {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.score-value {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.score-bar {
  width: 100%;
  max-width: 500px;
  height: 20px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 16px;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  transition: width 1s ease;
}

.score-rating {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.compatibility-comment {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 20px;
  background: #faf5ff;
  border-radius: 12px;
}

.compatibility-breakdown {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 40px;
}

.compatibility-breakdown h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.breakdown-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.breakdown-list {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

.breakdown-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.breakdown-list li:last-child {
  border-bottom: none;
}

.breakdown-list strong {
  color: var(--primary-color);
  font-weight: 600;
}

.breakdown-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}


.compatibility-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.detail-column h4 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.detail-personality {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 600;
}

.detail-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  #quiz-container {
    padding: 24px;
  }
  
  .question-text {
    font-size: 1.4rem;
  }
  
  .option-btn {
    font-size: 1rem;
    padding: 16px 20px;
  }
  
  .instrument-main-name {
    font-size: 2.2rem;
  }
  
  .instrument-emoji {
    font-size: 6rem;
  }
  
  #instruments-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
  
  .compatibility-header {
    gap: 20px;
  }
  
  .compat-emoji {
    font-size: 3.5rem;
  }
  
  .score-value {
    font-size: 3.5rem;
  }
  
  .instrument-select-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}
