/* ============================================================
   dashboard.css — Authenticated dashboard page
   Inherits: shared.css → app.css
   ============================================================ */

/* --- App nav (dashboard-specific: avatar + dropdown) ------ */
.nav-right { position: relative; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  cursor: pointer; user-select: none; transition: opacity 0.2s;
}
.nav-avatar:hover { opacity: 0.85; }
.nav-dropdown {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 6px; min-width: 200px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown.open { display: block; }
.nav-dropdown-email {
  font-size: 12px; color: var(--muted);
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-dropdown-item {
  display: block; width: 100%;
  font-family: inherit; font-size: 13px; font-weight: 400;
  color: var(--text); background: transparent; border: none;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  text-align: left; transition: background 0.15s;
}
.nav-dropdown-item:hover { background: rgba(242,237,228,0.06); }
.nav-dropdown-item.danger { color: #E05252; }

/* --- Layout override -------------------------------------- */
.main { padding: 100px 24px 80px; max-width: 960px; }
.section { margin-bottom: 56px; }

/* --- Greeting --------------------------------------------- */
.greeting { margin-bottom: 48px; }
.greeting h1 {
  font-family: 'Fraunces', serif; font-weight: 900;
  font-size: clamp(32px, 5vw, 52px); letter-spacing: -1.5px; line-height: 1.05;
}
.greeting h1 em { font-style: italic; color: var(--accent); }
.greeting p { color: var(--muted); margin-top: 8px; font-size: 15px; }

/* --- Character grid --------------------------------------- */
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.char-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
  transition: border-color 0.2s, transform 0.15s;
}
.char-card:hover { border-color: rgba(232,96,28,0.2); transform: translateY(-1px); }
.char-card.owned { border-color: var(--green-border); }
.char-header { display: flex; align-items: center; gap: 14px; }
.char-header-info { flex: 1; min-width: 0; }
.char-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 17px; }
.char-level { font-size: 12px; color: var(--muted); margin-top: 2px; }
.char-desc { font-size: 13px; color: var(--muted); line-height: 1.55; }
.char-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; padding: 3px 10px;
  border-radius: 20px; align-self: flex-start;
}
.char-badge.active  { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.char-badge.inactive { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* --- In-card stats ---------------------------------------- */
.char-stats { display: flex; background: var(--surface2); border-radius: 12px; overflow: hidden; }
.stat { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }

/* --- Subscription bar (in-card) --------------------------- */
.subscription-bar { display: flex; flex-direction: column; gap: 8px; }
.sub-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.sub-label .sub-expires { color: var(--text); font-weight: 500; }

/* --- Buttons ---------------------------------------------- */
.btn-buy {
  background: transparent; color: var(--accent);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  padding: 9px 18px; border-radius: 40px;
  border: 1px solid rgba(232,96,28,0.35); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}
.btn-buy:hover { background: rgba(232,96,28,0.08); }

.btn-renew {
  background: rgba(224,82,82,0.1); color: #E05252;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  padding: 9px 18px; border-radius: 40px;
  border: 1px solid rgba(224,82,82,0.3); cursor: pointer;
  display: inline-flex; align-items: center; white-space: nowrap;
  flex-shrink: 0; transition: all 0.2s; text-decoration: none;
}
.btn-renew:hover { background: rgba(224,82,82,0.18); }

.btn-cancel-sub {
  display: block; width: 100%; text-align: center;
  font-size: 11px; color: var(--muted); background: none; border: none;
  cursor: pointer; padding: 6px 0 2px; font-family: inherit;
  text-decoration: underline; text-underline-offset: 3px; transition: color 0.15s;
}
.btn-cancel-sub:hover { color: #E05252; }

/* --- Referral row ----------------------------------------- */
.referral-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 10px 0 2px; padding: 8px 10px;
  background: rgba(255,255,255,0.03); border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.referral-label { font-size: 11px; color: var(--muted); }
.btn-ref-copy {
  font-size: 11px; font-weight: 500; font-family: inherit;
  color: var(--accent); background: rgba(232,96,28,0.08);
  border: 1px solid rgba(232,96,28,0.2); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; transition: background 0.15s;
}
.btn-ref-copy:hover { background: rgba(232,96,28,0.16); }

/* --- Expired state ---------------------------------------- */
.expired-card { opacity: 0.8; }
.badge-expired {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 2px 7px; border-radius: 5px;
  background: rgba(224,82,82,0.12); color: #E05252;
  border: 1px solid rgba(224,82,82,0.2);
}

/* --- Vocab link ------------------------------------------- */
.vocab-link { font-size: 13px; color: var(--muted); text-decoration: none; display: flex; align-items: center; gap: 5px; transition: color 0.2s; }
.vocab-link:hover { color: var(--text); }

/* --- Discover cards --------------------------------------- */
.discover-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  transition: border-color 0.2s; cursor: pointer;
  text-decoration: none; color: inherit;
}
.discover-card:hover { border-color: rgba(232,96,28,0.2); }
.discover-info { flex: 1; }
.discover-name { font-family: 'Fraunces', serif; font-weight: 700; font-size: 16px; }
.discover-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.discover-price {
  font-size: 12px; font-weight: 500; color: var(--accent);
  background: rgba(232,96,28,0.08); border: 1px solid rgba(232,96,28,0.2);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

/* --- Empty state ------------------------------------------ */
.empty-card {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 40px 24px;
  text-align: center; color: var(--muted); font-size: 14px;
}
.empty-card p { margin-top: 8px; font-size: 13px; }

/* --- Onboarding overlay ----------------------------------- */
#onboarding-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: var(--bg); align-items: center; justify-content: center; padding: 24px;
}
#onboarding-overlay.visible { display: flex; }
.onboarding-box { max-width: 480px; width: 100%; text-align: center; }
.onboarding-logo { font-family: 'Fraunces', serif; font-weight: 900; font-size: 24px; letter-spacing: -0.5px; margin-bottom: 48px; }
.onboarding-logo span { color: var(--accent); }
.onboarding-title { font-family: 'Fraunces', serif; font-weight: 900; font-size: clamp(26px, 5vw, 38px); letter-spacing: -1px; line-height: 1.1; margin-bottom: 12px; }
.onboarding-sub { font-size: 14px; color: var(--muted); margin-bottom: 40px; line-height: 1.6; }
.level-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.level-grid .last-item { grid-column: 1 / -1; }
.level-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 12px; cursor: pointer; font-family: inherit; color: var(--text);
  text-align: left; transition: border-color 0.15s, background 0.15s;
}
.level-btn:hover { border-color: rgba(232,96,28,0.4); background: var(--surface2); }
.level-btn.selected { border-color: var(--accent); background: rgba(232,96,28,0.08); }
.level-btn-title { font-weight: 600; font-size: 14px; }
.level-btn-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.btn-onboarding-next {
  width: 100%; margin-top: 24px;
  background: var(--accent); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 500;
  padding: 14px; border: none; border-radius: 12px; cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.btn-onboarding-next:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-onboarding-next:not(:disabled):hover { background: var(--accent-light); }

/* --- Responsive ------------------------------------------- */
@media (max-width: 600px) {
  .main { padding: 88px 16px 60px; }
  .nav-name { display: none; }
  .char-grid { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: 1fr; }
  .level-grid .last-item { grid-column: auto; }
}
