/* VirtuclixTube — Global Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --blue:        #2563EB;
  --blue-hover:  #1D4ED8;
  --blue-tint:   #EFF4FF;
  --blue-light:  #3B82F6;
  --green-bg:    #DCFCE7;
  --green-text:  #16A34A;
  --gray-bg:     #F3F4F6;
  --gray-text:   #6B7280;
  --page-bg:     #F9FAFB;
  --card-bg:     #FFFFFF;
  --border:      #E5E7EB;
  --text:        #111827;
  --muted:       #6B7280;
  --red:         #FF0000;
  --danger:      #DC2626;
  --sidebar-w:   260px;
  --topbar-h:    56px;
  --radius:      12px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 0 0 1px var(--border);
}

html, body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg);
  line-height: 1.5;
  height: 100%;
}

/* ── LAYOUT SHELL ─────────────────────────────────────────── */
#app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.sidebar-brand .brand-name span { color: var(--blue); }

.sidebar-brand .enterprise-pill {
  background: #1E3A5F;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  list-style: none;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0;
  transition: background .12s, color .12s;
}

.sidebar-nav li a:hover {
  background: var(--page-bg);
  color: var(--text);
}

.sidebar-nav li a.active {
  background: var(--blue-tint);
  color: var(--blue);
}

.sidebar-nav li a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.7;
}

.sidebar-nav li.help-item a {
  justify-content: space-between;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* ── MAIN CONTENT AREA ─────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── TOP BAR ───────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  gap: 12px;
  z-index: 90;
}

.topbar-spacer { flex: 1; }

.topbar-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background .12s;
}
.topbar-bell:hover { background: var(--page-bg); }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F97316;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── PAGE CONTENT ─────────────────────────────────────────── */
#page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── CARD ─────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
/* Content cards (settings/security/conversion) need inner padding so text isn't flush to
   the edges. The video-table card intentionally uses bare .card (table sits edge-to-edge). */
.section-card { padding: 22px 24px; }
.section-card > h2:first-child, .section-card > h3:first-child { margin-top: 0; margin-bottom: 16px; }
.page-heading-row { margin-bottom: 22px; }
.section-card + .section-card, .section-card + .card, .card + .section-card { margin-top: 20px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }

.btn-outline {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { background: var(--page-bg); }

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

/* ── PILLS ────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

.pill-on  { background: var(--green-bg); color: var(--green-text); }
.pill-off { background: var(--gray-bg);  color: var(--gray-text); }
.pill-blue { background: #EFF6FF; color: var(--blue-light); border: 1px solid #BFDBFE; }

.pill-new {
  background: transparent;
  color: var(--blue-light);
  border: 1px solid var(--blue-light);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.pill-processing {
  background: #FEF9C3;
  color: #854D0E;
}

.pill-error {
  background: #FEE2E2;
  color: var(--danger);
}

/* ── FORM ELEMENTS ────────────────────────────────────────── */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"] {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

input[type="color"] {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: var(--card-bg);
}

/* toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 8px; }

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.toggle input:checked + .toggle-track { background: var(--blue); }
.toggle-track::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
}
.toggle input:checked + .toggle-track::after { left: 18px; }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.modal-close:hover { background: var(--page-bg); color: var(--text); }

.modal-body { padding: 20px; }

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── TAB BAR ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-bar button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s, border-color .12s;
  font-family: inherit;
  margin-bottom: -1px;
}

.tab-bar button.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* ── CODE BLOCK ─────────────────────────────────────────── */
.code-block-wrap {
  position: relative;
  background: #0F172A;
  border-radius: 8px;
  overflow: hidden;
}

.code-block-wrap pre {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  color: #E2E8F0;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  max-height: 160px;
  overflow-y: auto;
}

.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .12s;
  font-family: inherit;
}
.code-copy-btn:hover { background: rgba(255,255,255,.2); }

/* ── THUMBNAIL ──────────────────────────────────────────── */
.video-thumb {
  width: 40px;
  height: 26px;
  background: #111;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.video-thumb-placeholder {
  width: 40px;
  height: 26px;
  background: #1F2937;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  font-size: 9px;
}

/* ── SEARCH INPUT WRAPPER ──────────────────────────────── */
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-wrap input {
  padding-right: 32px;
  min-width: 200px;
}

.search-wrap .search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ── TABLE ──────────────────────────────────────────────── */
.vt-table {
  width: 100%;
  border-collapse: collapse;
}

.vt-table thead tr {
  border-bottom: 1px solid var(--border);
}

.vt-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.vt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.vt-table tbody tr:last-child td { border-bottom: none; }

.vt-table tbody tr:hover td { background: #FAFAFA; }

.vt-table td.col-actions {
  width: 100px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}

.action-btn:hover { background: var(--page-bg); color: var(--text); }

/* ── SPINNER ────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 999px;
  transition: width .3s ease;
}

/* ── DROPZONE ────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--page-bg);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.dropzone .dz-icon { margin-bottom: 10px; color: var(--muted); }
.dropzone h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.dropzone p  { font-size: 13px; color: var(--muted); }

/* ── FEATURE LIST (Edit page) ───────────────────────────── */
.feature-list { list-style: none; }

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 4px;
  transition: background .1s;
}

.feature-item:hover { background: var(--page-bg); }
.feature-item.active { background: var(--blue-tint); }

.feature-item .feat-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}

.feature-item.active .feat-icon { color: var(--blue); }

.feature-item .feat-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── UTILITY ─────────────────────────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex  { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.text-muted { color: var(--muted); }
.text-sm { font-size: 12px; }
.fw-600 { font-weight: 600; }
.hidden { display: none !important; }
