/* ============================================================
   Scale Ads — Estilos Compartilhados
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variáveis ──────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:       #110936;
  --bg-surface:    #1c1250;
  --bg-card:       #180e48;
  --bg-card-hover: #221860;
  --bg-input:      rgba(255,255,255,0.06);

  /* Sidebar / navbar */
  --sidebar-bg:    #0b0628;
  --sidebar-hover: rgba(255,255,255,0.05);
  --sidebar-active:rgba(139,92,246,0.22);

  /* Brand purple */
  --brand:        #8b5cf6;
  --brand-hover:  #7c3aed;
  --brand-light:  #a78bfa;
  --brand-bright: #c084fc;
  --brand-dim:    rgba(139,92,246,0.12);
  --brand-glow:   rgba(139,92,246,0.35);

  /* Text */
  --text-primary:   #f0eeff;
  --text-secondary: #c4b5fd;
  --text-muted:     #7c6fab;
  --text-disabled:  rgba(255,255,255,0.22);

  /* Status */
  --green:    #16a34a;
  --green-bg: rgba(22,163,74,0.08);
  --red:      #dc2626;
  --red-bg:   rgba(220,38,38,0.08);
  --yellow:   #d97706;

  /* Borders */
  --border:       rgba(124,58,237,0.15);
  --border-bright:rgba(124,58,237,0.4);
  --border-card:  rgba(124,58,237,0.18);

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:   0 6px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.5);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 0 3px rgba(124,58,237,0.2);

  /* Misc */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  background-image:
    linear-gradient(rgba(139,92,246,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Botões secundários / ghost adaptados ao fundo escuro */

/* ── Tipografia ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: var(--brand); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--brand-hover); }

/* ── Botões ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 4px 16px rgba(124,58,237,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--border-bright);
  color: var(--brand);
  background: var(--brand-dim);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(220,38,38,0.15);
}
.btn-danger:hover { background: rgba(220,38,38,0.14); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-secondary);
  border-color: var(--border-bright);
  background: var(--brand-dim);
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Inputs ─────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.input::placeholder { color: var(--text-disabled); }
.input:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}

.input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group { margin-bottom: 18px; }

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

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge-up      { background: var(--green-bg); color: var(--green); }
.badge-down    { background: var(--red-bg);   color: var(--red);   }
.badge-neutral { background: var(--brand-dim); color: var(--brand); }

/* ── Skeleton loading ───────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.skeleton {
  background: #1d1250;
  border-radius: 6px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  border: 1px solid;
  animation: toast-in 0.25s ease forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}
.toast-success { color: var(--green); border-color: rgba(22,163,74,0.2); }
.toast-error   { color: var(--red);   border-color: rgba(220,38,38,0.2); }
.toast-info    { color: var(--brand); border-color: rgba(124,58,237,0.2); }

@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}
.toast.hiding { animation: toast-out 0.25s ease forwards; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,10,30,0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.97) translateY(8px);
  transition: transform 0.2s ease;
  position: relative;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--brand-dim);
  border-color: var(--border-bright);
  color: var(--brand);
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4cff0; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-bright); }

/* ── Utilitários ────────────────────────────────────────── */
.flex   { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.w-full { width: 100%; }
.relative { position: relative; }
.hidden { display: none !important; }
.text-center { text-align: center; }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── Spinner ────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(124,58,237,0.15);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
