/* カスタムスタイル */
.log-entry {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  border-left: 3px solid #e5e7eb;
}

.log-time {
  color: #6b7280;
  margin-right: 8px;
}

.log-info {
  background-color: #f3f4f6;
  border-left-color: #3b82f6;
}

.log-success {
  background-color: #ecfdf5;
  border-left-color: #10b981;
  color: #065f46;
}

.log-warning {
  background-color: #fef3c7;
  border-left-color: #f59e0b;
  color: #92400e;
}

.log-error {
  background-color: #fee2e2;
  border-left-color: #ef4444;
  color: #991b1b;
}

.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  min-height: 120px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: #6b7280;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.2s;
}

.btn-toggle:hover {
  color: #374151;
}

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

.stat-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.stat-item.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-item.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-item.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.logs-container {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.875rem;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-input-wrapper input[type='file'] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background-color: #f9fafb;
  cursor: pointer;
  transition: all 0.2s;
}

.file-input-label:hover {
  border-color: #667eea;
  background-color: #eef2ff;
}

.hidden {
  display: none;
}

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

.card {
  animation: fadeIn 0.3s ease-out;
}

/* ========================================
   モバイル対応レスポンシブスタイル
   ======================================== */

/* タブレット対応 (768px以下) */
@media (max-width: 768px) {
  /* ヘッダータイトルのサイズ調整 */
  h1.text-4xl {
    font-size: 2rem !important;
  }

  /* カードのパディング削減 */
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

  /* カードタイトルのサイズ調整 */
  .card-title {
    font-size: 1.125rem;
    margin-bottom: 12px;
  }

  /* 統計グリッドを2列に */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* 統計カードのパディング削減 */
  .stat-item {
    padding: 16px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  /* フォームラベルのサイズ調整 */
  .form-label {
    font-size: 0.8125rem;
  }

  /* フォーム入力のパディング調整 */
  .form-input {
    padding: 12px;
    font-size: 16px; /* iOS自動ズーム防止 */
  }

  /* テキストエリアの最小高さ削減 */
  .form-textarea {
    min-height: 100px;
    font-size: 0.8125rem;
  }

  /* ボタンのサイズ調整（タッチターゲット44px以上） */
  .btn-primary {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 48px;
  }

  .btn-secondary {
    padding: 10px 16px;
    font-size: 0.875rem;
    min-height: 44px;
  }

  /* ファイルアップロードエリアの調整 */
  .file-input-label {
    padding: 30px 16px;
  }

  .file-input-label i {
    font-size: 2.5rem !important;
  }

  /* ログコンテナの高さ調整 */
  .logs-container {
    max-height: 300px;
    padding: 12px;
  }

  /* ログエントリーのサイズ調整 */
  .log-entry {
    padding: 6px 10px;
    font-size: 0.8125rem;
  }
}

/* スマートフォン対応 (480px以下) */
@media (max-width: 480px) {
  /* 全体のパディング削減 */
  .min-h-screen {
    padding: 16px 8px !important;
  }

  /* ヘッダータイトルをさらに小さく */
  h1.text-4xl {
    font-size: 1.75rem !important;
  }

  /* カードのパディングをさらに削減 */
  .card {
    padding: 12px;
    margin-bottom: 12px;
  }

  /* 統計グリッドを1列に */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* 統計カードを横長デザインに */
  .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
  }

  .stat-label {
    font-size: 0.875rem;
    margin-bottom: 0;
    text-align: left;
  }

  .stat-value {
    font-size: 1.75rem;
  }

  /* フォーム入力をタッチフレンドリーに */
  .form-input {
    padding: 14px;
    font-size: 16px; /* iOS自動ズーム防止 */
  }

  /* セレクトボックスのサイズ調整 */
  select.form-input {
    min-height: 48px;
  }

  /* ボタンをさらに大きく */
  .btn-primary {
    padding: 16px 24px;
    font-size: 1.0625rem;
    min-height: 52px;
  }

  .btn-secondary {
    padding: 12px 16px;
    min-height: 48px;
  }

  /* トグルボタンのタッチエリア拡大 */
  .btn-toggle {
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
  }

  /* ファイルアップロードエリアをコンパクトに */
  .file-input-label {
    padding: 24px 12px;
  }

  .file-input-label i {
    font-size: 2rem !important;
  }

  .file-input-label p {
    font-size: 0.875rem;
  }

  .file-input-label p.text-sm {
    font-size: 0.75rem;
  }

  /* ログコンテナの高さをさらに調整 */
  .logs-container {
    max-height: 250px;
    padding: 10px;
  }

  /* ログエントリーをコンパクトに */
  .log-entry {
    padding: 5px 8px;
    font-size: 0.75rem;
  }

  .log-time {
    display: block;
    margin-bottom: 4px;
    font-size: 0.6875rem;
  }

  /* 情報ボックスのパディング調整 */
  .bg-blue-50, .bg-green-50 {
    padding: 12px !important;
    font-size: 0.8125rem;
  }

  .bg-blue-50 ul, .bg-green-50 ul {
    font-size: 0.75rem;
  }

  /* フッターのテキストサイズ調整 */
  .text-center.text-gray-500.text-sm {
    font-size: 0.75rem !important;
  }
}

/* 横向きスマートフォン対応 */
@media (max-width: 768px) and (orientation: landscape) {
  /* ログコンテナの高さを減らす */
  .logs-container {
    max-height: 200px;
  }

  /* 統計グリッドを2列に戻す */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* タッチデバイス向けホバー無効化 */
@media (hover: none) {
  .btn-primary:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
  }

  .file-input-label:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
  }
}

/* アクティブ状態のスタイル（タッチフィードバック） */
@media (max-width: 768px) {
  .btn-primary:active:not(:disabled) {
    transform: scale(0.98);
  }

  .btn-secondary:active {
    background-color: #374151;
  }

  .file-input-label:active {
    border-color: #667eea;
    background-color: #eef2ff;
  }
}

/* デバッグ情報表示スタイル */
.log-entry pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
}

.log-entry .font-bold {
  font-weight: 600;
}

.log-entry i.fa-bug {
  color: #6366f1;
}

.log-entry i.fa-lightbulb {
  color: #f59e0b;
}

.log-entry i.fa-exclamation-triangle {
  color: #ef4444;
}
