/* =========
   基本設定
   ========= */

:root {
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --accent: #6366f1;
  --accent-soft: #eef0ff;
  --text-main: #111827;
  --text-muted: #6b7280;
  --border-soft: rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-pill: 999px;
  --transition-fast: 150ms ease-out;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top left, #ffffff 0, #f5f7fb 45%, #edf0ff 100%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

/* =========
   共通レイアウト
   ========= */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* ヘッダー */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.header-nav {
  margin-top: 6px;
  font-size: 13px;
}

.header-nav a {
  color: var(--accent);
  text-decoration: none;
  margin-right: 12px;
}

.header-nav a:hover {
  text-decoration: underline;
}

/* 見出し */

h1,
h2 {
  margin: 0;
}

h1.page-title {
  font-size: 24px;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.page-lead {
  font-size: 14px;
  color: var(--text-muted);
}

/* =========
   リンク
   ========= */

a {
  color: var(--accent);
}

a:hover {
  opacity: 0.9;
}

/* =========
   トップ / 詳細 共通
   ========= */


/* =========
   検索・絞り込み UI
   ========= */

.filter-bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #f9fafb;
  font-size: 14px;
}

.search-input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.3);
  background: #ffffff;
}

.sort-select {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: #ffffff;
  font-size: 14px;
}

/* タグフィルタ */

.tag-filters {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #f9fafb;          /* ← 少しグレー寄りの背景 */
  color: #374151;               /* ← 濃いグレーの文字色を明示 */
  font-size: 12px;
  padding: 4px 12px;
  cursor: pointer;
}

.tag-chip:hover {
  background: #e5e7ff;          /* ← うっすら紫でホバーが分かる */
}

.tag-chip.active {
  background: #6366f1;          /* ← いまの「すべて」と同じ紫 */
  color: #ffffff;               /* ← アクティブだけ白文字 */
  border-color: #6366f1;
  font-weight: 600;
}



/* ★ 各配信カードの余白を広めにとる（ここだけ大きく変更） */
.card-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px; /* ここでカード間の距離をしっかり空ける */
}

/* 配信カード本体 */
.video-item {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast), background var(--transition-fast);
}

/* 左端のアクセントライン（前のスタイル） */
.video-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent), #a855f7);
}

.video-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 55px rgba(15, 23, 42, 0.12);
  border-color: rgba(99, 102, 241, 0.25);
  background: #ffffff;
}

.video-item h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.video-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.video-desc {
  font-size: 14px;
  margin: 4px 0 10px;
}

/* ボタン類 */
.video-actions {
  font-size: 13px;
}

.video-actions a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-decoration: none;
}

.video-actions a:first-child {
  background: var(--accent-soft);
  border-color: rgba(99, 102, 241, 0.16);
}

.video-actions a:last-child {
  margin-top: 2px;
}

/* 詳細ページ用カード */

.detail-card {
  margin-top: 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.back-link {
  font-size: 13px;
  margin-top: 4px;
}

/* =========
   フォーム（ログイン / 管理）
   ========= */

.auth-card,
.admin-card {
  margin-top: 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

form {
  margin: 0;
}

label {
  display: block;
  font-size: 13px;
  margin: 10px 0 4px;
}

input[type="text"],
input[type="password"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  font-family: inherit;
  font-size: 14px;
  background: #f9fafb;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
    background var(--transition-fast);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
  background: #ffffff;
}

/* =========
   ボタン
   ========= */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  margin-top: 14px;
  font-size: 13px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #ffffff;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.35);
}

button:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}

button.secondary {
  background: #e5e7eb;
  color: #374151;
  box-shadow: none;
  margin-left: 8px;
}

button.secondary:hover {
  background: #d1d5db;
}

/* 危険系（削除ボタン用） */
button.danger {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: none;
}

button.danger:hover {
  background: #fecaca;
}

/* =========
   メッセージ
   ========= */

.message {
  font-size: 13px;
  margin-top: 8px;
}

.message.error {
  color: #dc2626;
}

.message.success {
  color: #16a34a;
}

/* =========
   管理画面テーブル
   ========= */

.table-wrapper {
  margin-top: 24px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 14px 16px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.table-wrapper h2 {
  margin-bottom: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  text-align: left;
}

th {
  font-weight: 600;
  background: #f9fafb;
}

td a {
  white-space: nowrap;
}

.actions {
  white-space: nowrap;
}

/* 編集 / 削除ボタンの間隔（ここも前回どおり） */
.actions button {
  margin-right: 8px;
}

/* =========
   レスポンシブ
   ========= */



/* =========
   ページネーション（視認性改善版）
   ========= */

.pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pagination-inner {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.pagination-button {
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.6);
  background: #f4f6ff;
  color: #4f46e5;
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pagination-button:hover:not(:disabled) {
  background: #e0e7ff;
}

.pagination-button.active {
  background: #6366f1;
  color: #ffffff;
  border-color: #6366f1;
  font-weight: bold;
}

.pagination-button:disabled {
  opacity: 0.35;
  cursor: default;
}





@media (max-width: 640px) {
  .page {
    padding-inline: 14px;
  }

  .header-inner {
    padding-inline: 14px;
  }

  .video-item {
    padding-inline: 14px;
  }

  .detail-card,
  .auth-card,
  .admin-card,
  .table-wrapper {
    padding-inline: 14px;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding-inline: 6px;
  }
}



/* 詳細ページのナビゲーション */
.detail-nav {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.detail-nav a {
  color: var(--accent);
  text-decoration: none;
}

.detail-nav a:hover {
  text-decoration: underline;
}



.video-item {
  margin-bottom: 15px !important;
}
