/**
 * まいにち英作文 - カスタムスタイル
 * Tailwind CSSで不足する部分を補完
 */

/* ===== カスタムカラー定義（Tailwind CDNではカスタムカラーが効かない場合の対策） ===== */
.bg-primary { background-color: #2563eb !important; }
.bg-primary-dark, .hover\:bg-primary-dark:hover { background-color: #1d4ed8 !important; }
.text-primary { color: #2563eb !important; }
.border-primary { border-color: #2563eb !important; }
.ring-primary, .peer-focus\:ring-primary:focus ~ * { --tw-ring-color: #2563eb; }
.peer:checked ~ .peer-checked\:bg-primary { background-color: #2563eb !important; }

/* ===== ボタングラデーション ===== */
.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ===== フォント設定 ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: #f1f5f9;
}

/* ===== phone-frame: モバイルPWA風の表示 ===== */
.phone-frame {
  max-width: 390px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow-x: hidden;
}

/* ===== 画面表示制御 ===== */
.screen {
  display: none;
}
.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== 4コマ漫画プレースホルダー ===== */
.manga-placeholder {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
}
.manga-panel {
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #6366f1;
  aspect-ratio: 1;
}

/* ===== お題画像（実際の画像がある場合） ===== */
.theme-image {
  width: 100%;
  border-radius: 8px;
  object-fit: contain;
}

/* ===== テキストエリアフォーカス ===== */
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px #2563eb;
}

/* ===== スナックバー ===== */
.snackbar {
  animation: slideDown 0.3s ease-out;
}
.snackbar-error {
  background-color: #dc2626 !important;
}

/* ===== リアクションボタン選択状態 ===== */
.reaction-btn.selected {
  transform: scale(1.05);
}
.reaction-btn.selected-like {
  background-color: #eff6ff;
  border-color: #93c5fd;
}
.reaction-btn.selected-amazing {
  background-color: #faf5ff;
  border-color: #c4b5fd;
}
.reaction-btn.selected-educational {
  background-color: #f0fdf4;
  border-color: #86efac;
}

/* ===== アニメーション ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in {
  animation: fadeIn 0.2s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

/* ===== ローディングスピナー ===== */
.spinner {
  border: 3px solid #e5e7eb;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 非表示ユーティリティ（JSからの制御用） ===== */
.hidden {
  display: none !important;
}
