/* ═══════════════════════════════════════════════════════════
   SEO Audit Pro — Base Reset & Primitives
   Fila-exact: Outfit font, 0.88rem body, Fila button/badge/card/form/table
   ═══════════════════════════════════════════════════════════ */

/* ── Reset (Fila Bootstrap-compatible) ── */
*, *::before, *::after { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }
::selection { background: rgba(var(--primary-rgb), 0.18); color: var(--text); }
body {
  margin: 0;
  font-family: var(--ff);
  font-size: 0.88rem;             /* Fila exact */
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
a { transition: all ease 0.5s; color: var(--text-muted); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }
button { font-family: var(--ff); }
p { margin-top: 0; margin-bottom: 15px; line-height: 1.3; }
p:last-child { margin-bottom: 0; }

/* ── Scrollbar (thin) ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-solid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Fila Typography (exact) ── */
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
h1, .h1 { font-size: 2.2rem; }
h2, .h2 { font-size: 2.024rem; }
h3, .h3 { font-size: 18px; font-weight: 500; margin-bottom: 0; }
h4, .h4 { font-size: 1.232rem; }
h5, .h5 { font-size: 0.88rem; }
h6, .h6 { font-size: 0.88rem; }

/* ── Fila Buttons (exact from style.css) ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0.375rem 0.75rem;             /* Fila exact */
  font-family: var(--ff);
  font-size: 0.88rem;                    /* Fila exact */
  font-weight: 400;                      /* Fila exact */
  line-height: 1.5;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--radius);           /* 0.375rem */
  background-color: transparent;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
              border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  white-space: nowrap;
}
.btn:hover { opacity: 0.92; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled {
  pointer-events: none; opacity: 0.65;
}

/* Fila btn-primary: #0f79f3 */
.btn-primary {
  color: #fff;
  background-color: #0f79f3;
  border-color: #0f79f3;
}
.btn-primary:hover {
  color: #fff; background-color: rgba(51, 141, 245, 1); border-color: rgba(39, 134, 244, 1);
}

/* Fila btn-success: #2ed47e */
.btn-success {
  color: #000; background-color: #2ed47e; border-color: #2ed47e;
}
.btn-success:hover { background-color: rgba(77, 218, 145, 1); }

/* Fila btn-danger: #e74c3c */
.btn-danger { color: #000; background-color: #e74c3c; border-color: #e74c3c; }
.btn-danger:hover { background-color: rgba(235, 103, 89, 1); }

/* Fila btn-warning: #ffb264 */
.btn-warning { color: #000; background-color: #ffb264; border-color: #ffb264; }
.btn-warning:hover { background-color: rgba(255, 190, 123, 1); }

/* Fila btn-info: #00cae3 */
.btn-info { color: #000; background-color: #00cae3; border-color: #00cae3; }
.btn-info:hover { background-color: rgba(38, 210, 231, 1); }

/* Fila btn-secondary: #475569 */
.btn-secondary { color: #fff; background-color: #475569; border-color: #475569; }
.btn-secondary:hover { background-color: rgba(60, 72, 89, 1); }

/* Fila Outline Buttons */
.btn-outline, .btn-outline-primary {
  color: #0f79f3; background: transparent; border-color: #0f79f3;
}
.btn-outline:hover, .btn-outline-primary:hover {
  color: #fff; background-color: #0f79f3; border-color: #0f79f3;
}
.btn-outline-success { color: #2ed47e; background: transparent; border-color: #2ed47e; }
.btn-outline-success:hover { color: #000; background-color: #2ed47e; }
.btn-outline-danger { color: #e74c3c; background: transparent; border-color: #e74c3c; }
.btn-outline-danger:hover { color: #000; background-color: #e74c3c; }
.btn-outline-secondary { color: #475569; background: transparent; border-color: #475569; }
.btn-outline-secondary:hover { color: #fff; background-color: #475569; }

/* Fila Ghost/Soft-style buttons */
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

/* Gradient Primary (special) */
.btn-gradient-primary {
  background: var(--primary-gradient); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-primary);
}
.btn-gradient-primary:hover { opacity: 0.92; box-shadow: 0 6px 20px rgba(15, 121, 243, 0.35); transform: translateY(-1px); }

/* Fila btn sizes */
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.77rem; border-radius: var(--radius-xs); }
.btn-lg { padding: 0.5rem 1rem; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-icon {
  width: 36px; height: 36px; padding: 0; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
  font-size: 0.9rem;
}
.btn-icon:hover { background: var(--bg-alt); color: var(--text); border-color: var(--border-solid); transform: scale(1.05); }
.btn-icon:active { transform: scale(0.96); }

/* ── Fila Badges (exact) ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius);
  transition: transform 150ms ease;
}
.badge:hover { transform: scale(1.04); }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-orange  { background: var(--orange-bg);  color: var(--orange); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: var(--bg-alt);     color: var(--text-muted); }

/* Pill-style badges */
.badge-pill { border-radius: var(--radius-pill); }

/* ── Fila Cards (exact) ── */
.card {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  color: var(--text);
  word-wrap: break-word;
  background-color: var(--surface);
  background-clip: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all ease 0.5s;
}
.card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.card-header {
  padding: 0.5rem 1rem;
  margin-bottom: 0;
  background-color: rgba(var(--primary-rgb), 0.03);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.card-header h3, .card-header h4 { margin: 0; }
.card-body {
  flex: 1 1 auto;
  padding: 1rem;
  color: var(--text);
}
.card-footer {
  padding: 0.5rem 1rem;
  background-color: rgba(var(--primary-rgb), 0.03);
  border-top: 1px solid var(--border);
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}

/* ── Fila Form Controls (exact) ── */
.form-control {
  width: 100%;
  background-color: #fff;
  border: 1px solid #dae0ec;
  height: 56px;
  color: #475569;
  font-size: 16px;
  padding: 14px 15px;
  font-family: var(--ff);
  transition: all ease 0.5s;
  border-radius: 5px;
  outline: none;
}
.form-control::placeholder { color: #919aa3; font-size: 16px; }
.form-control:focus {
  background-color: #fff;
  box-shadow: unset;
  outline: 0;
  border-color: #dae0ec;
  border-bottom: 2px solid #0f79f3;       /* Fila focus: blue bottom border */
  color: #8695AA;
}
[data-theme="dark"] .form-control {
  background-color: #1b232d;
  border-color: rgba(255, 255, 255, 0.149);
  color: #fff;
}
[data-theme="dark"] .form-control:focus {
  border-color: #0f79f3;
}

/* Compact form (for search bars, topbar) */
.form-control-compact {
  height: 40px;
  background-color: var(--bg-alt);
  border-color: var(--bg-alt);
  padding: 10px 15px;
  font-size: 14px;
  color: var(--text);
  border-radius: 3px;
}
.form-control-compact::placeholder { font-weight: 300; color: #94a0a9; font-size: 14px; }

.form-label {
  display: block; font-size: 15px; font-weight: var(--fw-medium);
  color: var(--heading-color); margin-bottom: 12px;
}

/* ── Fila Table (exact) ── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
thead tr th {
  background-color: var(--table-head-bg);  /* #e7effd */
  color: var(--heading-color);
  font-weight: 400;
  font-size: 16px;
  padding: 18px 20px;
  border: none;
  white-space: nowrap;
  user-select: none;
}
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--primary); }
tbody tr td {
  background-color: transparent;
  color: var(--heading-color);
  padding: 15px 20px;
  border-bottom: var(--table-border-dashed);    /* 1px dashed #e0e0e0 */
  font-size: 16px;
  font-weight: 400;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr[onclick] { cursor: pointer; }
tbody tr:hover { background: var(--surface-hover); box-shadow: var(--shadow-xs); }

/* ── Toast System ── */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 10000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 0.8125rem; font-weight: var(--fw-medium);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.5s var(--ease-bounce);
  max-width: 380px;
}
.toast.removing { animation: toastSlideOut 250ms var(--ease) forwards; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--primary); }
.toast i { font-size: 1rem; flex-shrink: 0; }
.toast-success i { color: var(--success); }
.toast-error i   { color: var(--danger); }
.toast-info i    { color: var(--primary); }

/* ── Progress Overlay ── */
.progress-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.progress-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 44px;
  box-shadow: var(--shadow-lg); text-align: center; min-width: 360px;
  animation: fadeUp 0.5s var(--ease);
}
.progress-card h3 { font-size: 1rem; font-weight: var(--fw-bold); margin-bottom: 6px; }
.progress-card p { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 18px; }
.progress-track {
  height: 6px; border-radius: 3px; background: var(--border-light); overflow: hidden; margin-bottom: 12px;
}
.progress-fill {
  height: 100%; border-radius: 3px; background: var(--primary-gradient);
  transition: width 0.4s var(--ease);
}
.progress-status { font-size: 0.75rem; color: var(--text-muted); }

/* ── Keyframes ── */
@keyframes toastSlideIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastSlideOut { to { opacity: 0; transform: translateX(60px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { 0% { opacity: 0; transform: translate3d(0, -100%, 0); } to { opacity: 1; transform: translateZ(0); } }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid transparent; border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.6s linear infinite;
}
.spinning i { animation: spin 0.6s linear infinite; }

/* ── Global Responsive Helpers ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Responsive table fallback */
@media (max-width: 767px) {
  thead tr th { padding: 12px 10px; font-size: 13px; }
  tbody tr td { padding: 10px; font-size: 13px; }
  .btn { padding: 0.4rem 0.7rem; font-size: 0.82rem; min-height: 40px; }
  .btn-icon { width: 40px; height: 40px; font-size: 0.9rem; }
  .badge { font-size: 0.7em; padding: 0.25em 0.5em; }
  .card-header { padding: 0.5rem 0.75rem; flex-wrap: wrap; }
  .card-body { padding: 0.75rem; }
  .toast { max-width: calc(100vw - 40px); }
  .toast-container { right: 10px; left: 10px; }
  .progress-card { padding: 24px 20px; min-width: auto; width: calc(100vw - 48px); }
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.3rem; }
  h3, .h3 { font-size: 1rem; }
  .form-control { height: 48px; font-size: 14px; padding: 12px; }
  .form-control::placeholder { font-size: 14px; }
  /* Touch targets: minimum 44px tap area */
  a, button { min-height: 44px; display: inline-flex; align-items: center; }
  .badge { min-height: auto; display: inline-flex; }
}
@media (max-width: 480px) {
  body { font-size: 0.82rem; }
  .btn-sm { padding: 0.2rem 0.4rem; font-size: 0.72rem; }
  .card { border-radius: var(--radius-sm); }
}
