/**
 * 凸凹診断ツール - スタイルシート
 * レトロ×モダンな温かみのあるデザイン
 */

/* ========== 基本設定 ========== */
:root {
  /* カラーパレット - 5つのタイプカラー */
  --color-type-a: #667EEA;  /* アーカイブ型 - 深い青紫 */
  --color-type-b: #10B981;  /* ブリッジ型 - 鮮やかな緑 */
  --color-type-c: #F59E0B;  /* クラフト型 - 温かみのあるオレンジ */
  --color-type-d: #8B5CF6;  /* ローカル型 - 明るい紫 */
  --color-type-e: #EC4899;  /* エルダー型 - ピンク */

  /* ベースカラー */
  --color-dark: #0F172A;
  --color-dark-secondary: #1E293B;
  --color-light: #F8FAFC;
  --color-text-primary: #F1F5F9;
  --color-text-secondary: #CBD5E1;
  --color-text-muted: #94A3B8;

  /* グラデーション */
  --gradient-primary: linear-gradient(135deg, var(--color-type-a) 0%, var(--color-type-b) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--color-type-c) 0%, var(--color-type-d) 100%);
  --gradient-aurora: linear-gradient(135deg, #667EEA 0%, #F59E0B 50%, #EC4899 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));

  /* サイズ */
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.25rem;
  --font-2xl: 1.5rem;
  --font-3xl: 1.875rem;
  --font-4xl: 2.25rem;
  --font-5xl: 3rem;

  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-base: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  --radius-sm: 0.5rem;
  --radius-base: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;

  /* シャドウ */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.3);
}

/* ========== リセット ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-dark);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== アニメーション背景 ========== */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.animated-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
  animation: rotate 30s linear infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========== コンテナ ========== */
.assessment-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* ========== ヘッダー ========== */
.assessment-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-lg);
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
}

.header-title {
  font-size: var(--font-xl);
  font-weight: 700;
  background: var(--gradient-aurora);
  background-size: 200% 200%;
  animation: aurora 8s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: var(--spacing-sm);
}

@keyframes aurora {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* プログレスバー */
.progress-container {
  margin-top: var(--spacing-base);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-sm);
}

.progress-label {
  color: var(--color-text-secondary);
}

.progress-counter {
  color: var(--color-type-a);
  font-weight: 700;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ========== メインコンテンツ ========== */
.main-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl) var(--spacing-lg);
}

/* ========== 画面（スクリーン） ========== */
.screen {
  display: none;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease;
}

.screen.active {
  display: block;
}

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

/* ========== カード ========== */
.card {
  background: var(--gradient-glass);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 0.2;
}

/* ========== 開始画面 ========== */
.start-screen .card {
  text-align: center;
}

.start-badge {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--spacing-xl);
}

.start-title {
  font-size: var(--font-4xl);
  font-weight: 900;
  margin-bottom: var(--spacing-lg);
  background: var(--gradient-aurora);
  background-size: 200% 200%;
  animation: aurora 8s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-description {
  font-size: var(--font-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-2xl);
  line-height: 1.8;
}

.start-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-lg);
  margin: var(--spacing-2xl) 0;
}

.feature-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-base);
  padding: var(--spacing-lg);
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.1);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
}

.feature-label {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.start-info {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-base);
  padding: var(--spacing-xl);
  margin: var(--spacing-2xl) 0;
  text-align: left;
}

.start-info h3 {
  font-size: var(--font-lg);
  margin-bottom: var(--spacing-base);
  color: var(--color-type-a);
}

.start-info ol {
  color: var(--color-text-secondary);
  padding-left: var(--spacing-xl);
  line-height: 1.8;
}

.start-info li {
  margin-bottom: var(--spacing-sm);
}

/* ========== ボタン ========== */
.btn {
  display: inline-block;
  padding: var(--spacing-base) var(--spacing-2xl);
  border-radius: var(--radius-base);
  font-size: var(--font-base);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-align: center;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-large {
  padding: var(--spacing-lg) var(--spacing-3xl);
  font-size: var(--font-xl);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

/* ========== 質問画面 ========== */
.question-category {
  display: inline-block;
  background: rgba(102, 126, 234, 0.1);
  color: var(--color-type-a);
  padding: var(--spacing-xs) var(--spacing-base);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: var(--spacing-lg);
}

.question-text {
  font-size: var(--font-3xl);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--spacing-base);
}

.question-instruction {
  font-size: var(--font-base);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-2xl);
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-base);
}

.option-item {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-base);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.option-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s ease;
}

.option-item:hover {
  transform: translateX(8px);
  border-color: var(--color-type-a);
  background: rgba(102, 126, 234, 0.05);
}

.option-item:hover::before {
  left: 100%;
}

.option-item.selected {
  background: rgba(102, 126, 234, 0.15);
  border-color: var(--color-type-a);
  transform: translateX(8px) scale(1.02);
}

.option-item.selected::after {
  content: '✓';
  position: absolute;
  right: var(--spacing-lg);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-xl);
  color: var(--color-type-a);
  font-weight: 700;
}

.option-label {
  display: inline-block;
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: 50%;
  text-align: center;
  line-height: 32px;
  margin-right: var(--spacing-base);
  font-weight: 700;
  color: white;
  font-size: var(--font-sm);
}

.option-text {
  font-size: var(--font-lg);
  display: inline;
}

/* ナビゲーション */
.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--spacing-2xl);
  gap: var(--spacing-lg);
}

/* ========== ローディング画面 ========== */
.loading-container {
  text-align: center;
  padding: var(--spacing-3xl) var(--spacing-lg);
}

.loader {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--spacing-2xl);
  position: relative;
}

.loader-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: rotateLoader 3s linear infinite;
}

.loader-circle::before,
.loader-circle::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
}

.loader-circle::before {
  top: 0;
  left: 0;
  animation: pulse 1.5s ease-in-out infinite;
}

.loader-circle::after {
  bottom: 0;
  right: 0;
  animation: pulse 1.5s ease-in-out infinite 0.75s;
}

@keyframes rotateLoader {
  100% { transform: rotate(360deg); }
}

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

.loading-text {
  font-size: var(--font-xl);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-base);
  font-weight: 700;
}

.loading-message {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ========== レスポンシブ ========== */
@media (max-width: 768px) {
  :root {
    --font-3xl: 1.5rem;
    --font-4xl: 1.875rem;
    --font-5xl: 2.25rem;
  }

  .card {
    padding: var(--spacing-lg);
  }

  .start-title {
    font-size: var(--font-3xl);
  }

  .question-text {
    font-size: var(--font-2xl);
  }

  .start-features {
    grid-template-columns: repeat(2, 1fr);
  }

  .option-item {
    padding: var(--spacing-base);
  }

  .option-text {
    font-size: var(--font-base);
  }

  .navigation {
    flex-direction: column;
  }

  .navigation .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .start-features {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: var(--spacing-xl) var(--spacing-base);
  }
}

/* ========== ユーティリティ ========== */
.text-gradient {
  background: var(--gradient-aurora);
  background-size: 200% 200%;
  animation: aurora 8s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-base); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-base); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }
