/* Buzzvid app — dark brand design system（LP と同一の世界観） */
@font-face {
  font-family: 'Inter';
  font-weight: 400; font-display: swap;
  src: url('https://static.hub-sys.com/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 600; font-display: swap;
  src: url('https://static.hub-sys.com/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-weight: 700; font-display: swap;
  src: url('https://static.hub-sys.com/fonts/inter-700.woff2') format('woff2');
}

:root {
  --bg: #0d0d12;
  --panel: #15151c;
  --panel-2: #1c1c25;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #e7e9ef;
  --text-2: #c6cbd6;
  --muted: #9aa4b8;
  --accent: #ec4899;
  --accent-2: #a855f7;
  --grad: linear-gradient(135deg, #ec4899, #a855f7);
  --grad-soft: linear-gradient(135deg, rgba(236, 72, 153, .14), rgba(168, 85, 247, .14));
  --glow: rgba(168, 85, 247, .35);
  --success: #34d399;
  --warning: #fbbf24;
  --error: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(640px 360px at 85% -10%, rgba(168, 85, 247, .10), transparent 65%),
    radial-gradient(520px 320px at 0% 100%, rgba(236, 72, 153, .07), transparent 60%);
  pointer-events: none;
}

/* ── header ── */
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 28px; height: 60px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 13, 18, .82);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 50;
}
.logo {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em;
  text-decoration: none; color: var(--text);
  display: inline-flex; align-items: center; gap: 9px;
}
.logo::before {
  content: "";
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px var(--glow);
}
nav { display: flex; align-items: center; gap: 4px; }
nav a, nav .link {
  color: var(--muted); text-decoration: none;
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: .88rem; font-weight: 500;
  padding: 7px 13px; border-radius: 8px; margin: 0;
  transition: color .15s, background .15s;
}
nav a:hover, nav .link:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* ── layout ── */
main { max-width: 980px; margin: 36px auto; padding: 0 24px; }
h1 {
  font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em;
  margin: 0 0 6px;
}
h2 { font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; margin: 28px 0 12px; }
.page-sub { color: var(--muted); font-size: .88rem; margin: 0 0 26px; }

/* ── cards / panels ── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

/* ── buttons ── */
.btn, button[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px;
  background: var(--grad); color: #fff;
  border: none; border-radius: 10px;
  cursor: pointer; font: inherit; font-size: .9rem; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(236, 72, 153, .25);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover, button[type="submit"]:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 6px 24px rgba(236, 72, 153, .35);
}
.btn:active, button[type="submit"]:active { transform: translateY(0); }
.btn.ghost, button.ghost {
  background: rgba(255, 255, 255, .05);
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.btn.ghost:hover, button.ghost:hover { background: rgba(255, 255, 255, .1); filter: none; }
.btn.sm { padding: 6px 14px; font-size: .8rem; border-radius: 8px; }
.btn.danger {
  background: rgba(248, 113, 113, .1); color: var(--error);
  border: 1px solid rgba(248, 113, 113, .3); box-shadow: none;
}
.btn.danger:hover { background: rgba(248, 113, 113, .18); filter: none; }

/* ── forms ── */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.form label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; gap: 7px; color: var(--text-2); }
.form input, .form select, .form textarea {
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem;
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, .18);
}
.form select option { background: var(--panel-2); color: var(--text); }
.form input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.form p a, main a { color: #f0abd9; }

/* ── flash ── */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .88rem; border: 1px solid transparent; }
.flash.error { background: rgba(248, 113, 113, .1); color: var(--error); border-color: rgba(248, 113, 113, .25); }
.flash.success { background: rgba(52, 211, 153, .1); color: var(--success); border-color: rgba(52, 211, 153, .25); }

/* ── tables ── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  padding: 10px 12px; text-align: left;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line-strong);
}
td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); color: var(--text-2); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(255, 255, 255, .025); }
td a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
td a:hover { color: #f0abd9; border-color: #f0abd9; }

/* ── status badges ── */
.job-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
  border: 1px solid transparent;
}
.job-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.job-status.ready { background: rgba(52, 211, 153, .1); color: var(--success); border-color: rgba(52, 211, 153, .25); }
.job-status.generating { background: rgba(251, 191, 36, .1); color: var(--warning); border-color: rgba(251, 191, 36, .25); }
.job-status.generating::before { animation: pulse-dot 1.2s infinite; }
.job-status.posting { background: rgba(96, 165, 250, .1); color: #60a5fa; border-color: rgba(96, 165, 250, .25); }
.job-status.posting::before { animation: pulse-dot 1.2s infinite; }
.job-status.failed { background: rgba(248, 113, 113, .1); color: var(--error); border-color: rgba(248, 113, 113, .25); }
.job-status.done { background: rgba(168, 85, 247, .12); color: #c084fc; border-color: rgba(168, 85, 247, .3); }
@keyframes pulse-dot { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

/* ── SNS 連携カード ── */
.sns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sns-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, transform .2s;
}
.sns-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.sns-card .sns-head { display: flex; align-items: center; justify-content: space-between; }
.sns-card .sns-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: .98rem; }
.sns-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.sns-dot.tiktok { background: #25F4EE; box-shadow: 0 0 8px rgba(37, 244, 238, .5); }
.sns-dot.youtube { background: #FF0000; box-shadow: 0 0 8px rgba(255, 0, 0, .45); }
.sns-dot.instagram { background: linear-gradient(45deg, #FED373, #E1306C, #9B36B7); box-shadow: 0 0 8px rgba(225, 48, 108, .45); }
.sns-dot.threads { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .35); }
.sns-dot.x { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .35); }
.sns-badge {
  font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.sns-badge.on { background: rgba(52, 211, 153, .12); color: var(--success); border: 1px solid rgba(52, 211, 153, .3); }
.sns-badge.off { background: rgba(255, 255, 255, .05); color: var(--muted); border: 1px solid var(--line); }
.sns-acct {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: .84rem;
}
.sns-acct .handle { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.sns-acct .exp { color: var(--muted); font-size: .7rem; }
.sns-empty { color: var(--muted); font-size: .82rem; padding: 4px 0; }

/* ── stats row ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 20px 0 28px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px;
}
.stat-card .v {
  font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-card .l { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }

/* ── auth（ログイン）── */
.auth-wrap { max-width: 400px; margin: 8vh auto 0; }
.auth-wrap .panel { padding: 36px 32px; }
.auth-wrap h1 { text-align: center; margin-bottom: 24px; }
.auth-wrap .form { max-width: none; }
.auth-wrap button[type="submit"] { width: 100%; margin-top: 4px; }

/* ── page head（タイトル + アクション）── */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 10px; align-items: center; }

/* ── job detail preview ── */
.preview-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; max-width: 420px;
}
.preview-box img, .preview-box video { width: 100%; border-radius: var(--radius-sm); display: block; }

@media (max-width: 640px) {
  header { padding: 0 16px; }
  nav a, nav .link { padding: 6px 9px; font-size: .8rem; }
  main { margin: 22px auto; }
}

/* ── job detail ── */
dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 18px 0; }
dt { color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
dd { margin: 0; color: var(--text-2); font-size: .9rem; word-break: break-word; }
fieldset { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px 16px; }
legend { font-size: .76rem; font-weight: 600; color: var(--muted); padding: 0 8px; }
#preview img, #preview video { max-width: 420px; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
