/* ========== Reels Panel 2026 — dark glass theme ========== */
:root {
  --bg: #0a0b0e;
  --bg-elev: #14161b;
  --bg-elev-2: #1a1d23;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --fg: #e8eaed;
  --fg-muted: #8a8f98;
  --fg-dim: #5a5e66;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --danger: #f43f5e;
  --success: #10b981;
  --warn: #f59e0b;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; line-height: 1.5;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 100%, rgba(139,92,246,0.08), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ========== Layout ========== */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(20, 22, 27, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 24px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; margin-bottom: 24px; padding: 0 8px;
}
.brand-dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent-grad);
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}
nav { display: flex; flex-direction: column; gap: 2px; }
nav a {
  color: var(--fg-muted); padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; transition: all 0.15s;
  display: flex; align-items: center; gap: 10px;
}
nav a:hover { background: rgba(255,255,255,0.04); color: var(--fg); }
nav a.active {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.content { padding: 32px 40px; max-width: 1200px; min-width: 0; }
h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 24px 0 12px; font-size: 18px; font-weight: 600; }
h3 { margin: 16px 0 8px; font-size: 15px; font-weight: 600; }
.muted { color: var(--fg-muted); }
code { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

/* Mobile topbar (hidden on desktop) */
.mobile-bar {
  display: none;
  position: sticky; top: 0; z-index: 30;
  background: rgba(10,11,14,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  align-items: center; gap: 12px;
}
.hamburger {
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  color: var(--fg); border-radius: 10px; padding: 8px 10px;
  cursor: pointer; font-size: 18px; line-height: 1;
}
.mobile-bar .brand { margin: 0; font-size: 15px; }
.scrim {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 40;
  backdrop-filter: blur(4px);
}
.scrim.open { display: block; }

/* ========== Cards (home grid) ========== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 20px; }
.card {
  display: block; padding: 20px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); transition: all 0.2s;
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: var(--accent-grad); opacity: 0;
  transition: opacity 0.25s; z-index: 0;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card:hover::before { opacity: 0.04; }
.card > * { position: relative; z-index: 1; }
.card-title { font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.card-desc { color: var(--fg-muted); font-size: 13px; }

/* ========== Tabs ========== */
.tabs {
  display: flex; gap: 4px; margin: 20px 0 24px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px; width: fit-content;
  overflow-x: auto; max-width: 100%;
}
.tab {
  background: transparent; border: 0; color: var(--fg-muted);
  padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.tab:hover { color: var(--fg); }
.tab.active {
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}
.pane { display: none; }
.pane.active { display: block; }

/* ========== Forms ========== */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 600px; }
.form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--fg-muted); font-weight: 500;
}
.form input, .form textarea {
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  color: var(--fg); padding: 11px 14px; border-radius: 10px;
  font: inherit; transition: all 0.15s; width: 100%;
}
.form input:focus, .form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form input::file-selector-button {
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  color: var(--fg); padding: 6px 12px; border-radius: 8px;
  margin-right: 12px; cursor: pointer; font: inherit;
}
.form button[type="submit"], .primary-action {
  background: var(--accent-grad); color: #fff; border: 0;
  padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: 14px;
  cursor: pointer; align-self: flex-start;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
  transition: all 0.15s;
}
.form button[type="submit"]:hover, .primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  color: var(--fg); font: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.15s; text-decoration: none;
}
.btn:hover { background: var(--bg-elev-2); border-color: rgba(255,255,255,0.18); }
.btn.primary {
  background: var(--accent-grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.btn.primary:hover { box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
.btn.danger { color: var(--danger); border-color: rgba(244,63,94,0.3); }
.btn.danger:hover { background: rgba(244,63,94,0.1); }
.btn.ghost { background: transparent; }

.btn-del {
  background: transparent; color: var(--fg-dim); border: 0;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  font-size: 20px; line-height: 1; transition: all 0.15s;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.btn-del:hover { background: rgba(244,63,94,0.12); color: var(--danger); }

/* ========== Custom dropdown ========== */
.dropdown { position: relative; }
.dropdown-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 14px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  color: var(--fg); cursor: pointer; font: inherit; text-align: left;
  transition: all 0.15s;
}
.dropdown-trigger:hover { border-color: rgba(255,255,255,0.18); }
.dropdown.open .dropdown-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.dropdown-trigger .caret {
  border: solid var(--fg-muted); border-width: 0 2px 2px 0;
  display: inline-block; padding: 3px; transform: rotate(45deg);
  transition: transform 0.2s; margin-bottom: 2px;
}
.dropdown.open .dropdown-trigger .caret { transform: rotate(-135deg); margin-bottom: -2px; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 6px; box-shadow: var(--shadow);
  max-height: 280px; overflow-y: auto;
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.dropdown.open .dropdown-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.1s; font-size: 14px;
}
.dropdown-item:hover { background: rgba(255,255,255,0.05); }
.dropdown-item.selected { background: rgba(99,102,241,0.15); color: var(--fg); }
.dropdown-item img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.dropdown-item .di-meta { flex: 1; min-width: 0; }
.dropdown-item .di-name { font-weight: 500; }
.dropdown-item .di-sub { font-size: 12px; color: var(--fg-muted); }

/* ========== Status + result ========== */
.status { margin: 14px 0; color: var(--fg-muted); font-size: 13px; }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); }
.result { margin-top: 14px; }
.preview img { max-width: 280px; border-radius: var(--radius); border: 1px solid var(--border); }
.downloads { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ========== Profile cards ========== */
.profiles-list { display: flex; flex-direction: column; gap: 8px; max-width: 600px; }
.profile-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.15s;
}
.profile-card:hover { border-color: var(--border-strong); }
.profile-card img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.profile-meta { flex: 1; min-width: 0; }
.profile-name { font-weight: 600; }

/* ========== Batch post cards ========== */
.posts-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 4px;
}
.posts-toolbar .muted { margin-left: auto; font-size: 12px; }
.posts-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.post-item {
  display: grid; grid-template-columns: 28px 1fr 36px;
  gap: 12px; align-items: start;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.post-num { color: var(--fg-muted); font-size: 12px; padding-top: 14px; font-weight: 500; }
.post-item textarea {
  width: 100%; min-height: 84px; resize: vertical;
  background: var(--bg); border: 1px solid var(--border-strong); color: var(--fg);
  border-radius: 10px; padding: 10px 12px; font: inherit;
}
.post-item textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.post-del { align-self: center; margin-top: 12px; }

/* ========== Tables ========== */
.table-wrap { overflow-x: auto; margin-top: 12px; border-radius: var(--radius); border: 1px solid var(--border); }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
  background: var(--bg-elev);
}
table.data th, table.data td {
  padding: 12px 14px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
table.data th {
  color: var(--fg-muted); font-weight: 500; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(255,255,255,0.02);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(255,255,255,0.02); }
.text-cell { max-width: 320px; color: var(--fg); white-space: pre-wrap; line-height: 1.4; }
.thumb { width: 56px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { padding: 6px 10px; font-size: 12px; }
.err { color: var(--danger); }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.pill.queued { background: rgba(245,158,11,0.12); color: var(--warn); }
.pill.sent { background: rgba(16,185,129,0.12); color: var(--success); }
.pill.posted { background: rgba(99,102,241,0.12); color: var(--accent); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ========== Modal ========== */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center; z-index: 60;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 22px;
  width: min(640px, 100%); max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-box h3 { margin: 0 0 8px; font-size: 17px; }
.modal-box textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong);
  color: var(--fg); border-radius: 10px; padding: 12px; font: inherit;
  resize: vertical; margin-top: 10px; min-height: 200px;
}
.modal-box textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* ========== Toggle switch ========== */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  border-radius: 999px; transition: 0.2s;
}
.switch-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px; background: var(--fg-muted);
  border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--accent-grad); border-color: transparent; }
.switch input:checked + .switch-slider::before { transform: translateX(18px); background: #fff; }
.switch-row { display: flex; align-items: center; gap: 12px; }

/* ========== Time chips ========== */
.time-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.time-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px; border-radius: 999px;
  background: rgba(99,102,241,0.12); color: var(--fg); border: 1px solid rgba(99,102,241,0.3);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.time-chip button {
  background: transparent; border: 0; color: var(--fg-muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 2px;
}
.time-chip button:hover { color: var(--danger); }

/* ========== Mobile ========== */
@media (max-width: 900px) {
  .mobile-bar { display: flex; }
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    width: 270px; transform: translateX(-100%);
    transition: transform 0.25s ease;
    height: 100vh;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 20px 16px 60px; max-width: 100%; }
  h1 { font-size: 22px; }
  .form { max-width: 100%; }
  .preview img { max-width: 100%; }
  .post-item { grid-template-columns: 24px 1fr 36px; gap: 8px; padding: 10px; }
  .post-num { padding-top: 12px; font-size: 11px; }
  table.data th, table.data td { padding: 10px 8px; }
  .text-cell { max-width: 200px; font-size: 12px; }
  .thumb { width: 44px; height: 78px; }
}
