/* ===================================================
   HandOff カスタムスタイル
   - フォント: Noto Sans JP (日本語視認性最優先)
   - 文字サイズ: 全体的に1段階大きく
   - コントラスト: WCAG AA準拠 (4.5:1以上)
   =================================================== */

/* ===== ベースフォント設定 ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 15px;          /* ベースを15pxに (デフォルト16pxより日本語が読みやすい) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans',
               Meiryo, 'Yu Gothic UI', sans-serif;
  font-weight: 400;
  line-height: 1.7;         /* 日本語は行間を広めに */
  color: #1a1a2e;           /* 純黒ではなく濃い紺系でソフトに */
  background: #f5f6fa;
  letter-spacing: 0.02em;   /* 日本語の字間を微調整 */
}

/* ===== アニメーション ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in  { animation: fadeIn  0.2s ease-out; }
.slide-in { animation: slideIn 0.25s ease-out; }

/* ===== カード ===== */
.card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); }

/* ===== 統計カード（グラデーション背景） ===== */
.stat-card {
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
  /* background は bg-gradient-to-br で Tailwind から設定 */
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.18); }

/* ===== タスクカード ===== */
.task-card {
  border-left: 4px solid #d1d5db;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.task-card:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.task-card.priority-urgent { border-left-color: #dc2626; }
.task-card.priority-high   { border-left-color: #ea580c; }
.task-card.priority-medium { border-left-color: #2563eb; }
.task-card.priority-low    { border-left-color: #6b7280; }

/* ===== バッジ共通 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-unread { animation: pulse-badge 2s infinite; }

/* ステータスバッジ — コントラスト強化 */
.status-not_confirmed { background: #fef08a; color: #713f12; }   /* 黄: 濃い茶文字 */
.status-confirmed     { background: #bfdbfe; color: #1e3a8a; }   /* 青: 濃い紺文字 */
.status-in_progress   { background: #bbf7d0; color: #14532d; }   /* 緑: 濃い緑文字 */
.status-completed     { background: #e5e7eb; color: #374151; }   /* グレー */

/* 優先度バッジ — コントラスト強化 */
.priority-urgent-badge { background: #fecaca; color: #7f1d1d; }
.priority-high-badge   { background: #fed7aa; color: #7c2d12; }
.priority-medium-badge { background: #bfdbfe; color: #1e3a8a; }
.priority-low-badge    { background: #e5e7eb; color: #374151; }

/* ===== サイドバー ===== */
.sidebar {
  width: 248px;
  min-height: 100vh;
  background: linear-gradient(180deg, #1a1a3e 0%, #2d2b6e 100%);
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  transition: transform 0.3s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,0.18);
}
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  color: rgba(255,255,255,0.75);
  border-radius: 8px;
  margin: 2px 8px;
  transition: all 0.15s ease;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
}
.sidebar-link i { width: 22px; text-align: center; margin-right: 10px; font-size: 15px; }

/* ===== メインコンテンツ ===== */
.main-content { margin-left: 248px; }

/* ===== ヘッダー ===== */
header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: 0.02em;
}

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28);
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  animation: fadeIn 0.18s ease-out;
}

/* ===== フォーム ===== */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
.form-input {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}
.form-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}
.form-input::placeholder { color: #9ca3af; }

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  letter-spacing: 0.02em;
}
.btn-primary  { background: #4f46e5; color: #fff; }
.btn-primary:hover  { background: #4338ca; box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1.5px solid #e5e7eb; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger   { background: #dc2626; color: #fff; }
.btn-danger:hover   { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,0.3); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ===== トースト通知 ===== */
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.25s ease-out;
  min-width: 280px;
  letter-spacing: 0.02em;
}
.toast-success { background: #f0fdf4; color: #14532d; border: 1px solid #86efac; }
.toast-error   { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }
.toast-info    { background: #eff6ff; color: #1e3a8a; border: 1px solid #93c5fd; }

/* ===== ファイル添付 ===== */
.file-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: #4f46e5;
  background: #f5f3ff;
}
.file-thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* ===== スクロールバー ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* ===== ローディング ===== */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== 期限アラート ===== */
.overdue-alert   { background: #fef2f2; border: 1px solid #fca5a5; }
.due-today-alert { background: #fffbeb; border: 1px solid #fde68a; }

/* ===== テキスト視認性補助 ===== */
/* ラベル系の小文字: グレーでも読めるよう濃くする */
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }

/* ダッシュボード統計カードの数値 */
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #1a1a2e;
}

/* タスクタイトル */
.task-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.5;
}

/* メタ情報（日付・担当者など） */
.task-meta {
  font-size: 12px;
  color: #4b5563;   /* gray-600: 読みやすい濃さ */
  font-weight: 400;
}

/* セクション見出し */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.01em;
}

/* 入力フォームのグループ間隔 */
.form-group { margin-bottom: 16px; }

/* ===== ログイン画面 ===== */
.login-input {
  font-size: 15px;
  padding: 11px 14px;
}

/* ===== 申し送りガントチャート ===== */
.handover-gantt-wrap {
  overflow-x: auto;
  min-width: 0;
}

/* 時刻ヘッダー行 */
.handover-gantt-header {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 4px;
  min-width: 600px;
}
.gantt-hour-label {
  flex: 1;
  font-size: 11px;
  color: #9ca3af;
  text-align: left;
  padding: 2px 0;
  border-left: 1px dashed #f3f4f6;
  padding-left: 3px;
  font-family: 'Courier New', monospace;
}
.gantt-hour-label:first-child { border-left: none; }

/* バーエリア */
.handover-gantt-body {
  position: relative;
  min-height: 36px;
  min-width: 600px;
}

/* 各バーの行 */
.gantt-bar-row {
  position: relative;
  height: 28px;
  margin-bottom: 3px;
}

/* バー本体 */
.gantt-bar {
  position: absolute;
  top: 0;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  min-width: 24px;
}
.gantt-bar:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}
.gantt-bar-type {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.8;
  flex-shrink: 0;
}
.gantt-bar-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
