/* ═══════════════════════════════════════════════
   Gold Plak SEO — Design System
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Colors - Premium Sleek Light Slate Theme */
  --bg-base:      #f1f5f9;     /* Soft slate background */
  --bg-surface:   #ffffff;     /* White container surfaces */
  --bg-card:      #ffffff;     /* White card components */
  --bg-elevated:  #f8fafc;     /* Very light slate elevated background */
  --border:       #e2e8f0;     /* Slate border line */
  --border-light: #cbd5e1;     /* Distinct slate border line */

  --text-primary:   #0f172a;   /* Rich dark slate main text */
  --text-secondary: #475569;   /* Sleek slate secondary text */
  --text-muted:     #94a3b8;   /* Soft slate muted text */

  --accent:       #2563eb;     /* Professional blue brand accent */
  --accent-hover: #1d4ed8;
  --accent-glow:  rgba(37,99,235,0.06);

  --gold:         #d97706;     /* Solid Gold Plak branding accent */
  --gold-light:   #f59e0b;
  --gold-glow:    rgba(217,119,6,0.06);

  --success:  #10b981;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --info:     #06b6d4;

  --dofollow-color: #10b981;
  --nofollow-color: #64748b;

  /* Gradients */
  --grad-accent: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  --grad-gold:   linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-success:linear-gradient(135deg, #34d399 0%, #10b981 100%);
  --grad-danger: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  --grad-card:   linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

  /* Shadows - Crisp, soft light mode shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(15,23,42,0.03);
  --shadow-lg:  0 8px 24px rgba(15,23,42,0.05);
  --shadow-accent: 0 4px 14px rgba(37,99,235,0.1);
  --shadow-gold:   0 4px 14px rgba(217,119,6,0.1);

  /* Spacing */
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Layout ────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition-slow);
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--grad-gold);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-gold);
}
.sidebar-logo .logo-text { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.sidebar-logo .logo-sub  { font-size: 10px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  font-size: 13.5px; font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-elevated); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--grad-accent);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-icon-flat {
  width: 18px;
  height: 18px;
  stroke-width: 1.8px;
  color: var(--text-secondary);
  transition: color var(--transition);
  flex-shrink: 0;
}
.nav-item:hover .nav-icon-flat { color: var(--text-primary); }
.nav-item.active .nav-icon-flat { color: var(--accent); }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* Page Content */
.page-content { padding: 24px; flex: 1; }

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Stat Cards */
.stat-card {
  background: var(--grad-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-accent);
}
.stat-card.gold::before { background: var(--grad-gold); }
.stat-card.success::before { background: var(--grad-success); }
.stat-card.danger::before { background: var(--grad-danger); }

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-light); }
.stat-icon { font-size: 22px; margin-bottom: 4px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-change { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Grids */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(79,142,247,0.35); }
.btn-gold {
  background: var(--grad-gold);
  color: #fff;
  box-shadow: var(--shadow-gold);
}
.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-light); }
.btn-danger { background: var(--grad-danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; letter-spacing: 0.3px; }
.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b9dc3' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Table ──────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(30,45,69,0.6);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg-elevated); color: var(--text-primary); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  font-size: 11px; font-weight: 600;
  border-radius: 20px;
}
.badge-success  { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-warning  { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger   { background: rgba(239,68,68,0.15);  color: var(--danger); }
.badge-info     { background: rgba(6,182,212,0.15);  color: var(--info); }
.badge-muted    { background: rgba(107,114,128,0.15); color: var(--text-muted); }
.badge-accent   { background: var(--accent-glow); color: var(--accent); }
.badge-gold     { background: var(--gold-glow); color: var(--gold); }
.badge-dofollow { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-nofollow { background: rgba(107,114,128,0.15); color: var(--text-muted); }

/* ── Rank display ───────────────────────────────── */
.rank-display { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.rank-num { font-size: 18px; color: var(--text-primary); }
.rank-change { font-size: 11px; font-weight: 700; display: flex; align-items: center; }
.rank-change.up   { color: var(--success); }
.rank-change.down { color: var(--danger); }
.rank-change.same { color: var(--text-muted); }
.rank-top3  { color: var(--gold); }
.rank-top10 { color: var(--success); }
.rank-top20 { color: var(--info); }
.rank-out   { color: var(--text-muted); }

/* ── Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 760px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; line-height: 1; padding: 4px; transition: color var(--transition); }
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Tabs ───────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition); cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Alerts ─────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 13px; display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: var(--warning); }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2); color: var(--success); }
.alert-danger  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.2);  color: var(--danger); }
.alert-info    { background: rgba(6,182,212,0.1);  border: 1px solid rgba(6,182,212,0.2);  color: var(--info); }

/* ── Filters bar ────────────────────────────────── */
.filters-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.filters-bar .form-control { max-width: 200px; }
.search-input { max-width: 280px !important; }

/* ── Progress ───────────────────────────────────── */
.progress-bar { height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--grad-accent); transition: width 0.5s ease; }
.progress-fill.gold { background: var(--grad-gold); }
.progress-fill.success { background: var(--grad-success); }

/* ── Empty State ────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Toast ──────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(100%); }
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Loading ────────────────────────────────────── */
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
