/* ================================================
   Instagram Auto Post – カスタムスタイル
   Tailwindが担当しない部分を補完
   ================================================ */

/* ── スピナー ────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
  margin-right: 0.45rem;
  flex-shrink: 0;
}
.spinner-blue {
  border-color: #bfdbfe;
  border-top-color: #2563eb;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ステップバー ────────────────────────────── */
.step-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
}
.step-bar .step {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-bottom: 3px solid #e5e7eb;
  color: #9ca3af;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.step-bar .step.active {
  border-color: #2563eb;
  color: #2563eb;
}
.step-bar .step.done {
  border-color: #16a34a;
  color: #16a34a;
}

/* ── ステータスバッジ ─────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-draft      { background: #f3f4f6; color: #6b7280; }
.badge-pending    { background: #fef9c3; color: #854d0e; }
.badge-scheduled  { background: #ede9fe; color: #6d28d9; }  /* 紫（投稿予約中） */
.badge-approved   { background: #dbeafe; color: #1d4ed8; }  /* 青（投稿予約済） */
.badge-published  { background: #dcfce7; color: #15803d; }  /* 緑 */
.badge-failed     { background: #fee2e2; color: #b91c1c; }  /* 赤 */
.badge-archived   { background: #f3f4f6; color: #9ca3af; }

/* ── トースト通知（上部固定）────────────────── */
#toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-5rem);
  background: #1f2937;
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
  max-width: 90vw;
  text-overflow: ellipsis;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  pointer-events: none;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── 画像プレビュー ──────────────────────────── */
#img-preview {
  max-height: 220px;
  object-fit: cover;
  border-radius: 0.75rem;
}

/* ── ハッシュタグチップ ──────────────────────── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.15rem;
  cursor: text;
  min-height: 30px;
  transition: background 0.15s;
}
.tag-chip:focus {
  outline: none;
  background: #dbeafe;
  border-color: #93c5fd;
}
/* ダッシュボード用の小さいチップ */
.tag-chip-sm {
  display: inline-block;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 9999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  margin: 0.1rem 0.1rem 0 0;
  white-space: nowrap;
}

/* ── 文字数カウンター警告 ────────────────────── */
.char-warn { color: #dc2626; }

/* ── キャプション表示スタイル ────────────────── */
.caption-textarea {
  font-size: 16px !important;
  line-height: 1.85 !important;
  word-break: break-all;
  letter-spacing: 0.01em;
}

/* ── 安全チェック – 通過 ────────────────────── */
.safety-pass {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #dcfce7;
  border: 2px solid #86efac;
  border-radius: 0.875rem;
  padding: 1rem 1.25rem;
  color: #15803d;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
}
.safety-pass svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: #16a34a;
}
/* 安全チェック – 失敗 */
.safety-fail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #b91c1c;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* ── ダッシュボード – モバイルカード ─────────── */
.post-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.post-card-caption {
  font-size: 0.875rem;
  color: #1f2937;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.post-card-meta {
  font-size: 0.72rem;
  color: #9ca3af;
}
/* テーブルキャプション省略 */
.caption-cell {
  max-width: 220px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #1f2937;
  word-break: break-all;
}
/* posting-service ラベル */
.svc-label {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.svc-label-up   { color: #0369a1; background: #e0f2fe; border-color: #bae6fd; }
.svc-label-ay   { color: #7c3aed; background: #ede9fe; border-color: #c4b5fd; }

/* ── 投稿承認ボタン ──────────────────────────── */
.approve-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4), 0 1px 3px rgba(0,0,0,0.1);
  padding: 0.875rem 1rem;
  letter-spacing: 0.02em;
  font-size: 1rem;
}
.approve-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}
.approve-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.approve-btn-primary:disabled {
  opacity: 0.7;
  transform: none;
  cursor: not-allowed;
}

/* ── 複数画像サムネイル ──────────────────────── */
.img-thumb-wrap {
  position: relative;
  flex-shrink: 0;
}
.img-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.625rem;
  display: block;
  background: #f3f4f6;
}
.img-thumb-label {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  line-height: 1.4;
}
.img-thumb-del {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 9999px;
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  border: none;
  padding: 0;
}
.img-thumb-del:hover {
  background: rgba(185, 28, 28, 0.8);
}
/* ステップ2 横並びサムネイル */
.step2-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
  border: 2px solid #e5e7eb;
}

/* ── スケジュール投稿 クイック選択ボタン ─────── */
.schedule-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid #c4b5fd;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6d28d9;
  background: #fff;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.schedule-quick-btn:hover {
  background: #ede9fe;
  border-color: #7c3aed;
}
.schedule-quick-btn.active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
/* 選択中日時プレビュー */
.schedule-preview-text {
  font-size: 0.875rem;
  color: #6d28d9;
  font-weight: 600;
  background: #f5f3ff;
  border: 1.5px solid #c4b5fd;
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
}

/* ── 予約カレンダー グリッド ──────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  font-size: 0.75rem;
  min-width: 600px;
}
.cal-header-cell {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-weight: 700;
  color: #374151;
}
.cal-time-cell {
  background: #f9fafb;
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #e5e7eb;
  padding: 0.4rem 0.25rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-slot {
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #e5e7eb;
  min-height: 64px;
  padding: 0.25rem;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.cal-slot:hover {
  background: #f0fdf4;
}
.cal-slot-empty::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #d1fae5;
  font-weight: 700;
}
.cal-slot-empty:hover::after {
  color: #10b981;
}
.cal-slot-booked {
  background: #ede9fe;
  cursor: default;
}
.cal-slot-booked:hover {
  background: #ddd6fe;
}
.cal-slot-published {
  background: #dcfce7;
  cursor: default;
}
.cal-slot-published:hover {
  background: #bbf7d0;
}
.cal-slot-card {
  border-radius: 0.35rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cal-slot-card-booked  { color: #5b21b6; }
.cal-slot-card-published { color: #166534; }
