/* ═══════════════════════════════════════════════════════════════════════════
   GW2 Companion — Design System
   Inspirado em Guild Wars 2. Não copia. Adapta.
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ── Variáveis ──────────────────────────────────────────────────────────── */
:root {
  /* Cores base — dark navy (mais confortável em sessões longas que pure black) */
  --bg:          #0d0f14;
  --surface-1:   #141926;
  --surface-2:   #1b2235;
  --surface-3:   #222c44;
  --border-dim:  #2a3555;
  --border-mid:  #3a4a70;

  /* Paleta GW2 */
  --gold:        #D4A527;
  --gold-bright: #ffc107;
  --gold-dim:    rgba(212,165,39,.18);
  --gold-glow:   rgba(212,165,39,.08);
  --teal:        #1EBAC2;
  --teal-dim:    rgba(30,186,194,.18);
  --dragon-red:  #C04040;
  --dragon-dim:  rgba(192,64,64,.2);

  /* Texto — todos WCAG AA em surface-1 (#141926) */
  --text-hi:     #edf1ff;   /* contraste: ~15:1 */
  --text-body:   #b5c3de;   /* contraste: ~9:1  */
  --text-muted:  #7e8fb0;   /* contraste: ~5.7:1 — WCAG AA ✓ */
  --text-dim:    #4a5878;   /* decorativo; não usar em texto de conteúdo */

  /* Profissões */
  --prof-guardian:     #72C1D9;
  --prof-warrior:      #FFD166;
  --prof-ranger:       #8DC252;
  --prof-thief:        #C08F95;
  --prof-elementalist: #F68A87;
  --prof-necromancer:  #52A76F;
  --prof-revenant:     #D16E5A;
  --prof-mesmer:       #B679D5;
  --prof-engineer:     #D09C59;

  /* Espaçamento */
  --radius:    8px;
  --radius-lg: 12px;
}

/* ── Reset e base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text-body);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: .9375rem;
  line-height: 1.55;
  min-height: 100vh;
}

/* Títulos com Cinzel */
h1, h2, h3, h4, h5, .cinzel {
  font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
  letter-spacing: .025em;
  color: var(--text-hi);
}
h4 { font-size: 1.1rem; }
h5 { font-size: .95rem; }

a { color: var(--gold); }
a:hover { color: var(--gold-bright); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1) !important;
  border: 1px solid var(--border-dim) !important;
  border-radius: var(--radius) !important;
  transition: border-color .2s, box-shadow .2s;
}
.card-header {
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border-dim) !important;
  padding: .65rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.card-body { padding: 1rem; }

/* Cards clicáveis */
a.text-decoration-none .card:hover,
.card.clickable:hover {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 1px var(--gold-dim), 0 4px 20px rgba(0,0,0,.4);
}

/* ── List groups ────────────────────────────────────────────────────────── */
.list-group-item {
  background: var(--surface-1) !important;
  border-color: var(--border-dim) !important;
  color: var(--text-body);
  transition: background .15s, border-color .15s;
}
.list-group-item-action:hover {
  background: var(--surface-2) !important;
  border-color: var(--border-mid) !important;
}

/* ── Tabelas ────────────────────────────────────────────────────────────── */
.table-dark {
  --bs-table-bg: var(--surface-1);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--surface-3);
  --bs-table-border-color: var(--border-dim);
  color: var(--text-body);
}
.table-dark th { color: var(--text-muted); font-size: .8rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.table-dark td { vertical-align: middle; }

/* ── Barras de progresso ────────────────────────────────────────────────── */
.progress {
  background: var(--surface-3);
  border-radius: 100px;
  overflow: visible;
}
.progress-bar {
  border-radius: 100px;
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.progress-bar.bg-warning  { background: linear-gradient(90deg, #b8850a, var(--gold-bright)) !important; }
.progress-bar.bg-success  { background: linear-gradient(90deg, #155a2a, #28a745) !important; }
.progress-bar.bg-info     { background: linear-gradient(90deg, #0a5c82, var(--teal)) !important; }
.progress-bar.bg-secondary{ background: var(--surface-3) !important; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge-api   { background:var(--teal-dim);   color:var(--teal);  border:1px solid rgba(30,186,194,.35); font-weight:500; }
.badge-calc  { background:var(--gold-dim);   color:var(--gold);  border:1px solid rgba(212,165,39,.35); font-weight:500; }
.badge-manual{ background:rgba(120,120,120,.15); color:#9aabb0; border:1px solid rgba(120,120,120,.3); }
.badge-inferred{ background:rgba(180,100,200,.15); color:#c49de0; border:1px solid rgba(180,100,200,.35); }

/* Profissão */
.badge-prof {
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .2em .55em;
  border-radius: 4px;
  border: 1px solid currentColor;
  background: rgba(currentColor,.08);
}

/* ── Source badges — estado de verificação de cada passo ────────────────── */
.source-badge {
  display: inline-block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .15em .5em;
  border-radius: 100px;
  vertical-align: middle;
  line-height: 1.4;
}
.source-api         { background: var(--teal-dim); color: var(--teal); border: 1px solid rgba(30,186,194,.3); }
.source-manual      { background: rgba(120,120,120,.15); color: #9aabb0; border: 1px solid rgba(120,120,120,.3); }
.source-not_started { background: rgba(100,130,220,.12); color: #7ca0e8; border: 1px solid rgba(100,130,220,.3); }

/* ── Profissões (cores e bordas) ────────────────────────────────────────── */
.prof-guardian     { color: var(--prof-guardian)     !important; }
.prof-warrior      { color: var(--prof-warrior)      !important; }
.prof-ranger       { color: var(--prof-ranger)       !important; }
.prof-thief        { color: var(--prof-thief)        !important; }
.prof-elementalist { color: var(--prof-elementalist) !important; }
.prof-necromancer  { color: var(--prof-necromancer)  !important; }
.prof-revenant     { color: var(--prof-revenant)     !important; }
.prof-mesmer       { color: var(--prof-mesmer)       !important; }
.prof-engineer     { color: var(--prof-engineer)     !important; }

.border-prof-guardian     { border-top-color: var(--prof-guardian)     !important; }
.border-prof-warrior      { border-top-color: var(--prof-warrior)      !important; }
.border-prof-ranger       { border-top-color: var(--prof-ranger)       !important; }
.border-prof-thief        { border-top-color: var(--prof-thief)        !important; }
.border-prof-elementalist { border-top-color: var(--prof-elementalist) !important; }
.border-prof-necromancer  { border-top-color: var(--prof-necromancer)  !important; }
.border-prof-revenant     { border-top-color: var(--prof-revenant)     !important; }
.border-prof-mesmer       { border-top-color: var(--prof-mesmer)       !important; }
.border-prof-engineer     { border-top-color: var(--prof-engineer)     !important; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
  background: rgba(10,12,18,.95) !important;
  border-bottom: 1px solid var(--border-mid) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.navbar-brand {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--gold) !important;
}
.nav-link {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .02em;
  padding: .35rem .55rem !important;
  color: var(--text-muted) !important;
  transition: color .15s, background .15s;
  border-radius: 4px;
}
.nav-link:hover { color: var(--text-body) !important; background: var(--surface-2); }
.nav-link.active-page {
  color: var(--gold) !important;
  background: var(--gold-glow);
  font-weight: 600;
}

@media (max-width: 991px) {
  #navLinks {
    padding: .5rem 0;
    border-top: 1px solid var(--border-dim);
    margin-top: .5rem;
  }
  #navLinks .nav-link { padding: .4rem .75rem !important; }
  #navLinks .nav-link.active-page {
    border-left: 3px solid var(--gold);
    border-radius: 0 4px 4px 0;
    padding-left: .6rem !important;
  }
}

/* ── Botões ─────────────────────────────────────────────────────────────── */
.btn { font-weight: 500; letter-spacing: .02em; border-radius: 6px; transition: all .2s; }
.btn-warning {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 600;
}
.btn-warning:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: #000; }
.btn-outline-warning { color: var(--gold); border-color: var(--gold); }
.btn-outline-warning:hover { background: var(--gold-dim); color: var(--gold); border-color: var(--gold); }
.btn-outline-secondary { color: var(--text-muted); border-color: var(--border-mid); }
.btn-outline-secondary:hover { background: var(--surface-2); color: var(--text-body); border-color: var(--border-mid); }

/* ── Formulários ────────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--surface-2) !important;
  border-color: var(--border-mid) !important;
  color: var(--text-hi) !important;
  border-radius: 6px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(212,165,39,.15) !important;
  background: var(--surface-3) !important;
}
.form-control::placeholder { color: var(--text-dim) !important; }
.form-label { color: var(--text-muted); font-size: .85rem; font-weight: 500; }

/* ── Alertas ────────────────────────────────────────────────────────────── */
.alert { border-radius: var(--radius); border-left-width: 4px; }
.alert-warning  { background: rgba(212,165,39,.08);  border-color: var(--gold);       color: var(--text-body); }
.alert-danger   { background: var(--dragon-dim);     border-color: var(--dragon-red); color: var(--text-body); }
.alert-secondary{ background: var(--surface-2);      border-color: var(--border-mid); color: var(--text-muted); }
.alert-info     { background: var(--teal-dim);       border-color: var(--teal);       color: var(--text-body); }

/* ── Cards de destaque ──────────────────────────────────────────────────── */
.focus-card     { border-left: 3px solid var(--gold)       !important; }
.teal-card      { border-left: 3px solid var(--teal)       !important; }
.danger-card    { border-left: 3px solid var(--dragon-red) !important; }
.success-card   { border-left: 3px solid #28a745           !important; }

/* Next step highlight */
.next-step-highlight {
  border-left: 3px solid var(--teal) !important;
  background: rgba(30,186,194,.06) !important;
}

/* ── Waypoint pill — copiável ───────────────────────────────────────────── */
.wp-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .6rem;
  border-radius: 100px;
  background: rgba(30,186,194,.1);
  border: 1px solid rgba(30,186,194,.3);
  color: var(--teal);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
  line-height: 1.4;
}
.wp-pill:hover {
  background: rgba(30,186,194,.2);
  border-color: var(--teal);
  color: var(--teal);
}
.wp-pill.wp-copied {
  background: rgba(40,167,69,.15);
  border-color: rgba(40,167,69,.4);
  color: #5cb85c;
}
.wp-copy-hint { opacity: .5; font-size: .65em; }

/* ── Guide items ────────────────────────────────────────────────────────── */
.guide-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--border-dim);
  transition: background .15s;
}
.guide-item:last-child { border-bottom: none; }
.guide-item.item-done { opacity: .7; }
.guide-item.item-next { background: rgba(30,186,194,.04); border-radius: 6px; padding: .75rem .5rem; margin: 0 -.5rem; }

.item-status-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: .9rem;
  line-height: 1.5;
  margin-top: .1rem;
}
.item-body { flex-grow: 1; min-width: 0; }
.item-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1.3;
}
.item-name.done { color: var(--text-muted); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--border-mid); }
.item-next-badge {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid rgba(30,186,194,.4);
  background: rgba(30,186,194,.1);
  padding: .1em .45em;
  border-radius: 100px;
  vertical-align: middle;
  margin-left: .3rem;
}

.item-como {
  margin-top: .35rem;
  padding-left: .75rem;
  border-left: 2px solid var(--border-dim);
}
.item-como-step {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}
.item-como-step + .item-como-step { margin-top: .15rem; }
.item-como-step::before { content: "→"; flex-shrink: 0; color: var(--text-dim); }

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: .4rem;
}
.cost-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  padding: .15em .55em;
  border-radius: 100px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid rgba(212,165,39,.3);
  font-variant-numeric: tabular-nums;
}
.free-badge {
  font-size: .7rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Goal step rows ─────────────────────────────────────────────────────── */
.goal-step-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-dim);
}
.goal-step-row:last-child { border-bottom: none; }
.goal-step-row.step-is-next {
  border-left: 3px solid var(--teal);
  background: rgba(30,186,194,.05);
  border-radius: 0 6px 6px 0;
  padding: .6rem .6rem .6rem .5rem;
  margin-left: -2px;
}
.step-status-icon { flex-shrink: 0; font-size: .9rem; line-height: 1.6; width: 20px; text-align: center; }
.step-text-col { flex-grow: 1; min-width: 0; }
.step-name-line {
  font-size: .875rem;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}

/* ── Hero (Today page) ──────────────────────────────────────────────────── */
.today-hero {
  background: linear-gradient(135deg, #110f02 0%, #0c1020 40%, #080c18 100%);
  border: 1px solid rgba(212,165,39,.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.today-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(212,165,39,.06) 0%, transparent 60%);
  pointer-events: none;
}
.today-hero-meta  { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 700; margin-bottom: .35rem; }
.today-hero-title { font-size: 1.65rem; font-family: 'Cinzel', Georgia, serif; color: var(--text-hi); margin-bottom: .4rem; line-height: 1.2; }
.today-hero-reason{ font-size: .875rem; color: var(--text-muted); margin-bottom: 1rem; max-width: 60ch; line-height: 1.45; }

/* ── Filtro de tempo ────────────────────────────────────────────────────── */
.time-filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.time-filter-btn {
  padding: .35rem .9rem;
  border-radius: 100px;
  border: 1px solid var(--border-mid);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.time-filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.time-filter-btn.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); font-weight: 600; }

/* ── Session action cards ───────────────────────────────────────────────── */
.session-substeps {
  list-style: none;
  padding: 0;
  margin: .4rem 0 0;
  border-left: 2px solid var(--border-dim);
  padding-left: .75rem;
}
.session-substeps li {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}
.session-substeps li + li { margin-top: .15rem; }
.session-substeps li::before { content: "→"; flex-shrink: 0; color: var(--text-dim); }

/* ── Spec icons ─────────────────────────────────────────────────────────── */
.spec-icon {
  width: 20px; height: 20px;
  border-radius: 3px;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
}
.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .45rem;
  border-radius: 4px;
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.spec-badge.elite  { background: var(--gold-dim);  color: var(--gold);  border: 1px solid rgba(212,165,39,.3); }
.spec-badge.base   { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border-mid); }

/* ── Currency widget ────────────────────────────────────────────────────── */
.currency-icon {
  width: 22px; height: 22px;
  border-radius: 3px;
  vertical-align: middle;
  object-fit: contain;
  flex-shrink: 0;
}
.currency-row {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border-dim);
  font-size: .875rem;
}
.currency-row:last-child { border-bottom: none; }
.currency-value { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--text-hi); margin-left: auto; }

/* ── Mounts ─────────────────────────────────────────────────────────────── */
.mount-emoji { font-size: 2rem; line-height: 1; }
.mount-owned   { border-color: #1a4a2a !important; background: linear-gradient(135deg, #0a150e, var(--surface-1)) !important; }
.mount-missing { opacity: .72; }

/* ── Mastery icons ──────────────────────────────────────────────────────── */
.mastery-icon { width: 28px; height: 28px; border-radius: 50%; object-fit: contain; flex-shrink: 0; }

/* ── Goal category icons ────────────────────────────────────────────────── */
.goal-cat-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }

/* ── Loading states ─────────────────────────────────────────────────────── */
.chart-spinner { display: flex; align-items: center; justify-content: center; height: 120px; color: var(--text-muted); }

@keyframes skeleton-pulse { 0%,100%{opacity:.4} 50%{opacity:.7} }
.skeleton {
  background: var(--surface-2);
  border-radius: 4px;
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}

/* ── Empty states ───────────────────────────────────────────────────────── */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .4; }
.empty-state p { margin: 0; font-size: .875rem; }

/* ── Sync animation ─────────────────────────────────────────────────────── */
@keyframes pulse-sync { 0%,100%{opacity:1} 50%{opacity:.5} }
.sync-running { animation: pulse-sync 1.2s ease-in-out infinite; }

/* ── Breadcrumbs ────────────────────────────────────────────────────────── */
.breadcrumb { background: none; padding: 0; }
.breadcrumb-item a { color: var(--gold); text-decoration: none; font-size: .85rem; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--text-muted); font-size: .85rem; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-dim); }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 40%, rgba(212,165,39,.06) 0%, transparent 55%),
              radial-gradient(ellipse at 70% 70%, rgba(30,186,194,.04) 0%, transparent 55%),
              var(--bg);
}
.login-card {
  width: min(400px, 96vw);
  background: var(--surface-1) !important;
  border: 1px solid rgba(212,165,39,.2) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 8px 60px rgba(0,0,0,.6), 0 0 0 1px var(--border-dim);
}
.login-logo { font-size: 2.8rem; }
.login-divider { border-color: var(--border-dim); }

/* ── Utilitários ────────────────────────────────────────────────────────── */
.text-gold   { color: var(--gold)       !important; }
.text-teal   { color: var(--teal)       !important; }
.text-dragon { color: var(--dragon-red) !important; }
.text-hi     { color: var(--text-hi)    !important; }
.text-body-custom { color: var(--text-body) !important; }
.text-muted  { color: var(--text-muted) !important; }
.bg-surface-2 { background: var(--surface-2) !important; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-mid); }

/* ── HTMX ───────────────────────────────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }

/* ── Responsividade extra ───────────────────────────────────────────────── */
@media (max-width: 576px) {
  .today-hero-title { font-size: 1.25rem; }
  .today-hero { padding: 1.25rem; }
  .card-body { padding: .75rem; }
  .guide-item { gap: .5rem; }
}
