/* RevUp Feeds — Admin Styles */

:root {
  --sidebar-width: 240px;
  --topbar-height: 54px;
  --accent: #4361ee;
  --accent-hover: #3a56d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg-body: #0f1117;
  --bg-card: #1a1d2e;
  --bg-card-hover: #1e2235;
  --border-color: rgba(255,255,255,0.08);
  --text-muted: rgba(255,255,255,0.45);
  --text-normal: rgba(255,255,255,0.85);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body {
  background-color: var(--bg-body);
  color: var(--text-normal);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.875rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  background-color: #13162b !important;
  border-right: 1px solid var(--border-color) !important;
}

.sidebar .nav-link {
  color: rgba(255,255,255,0.6);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  margin-bottom: 2px;
  transition: all .15s ease;
  font-size: 0.82rem;
}

.sidebar .nav-link:hover {
  color: #fff;
  background-color: rgba(255,255,255,0.07);
}

.sidebar .nav-link.active {
  color: #fff;
  background-color: var(--accent);
  font-weight: 500;
}

.sidebar .nav-link i {
  opacity: 0.75;
}

.sidebar .nav-link.active i {
  opacity: 1;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  padding: 1rem 1.25rem;
}

/* ── Stat cards ───────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background .15s;
}

.stat-card:hover {
  background: var(--bg-card-hover);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(67,97,238,0.15); color: #4361ee; }
.stat-icon.green  { background: rgba(16,185,129,0.15); color: #10b981; }
.stat-icon.yellow { background: rgba(245,158,11,0.15); color: #f59e0b; }
.stat-icon.red    { background: rgba(239,68,68,0.15);  color: #ef4444; }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.stat-icon.cyan   { background: rgba(6,182,212,0.15);  color: #06b6d4; }

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table {
  color: var(--text-normal);
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255,255,255,0.02);
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  --bs-table-border-color: var(--border-color);
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  padding: 0.75rem 1rem;
}

.table td {
  padding: 0.7rem 1rem;
  vertical-align: middle;
  border-color: var(--border-color);
}

/* ── Badges / status pills ────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
}

.badge-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-status.status-success  { background: rgba(16,185,129,.15); color: #10b981; }
.badge-status.status-success::before  { background: #10b981; }
.badge-status.status-error    { background: rgba(239,68,68,.15);  color: #ef4444; }
.badge-status.status-error::before    { background: #ef4444; }
.badge-status.status-warning  { background: rgba(245,158,11,.15); color: #f59e0b; }
.badge-status.status-warning::before  { background: #f59e0b; }
.badge-status.status-pending  { background: rgba(100,116,139,.15); color: #94a3b8; }
.badge-status.status-pending::before  { background: #94a3b8; }
.badge-status.status-running  { background: rgba(59,130,246,.15); color: #3b82f6; }
.badge-status.status-running::before  { background: #3b82f6; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.form-control:focus, .form-select:focus {
  background-color: rgba(255,255,255,0.07);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67,97,238,.2);
  color: #fff;
}

.form-control::placeholder {
  color: rgba(255,255,255,0.3);
}

.form-select option {
  background-color: #1a1d2e;
  color: #fff;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.3rem;
}

.form-text {
  color: var(--text-muted);
  font-size: 0.74rem;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

/* ── Alert toast area ─────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
}

/* ── Code / mono ──────────────────────────────────────────────────────────── */
.code-mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  background: rgba(0,0,0,.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.feed-url-box {
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: monospace;
  font-size: 0.78rem;
  color: #10b981;
  word-break: break-all;
}

/* ── Source type icons ────────────────────────────────────────────────────── */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.source-badge.shopify     { background: rgba(150,191,71,.15);  color: #96bf47; }
.source-badge.woocommerce { background: rgba(150,88,138,.15);  color: #96588a; }
.source-badge.xml_feed    { background: rgba(14,165,233,.15);  color: #0ea5e9; }

/* ── Validation severity ──────────────────────────────────────────────────── */
.issue-error   { color: #ef4444; }
.issue-warning { color: #f59e0b; }
.issue-info    { color: #3b82f6; }

/* ── Rule builder ─────────────────────────────────────────────────────────── */
.rule-condition-row,
.rule-action-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
}

/* ── Mapping rows ─────────────────────────────────────────────────────────── */
.mapping-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress {
  background-color: rgba(255,255,255,0.08);
  height: 6px;
  border-radius: 3px;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  opacity: 0.3;
  display: block;
  margin-bottom: 1rem;
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  background-image: radial-gradient(ellipse at 60% 50%, rgba(67,97,238,0.08) 0%, transparent 60%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo svg {
  width: 52px;
  height: 52px;
}

/* ── AI badge ─────────────────────────────────────────────────────────────── */
.ai-badge {
  background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(67,97,238,.2));
  border: 1px solid rgba(139,92,246,.3);
  color: #a78bfa;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}

/* ── Responsive tweaks ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    display: none !important;
  }
  main {
    padding: 1rem !important;
  }
}
