/* ==========================================================================
   Account pages shared shell
   Used by my-likes.html, my-posts.html, my-quotes.html, settings.html.
   Replaces the old "blue bar + floating circular avatar" header (the
   avatar was always the same placeholder image -- never personalized by
   any of the four pages' JS) with a compact hero + a real cross-page
   account sub-nav, and a shared toolbar/empty-state language.
   ========================================================================== */

.account-shell {
  background: var(--surface-alt);
  min-height: 60vh;
  flex-shrink: 0;
}

/* ---- Hero ---- */
.account-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: var(--space-7) var(--space-4) var(--space-6);
  text-align: center;
}

.account-hero__title {
  color: #fff;
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.account-hero__subtitle {
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--font-size-base);
  margin: 0 auto;
  max-width: 520px;
}

.account-hero__subtitle a {
  color: #fff;
  text-decoration: underline;
}

/* ---- Cross-page account nav ---- */
.account-subnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 20;
}

.account-subnav__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  justify-content: center;
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}

.account-subnav__inner::-webkit-scrollbar {
  display: none;
}

.account-subnav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}

.account-subnav__link i {
  font-size: 0.85em;
  opacity: 0.8;
}

.account-subnav__link:hover {
  color: var(--primary);
  opacity: 1;
}

.account-subnav__link--active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---- Body wrapper ---- */
.account-body {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4) 80px;
}

/* ---- Toolbar (filters + search) ---- */
.account-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.account-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Groups the search input together with the new explicit search button
   (below) so they sit glued side by side regardless of how
   .account-toolbar's own space-between wrapping lays out its other
   children. */
.account-toolbar__search-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 220px;
  max-width: 380px;
}

.account-toolbar__search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

/* Explicit search button, to the right of the box -- same round/green
   treatment as the map page's search button (#mapSearchBtn, map.css),
   so an explicit "search now" control looks consistent site-wide
   instead of only existing here as an invisible 300ms debounce. */
.account-toolbar__search-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-full);
  background: var(--cta-green);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.account-toolbar__search-btn:hover {
  background: var(--cta-green-dark);
}

.account-toolbar__search input {
  width: 100%;
  padding: 9px 38px 9px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  background: var(--surface-alt);
}

.account-toolbar__search input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  background: var(--surface);
}

.account-toolbar__search button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 4px 8px;
}

.account-toolbar__search button:hover {
  color: var(--danger);
}

/* Chip-style controls: both the cycle-buttons (my-likes/my-posts) and the
   native <select> pickers (my-quotes) share this same pill look. */
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--surface-alt);
  color: var(--dark);
  font-size: 0.85rem;
  font-weight: var(--font-weight-semibold);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.account-chip:hover {
  border-color: var(--primary);
  background: var(--accent-soft, rgba(30, 96, 170, 0.06));
}

.account-chip svg,
.account-chip .toolbar-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-chip button {
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.account-chip button::after {
  content: "";
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e60aa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 13px;
}

.account-chip select {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  padding: 0 16px 0 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e60aa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 13px;
}

.account-chip select:focus-visible {
  outline: none;
}

.account-chip label {
  margin: 0;
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
}

/* ---- Empty / error state card ---- */
.account-empty-state {
  max-width: 1320px;
  margin: 40px auto 150px;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
}

.account-empty-state__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-soft, rgba(30, 96, 170, 0.08));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.account-empty-state.is-error .account-empty-state__icon {
  background: rgba(217, 54, 46, 0.1);
  color: var(--danger);
}

@media (min-width: 769px) {
  .account-empty-state {
    margin-bottom: 250px;
  }
}

@media (max-width: 768px) {
  .account-hero {
    padding: var(--space-6) var(--space-3) var(--space-5);
  }

  .account-hero__title {
    font-size: 1.6rem;
  }

  .account-hero__subtitle {
    font-size: 0.9rem;
  }

  .account-subnav__link {
    padding: 12px 14px;
    font-size: 0.85rem;
  }

  .account-subnav__link span {
    display: none;
  }

  .account-subnav__link i {
    font-size: 1.05rem;
  }

  .account-body {
    padding: var(--space-4) var(--space-3) 60px;
  }

  .account-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .account-toolbar__search-group {
    flex: 0 0 auto;
    max-width: none;
  }
}
