/* ============================================================
   AiDoesSEO — Base Reset & Typography
   ============================================================ */

@import url('https://api.fontshare.com/v2/css?f[]=cabinet-grotesk@400,500,600,700,800&f[]=general-sans@400,500,600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Headings ── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* ── Text ── */

p { line-height: var(--leading-relaxed); }

a {
  color: var(--mint);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover { opacity: 0.8; }

/* Article body links follow themed token, not hardcoded mint */
.article-body a { color: var(--article-link); }
.article-body a:hover { opacity: 0.8; }

strong { font-weight: var(--weight-semibold); }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  color: var(--mint);
}

pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ── Lists ── */

ul, ol { padding-left: var(--space-6); }
li { margin-bottom: var(--space-1); }

/* ── Images ── */

img, video {
  max-width: 100%;
  display: block;
}

/* ── Forms (base reset) ── */

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button { cursor: pointer; }

input:focus, textarea:focus, select:focus, button:focus {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

/* ── Tables ── */

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: var(--space-3) var(--space-4); }
th { font-weight: var(--weight-semibold); font-size: var(--text-sm); color: var(--text-secondary); }

/* ── Scrollbar ── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ── Selection ── */

::selection {
  background: var(--mint-glow-md);
  color: var(--text-primary);
}

/* ── Utility Classes ── */

.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;
}

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.text-mint    { color: var(--mint); }
.text-muted   { color: var(--text-secondary); }
.text-sm      { font-size: var(--text-sm); }
.text-xs      { font-size: var(--text-xs); }
.text-lg      { font-size: var(--text-lg); }
.text-center  { text-align: center; }
.font-mono    { font-family: var(--font-mono); }
.font-bold    { font-weight: var(--weight-bold); }
.font-semibold{ font-weight: var(--weight-semibold); }

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2        { gap: var(--space-2); }
.gap-3        { gap: var(--space-3); }
.gap-4        { gap: var(--space-4); }
.gap-6        { gap: var(--space-6); }
.gap-8        { gap: var(--space-8); }

.grid         { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }

.p-4   { padding: var(--space-4); }
.p-6   { padding: var(--space-6); }
.py-2  { padding-block: var(--space-2); }
.py-4  { padding-block: var(--space-4); }
.px-4  { padding-inline: var(--space-4); }
.px-6  { padding-inline: var(--space-6); }

.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-full{ border-radius: var(--radius-full); }

.hidden       { display: none !important; }
.block        { display: block; }
.w-full       { width: 100%; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-6) 0;
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.badge-mint    { background: var(--mint-glow);    color: var(--mint);    border: 1px solid var(--border-mint); }
.badge-success { background: var(--success-bg);   color: var(--success); }
.badge-warning { background: var(--warning-bg);   color: var(--warning); }
.badge-error   { background: var(--error-bg);     color: var(--error); }
.badge-info    { background: var(--info-bg);      color: var(--info); }
.badge-neutral { background: var(--bg-elevated);  color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Mint gradient text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--mint) 0%, #00B8FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── WhatsApp FAB ── */
.whatsapp-fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-fab);
  width: 56px; height: 56px;
  background: var(--mint);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A0A0F;
  box-shadow: var(--shadow-mint), var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  text-decoration: none;
}
.whatsapp-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 0 32px rgba(0, 229, 160, 0.35), var(--shadow-lg);
  opacity: 1;
}

/* ── Done-For-You Setup FAB ── */
.setup-fab {
  position: fixed;
  bottom: calc(var(--space-6) + 56px + var(--space-3));
  right: var(--space-6);
  z-index: var(--z-fab);
  width: 56px; height: 56px;
  background: var(--mint);
  border-radius: var(--radius-full);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0A0A0F;
  box-shadow: var(--shadow-mint), var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.setup-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 0 32px rgba(0, 229, 160, 0.35), var(--shadow-lg);
}
.setup-price {
  font-size: 2rem; font-weight: 700; color: var(--mint);
  margin-top: var(--space-4); line-height: 1.2;
}
.setup-price span {
  font-size: 0.875rem; font-weight: 400;
  color: var(--text-muted); display: block; margin-top: 2px;
}
.setup-features {
  list-style: none; padding: 0; margin: var(--space-4) 0 0;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.setup-features li {
  display: flex; align-items: flex-start; gap: var(--space-2);
  font-size: 0.9rem; color: var(--text-secondary);
}
.setup-features li::before {
  content: '✓'; color: var(--mint); font-weight: 700; flex-shrink: 0;
}

/* ── Toast notifications ── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  width: min(480px, calc(100vw - var(--space-8)));
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  pointer-events: auto;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease forwards;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--error); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info    { border-left: 3px solid var(--info); }
.toast.removing { animation: toast-out 0.2s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}

/* ── Loading spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page loader ── */
#page-loader {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity var(--transition-slow);
}
#page-loader.active { display: flex; }
#page-loader.fade-out { opacity: 0; pointer-events: none; }

/* ── Light Theme Overrides ── */
body.light-theme {
  color: var(--text-primary);
  background-color: var(--bg-base);
}
body.light-theme ::-webkit-scrollbar-track { background: #F0F0EE; }
body.light-theme ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); }
body.light-theme ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.28); }
body.light-theme ::selection { background: rgba(0,200,140,0.18); color: #111111; }
body.light-theme code { background: #F0F0EE; color: #009966; border-color: rgba(0,0,0,0.08); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .container { padding-inline: var(--space-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
