/* カスタムスタイル */
body {
  font-family: 'Noto Sans JP', sans-serif;
}

/* チャットコンテナ */
.chat-container {
  animation: slideUp 0.5s ease-out;
}

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

/* チャットメッセージ */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #4A90E2;
  border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #357ABD;
}

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

/* 入力フォームのフォーカススタイル */
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

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

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

#app > div {
  animation: fadeIn 0.5s ease-out;
}

/* タイピングインジケーター */
@keyframes typing {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.typing-indicator span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background: #4A90E2;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* 警告の点滅アニメーション */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #357ABD;
}

/* モバイル対応 */
@media (max-width: 768px) {
  /* テーブル */
  table {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 0.5rem !important;
  }
  
  /* ボタン */
  button, .choice-btn {
    font-size: 0.9rem !important;
    padding: 0.75rem 1rem !important;
  }
  
  /* 入力フィールド */
  input, select, textarea {
    font-size: 16px !important; /* iOS zoomを防ぐ */
  }
  
  /* チャットメッセージ */
  .chat-messages {
    max-height: 60vh !important;
  }
  
  /* カード */
  .result-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* グラフ */
  canvas {
    max-height: 300px !important;
  }
  
  /* フォントサイズ調整 */
  h1 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }
  
  h2 {
    font-size: 1.25rem !important;
  }
  
  h3 {
    font-size: 1.1rem !important;
  }
  
  /* スペーシング */
  .space-y-4 > * + * {
    margin-top: 0.75rem !important;
  }
  
  .space-y-6 > * + * {
    margin-top: 1rem !important;
  }
  
  /* パディング調整 */
  .p-6 {
    padding: 1rem !important;
  }
  
  .p-8 {
    padding: 1.25rem !important;
  }
  
  /* マージン調整 */
  .mb-8 {
    margin-bottom: 1.5rem !important;
  }
  
  /* グリッドレイアウト */
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
}

/* 超小型デバイス（320px以下） */
@media (max-width: 375px) {
  body {
    font-size: 14px;
  }
  
  button, .choice-btn {
    font-size: 0.85rem !important;
    padding: 0.625rem 0.875rem !important;
  }
  
  h1 {
    font-size: 1.25rem !important;
  }
}

/* プリント用スタイル */
@media print {
  body {
    background: white;
  }
  
  button {
    display: none;
  }
  
  .no-print {
    display: none;
  }
}

/* グラフのレスポンシブ対応 */
canvas {
  max-width: 100%;
  height: auto !important;
}

/* カード型レイアウトのシャドウ効果 */
.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ホバーエフェクト */
button {
  transition: all 0.2s ease-in-out;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

/* ローディング表示 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 必須マーク */
.text-red-500 {
  color: #FF6B6B;
}

/* グラデーション背景 */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

/* チェックボックスのカスタムスタイル（ピンク系） */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #ec4899;
  border-radius: 0.25rem;
  outline: none;
  cursor: pointer;
  position: relative;
  background-color: white;
  transition: all 0.2s ease-in-out;
}

input[type="checkbox"]:hover {
  border-color: #db2777;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

input[type="checkbox"]:checked {
  background-color: #ec4899;
  border-color: #ec4899;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
}
