/* ========================================
   高専病診断アプリ v2.0 - 16Personalities風デザイン
   明るく洗練された診断UIを実現
   ======================================== */

:root {
  /* 16Personalities風カラーパレット */
  --primary-bg: #FFFFFF;
  --secondary-bg: #F5F7FA;
  --card-bg: #FFFFFF;
  --text-primary: #2D3748;
  --text-secondary: #718096;
  --text-muted: #A0AEC0;
  
  /* アクセントカラー */
  --accent-purple: #667EEA;
  --accent-blue: #4FACFE;
  --accent-green: #00F2FE;
  
  /* ボタンカラー */
  --btn-inactive: #EDF2F7;
  --btn-hover: #E2E8F0;
  --btn-active: #667EEA;
  
  /* プログレスバー */
  --progress-bg: #E2E8F0;
  --progress-fill: linear-gradient(90deg, #4FACFE 0%, #00F2FE 100%);
  
  /* シャドウ */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  
  /* トランジション */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--secondary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========================================
   ハンバーガーメニュー
   ======================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--primary-bg);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.hamburger {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px;
  transition: var(--transition-fast);
}

.hamburger:hover {
  background: var(--btn-hover);
  border-radius: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-info {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* サイドドロワー */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
  z-index: 1100;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--primary-bg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.drawer.active {
  left: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid #E2E8F0;
}

.drawer-header h2 {
  font-size: 20px;
  color: var(--text-primary);
}

.drawer-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.drawer-nav a {
  display: block;
  padding: 14px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.drawer-nav a:hover {
  background: var(--secondary-bg);
  color: var(--accent-purple);
}

.drawer-footer {
  padding: 20px;
  border-top: 1px solid #E2E8F0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ========================================
   プログレスバー
   ======================================== */

.progress-container {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--progress-bg);
  z-index: 999;
}

.progress-bar {
  height: 100%;
  background: var(--progress-fill);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

/* ========================================
   診断ページレイアウト
   ======================================== */

.diagnosis-container {
  min-height: 100vh;
  padding-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 20px;
  padding-right: 20px;
}

.question-number {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}

.question-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 40px 32px;
  max-width: 700px;
  width: 100%;
  margin-bottom: 40px;
  transition: var(--transition-smooth);
}

.question-card:hover {
  box-shadow: var(--shadow-lg);
}

.question-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.4;
}

/* ========================================
   5段階ボタン（16Personalities風）
   ======================================== */

.answer-section {
  max-width: 700px;
  width: 100%;
}

.answer-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.answer-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.answer-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.answer-btn:hover .answer-circle {
  background: var(--btn-hover);
  transform: translateY(-2px);
}

.answer-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--btn-inactive);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all var(--transition-smooth);
  border: 2px solid transparent;
}

/* サイズのバリエーション */
.answer-btn:nth-child(1) .answer-circle {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.answer-btn:nth-child(2) .answer-circle {
  width: 45px;
  height: 45px;
  font-size: 15px;
}

.answer-btn:nth-child(3) .answer-circle {
  width: 50px;
  height: 50px;
  font-size: 16px;
}

.answer-btn:nth-child(4) .answer-circle {
  width: 55px;
  height: 55px;
  font-size: 17px;
}

.answer-btn:nth-child(5) .answer-circle {
  width: 60px;
  height: 60px;
  font-size: 18px;
}

.answer-btn.selected .answer-circle {
  background: var(--btn-active);
  color: white;
  border-color: var(--btn-active);
  transform: scale(1.1);
}

.answer-label {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.answer-btn.selected .answer-label {
  color: var(--accent-purple);
  font-weight: 600;
}

/* ========================================
   トップページ
   ======================================== */

.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px 60px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
}

.hero-cta {
  display: inline-block;
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}

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

.info-section {
  max-width: 1000px;
  margin: 60px auto;
  padding: 0 20px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.info-card {
  background: var(--card-bg);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}

.info-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.info-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.info-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   結果ページ
   ======================================== */

.result-container {
  max-width: 900px;
  margin: 80px auto 60px;
  padding: 0 20px;
}

.result-header {
  text-align: center;
  margin-bottom: 40px;
}

.result-stage {
  display: inline-block;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  color: white;
  border-radius: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.result-title {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
}

.result-content {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.result-character {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eef7 100%);
}

.result-character img {
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.result-details {
  padding: 40px;
}

.result-score {
  display: flex;
  justify-content: space-around;
  margin-bottom: 32px;
  padding: 24px;
  background: var(--secondary-bg);
  border-radius: 8px;
}

.score-item {
  text-align: center;
}

.score-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-purple);
}

.score-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.result-description {
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.result-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  color: white;
  flex: 1;
}

.btn-secondary {
  background: var(--btn-inactive);
  color: var(--text-primary);
  flex: 1;
}

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

/* ========================================
   タイプ一覧ページ
   ======================================== */

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

.types-header {
  text-align: center;
  margin-bottom: 48px;
}

.types-header h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.type-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.type-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.type-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.type-card-content {
  padding: 20px;
}

.type-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.type-card-stage {
  display: inline-block;
  padding: 4px 12px;
  background: var(--secondary-bg);
  color: var(--text-secondary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.type-card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================================
   レスポンシブ
   ======================================== */

@media (max-width: 768px) {
  .hero-title {
    font-size: 36px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .question-text {
    font-size: 20px;
  }
  
  .question-card {
    padding: 32px 24px;
  }
  
  .answer-buttons {
    gap: 8px;
  }
  
  .answer-btn:nth-child(1) .answer-circle {
    width: 36px;
    height: 36px;
  }
  
  .answer-btn:nth-child(2) .answer-circle {
    width: 40px;
    height: 40px;
  }
  
  .answer-btn:nth-child(3) .answer-circle {
    width: 44px;
    height: 44px;
  }
  
  .answer-btn:nth-child(4) .answer-circle {
    width: 48px;
    height: 48px;
  }
  
  .answer-btn:nth-child(5) .answer-circle {
    width: 52px;
    height: 52px;
  }
  
  .result-title {
    font-size: 28px;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .types-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 28px;
  }
  
  .question-text {
    font-size: 18px;
  }
  
  .answer-circle {
    font-size: 14px;
  }
  
  .answer-label {
    font-size: 10px;
  }
}

/* ========================================
   アニメーション
   ======================================== */

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

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in {
  animation: slideInFromLeft 0.4s ease;
}
