/* ============================================================
   Profile page — member's profile
   Design tokens come from styles.css. Shares nav + modals
   with humidor.css.
   ============================================================ */

/* body background is set in humidor.css (shared porcelaine marble). */

/* --- Profile hero --- */
.profile-hero {
  text-align: center;
  padding: clamp(60px, 8vw, 100px) 24px clamp(36px, 5vw, 60px);
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.avatar-frame {
  display: inline-grid;
  place-items: center;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(201, 162, 99, 0.5);
  margin-bottom: 28px;
  position: relative;
}
.avatar-frame::before, .avatar-frame::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--gold);
}
.avatar-frame::before { top: -4px; left: -4px;  border-right: none; border-bottom: none; }
.avatar-frame::after  { bottom: -4px; right: -4px; border-left: none; border-top: none; }

.avatar {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px;
  letter-spacing: 0.06em;
  color: #f7efe1;
  background: var(--avatar-bg, #7a3825);
}

.profile-hero .eyebrow { font-size: 10px; }

.member-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.04em;
  color: #f7efe1;
  margin: 12px 0 8px;
  line-height: 1.05;
}

.member-email {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.tier-badge::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
}

.member-bio {
  color: var(--muted);
  max-width: 480px;
  margin: 22px auto 0;
  font-size: 14px;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}

/* --- Stats strip --- */
.stats-strip {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px clamp(20px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(201, 162, 99, 0.12);
  border-top: 1px solid rgba(201, 162, 99, 0.15);
  border-bottom: 1px solid rgba(201, 162, 99, 0.15);
}

.stats-strip .stat {
  background: var(--bg);
  padding: 28px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-strip .num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(28px, 3.4vw, 40px);
  color: var(--gold);
}

.stats-strip .lbl {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-2);
}

@media (max-width: 1080px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

/* Defend the `hidden` attribute against the .profile-section (flex) and
   .two-col (grid) display rules below — the tab switcher relies on it. */
[hidden] { display: none !important; }

/* --- Section tabs (sticky, sits below the site nav) --- */
.profile-tabs {
  position: sticky;
  top: 79px;                 /* matches .site-nav height */
  z-index: 40;
  margin-top: 32px;          /* gap below the stats strip */
  background: rgba(10, 8, 7, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 162, 99, 0.18);
}

.profile-tabs-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  /* `safe center` keeps the row centered when it fits, but falls back to
     start-aligned when it overflows so the leading tabs remain scrollable. */
  justify-content: safe center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.profile-tabs-inner::-webkit-scrollbar { display: none; }

.profile-tab {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--muted-2);
  font: 500 11px/1 'Inter', sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 22px 20px;
  margin: 0 2px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.profile-tab:hover { color: var(--ink); }
.profile-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

@media (max-width: 1080px) {
  /* Right-align the tab row on mobile; `safe` keeps every tab reachable
     by horizontal scroll even when the row overflows. */
  .profile-tabs-inner { justify-content: safe flex-end; }
}

/* --- Main grid --- */
.profile-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px clamp(20px, 4vw, 48px) 80px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(201, 162, 99, 0.15);
}

.section-head .titles { display: flex; flex-direction: column; gap: 6px; }

.section-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 36px);
  color: #f7efe1;
  letter-spacing: 0.03em;
  line-height: 1;
}

.section-head .eyebrow { font-size: 10px; }

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(201, 162, 99, 0.4);
  color: var(--gold);
  font: 600 11px/1 'Inter', sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.ghost-btn:hover { background: rgba(201, 162, 99, 0.08); border-color: var(--gold); }

/* --- Cigar log --- */
.log-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }

.log-row {
  background: linear-gradient(180deg, #15110d 0%, #100c09 100%);
  border: 1px solid rgba(201, 162, 99, 0.12);
  padding: 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
}

.log-row .log-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--gold);
  min-width: 60px;
  text-align: center;
  line-height: 1.2;
}
.log-row .log-date .y { display: block; font-size: 11px; letter-spacing: 0.2em; color: var(--muted-2); margin-top: 4px; }

.log-row .log-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.log-row .log-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 22px;
  color: #f7efe1;
  letter-spacing: 0.02em;
}
.log-row .log-meta {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.log-row .log-notes {
  color: var(--muted);
  font-size: 14px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.5;
}

.log-row .log-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Bin icon button (Bootstrap Icons) at the right of each log row.
   Hidden + pointer-events disabled by default so a tap in the corner
   doesn't fire a phantom delete on mobile. */
.log-row .icon-btn {
  background: none;
  border: none;
  color: var(--muted-2);
  cursor: pointer;
  padding: 6px;
  font-size: 15px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, color 0.18s ease, background 0.18s ease;
}
/* Revealed on hover (desktop) or via `.show-actions` (tap-to-reveal on
   touch — set by the first tap on the row body). */
.log-row:hover .icon-btn,
.log-row.show-actions .icon-btn {
  opacity: 1;
  pointer-events: auto;
}
.log-row .icon-btn:hover {
  color: #c87a72;
  background: rgba(176, 72, 72, 0.1);
}

/* Rating stars */
.stars {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.stars button {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: rgba(244, 236, 221, 0.18);
  transition: color 0.15s ease, transform 0.1s ease;
}
.stars button.on,
.stars:hover button { color: var(--gold); }
.stars button:hover ~ button { color: rgba(244, 236, 221, 0.18); }
.stars button:hover { transform: scale(1.1); }

.stars.readonly button { cursor: default; }
.stars.readonly button:hover { transform: none; }
.stars.readonly:hover button.on { color: var(--gold); }
.stars.readonly:hover button:not(.on) { color: rgba(244, 236, 221, 0.18); }

/* Log entry form */
.log-form {
  background: linear-gradient(180deg, #15110d 0%, #100c09 100%);
  border: 1px solid rgba(201, 162, 99, 0.2);
  padding: 28px;
  display: none;
  flex-direction: column;
  gap: 18px;
}
.log-form.open { display: flex; }

.log-form .form-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr;
  gap: 14px;
}
@media (max-width: 1080px) {
  .log-form .form-grid { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.field input, .field textarea, .field select {
  background: rgba(10, 8, 7, 0.55);
  border: 1px solid rgba(244, 236, 221, 0.15);
  color: var(--ink);
  font: 400 14px/1.5 'Inter', sans-serif;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.18s ease;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 80px; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 15px; }

.log-form .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  border-top: 1px solid rgba(201, 162, 99, 0.1);
  padding-top: 18px;
}

.text-btn {
  background: none; border: none;
  color: var(--muted-2);
  font: 500 11px/1 'Inter', sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 11px 14px;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); }

.log-form .submit { min-width: 180px; }

/* --- Suggestions --- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(201, 162, 99, 0.1);
}
.tab {
  background: transparent; border: none;
  color: var(--muted-2);
  font: 500 11px/1 'Inter', sans-serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 14px 22px 14px 0;
  margin-right: 18px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab .count {
  display: inline-block;
  margin-left: 8px;
  font-size: 9px;
  padding: 2px 7px;
  border: 1px solid rgba(201, 162, 99, 0.3);
  letter-spacing: 0;
}

.suggestion-card {
  background: linear-gradient(180deg, #15110d 0%, #100c09 100%);
  border: 1px solid rgba(201, 162, 99, 0.12);
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}

.mini-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: #f7efe1;
  letter-spacing: 0.02em;
}

.suggestion-card .who {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.suggestion-card .who h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 18px;
  color: #f7efe1;
}
.suggestion-card .who .label {
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.suggestion-card .who .date {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.suggestion-card .cigar {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  color: var(--gold);
  font-style: italic;
  margin-bottom: 6px;
}
.suggestion-card .message {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted-2);
}
.empty-state h3 { font-family: 'Cormorant Garamond', serif; font-weight: 400; color: var(--ink); font-size: 22px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* --- Friends grid --- */
.friends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.friend-card {
  position: relative;
  background: linear-gradient(180deg, #15110d 0%, #100c09 100%);
  border: 1px solid rgba(201, 162, 99, 0.12);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.friend-card:hover { border-color: rgba(201, 162, 99, 0.3); transform: translateY(-2px); }

.friend-card .mini-avatar { width: 52px; height: 52px; flex-shrink: 0; }

.friend-card .info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.friend-card .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: #f7efe1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-card .meta { font-size: 10px; color: var(--muted-2); letter-spacing: 0.14em; text-transform: uppercase; }

.friend-card .tier-tag {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  padding: 3px 8px;
  border: 1px solid rgba(201, 162, 99, 0.25);
  align-self: flex-start;
  margin-top: 2px;
}

/* Bin icon at the top-right of the card (Bootstrap Icons via CDN).
   Hidden by default + `pointer-events: none` so taps in the top-right
   corner don't fire a phantom delete on mobile. */
.friend-card .remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted-2);
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, color 0.18s ease, background 0.18s ease;
}
/* Revealed by hover (desktop) or by the .show-actions class (touch UX —
   set by a first tap on the card; a second tap actually deletes). */
.friend-card:hover .remove,
.friend-card.show-actions .remove {
  opacity: 1;
  pointer-events: auto;
}
.friend-card .remove:hover {
  color: #c87a72;
  background: rgba(176, 72, 72, 0.1);
}

/* Add friend modal */
.directory-search {
  width: 100%;
  background: rgba(10, 8, 7, 0.55);
  border: 1px solid rgba(244, 236, 221, 0.15);
  color: var(--ink);
  font: 400 14px/1 'Inter', sans-serif;
  padding: 14px 16px;
  margin-bottom: 16px;
  outline: none;
}
.directory-search:focus { border-color: var(--gold); }

.directory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.directory-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(201, 162, 99, 0.08);
}

.directory-row .mini-avatar { width: 40px; height: 40px; font-size: 15px; }
.directory-row .info .name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: var(--ink);
}
.directory-row .info .meta {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.directory-row .add {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  font: 600 10px/1 'Inter', sans-serif;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.directory-row .add:hover { background: var(--gold); color: #1a130a; }

/* --- Two-column (purchases + contributions) --- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; gap: 64px; } }

.entry-list { list-style: none; display: flex; flex-direction: column; }
.entry-list li {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid rgba(201, 162, 99, 0.08);
}
.entry-list .date {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.entry-list .main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: var(--ink);
}
.entry-list .sub { font-size: 11px; color: var(--muted-2); margin-top: 4px; letter-spacing: 0.08em; }
.entry-list .right {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--gold);
  text-align: right;
}

.entry-list .total {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 18px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(201, 162, 99, 0.2);
  border-bottom: none;
  margin-top: 6px;
}
.entry-list .total .label {
  grid-column: 2;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
}
.entry-list .total .amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: #f7efe1;
  text-align: right;
}

/* Event status pill */
.status-pill {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid;
}
.status-pill.attended { color: #7fa67a; border-color: rgba(127, 166, 122, 0.35); }
.status-pill.rsvp     { color: var(--gold); border-color: rgba(201, 162, 99, 0.4); }

/* --- Suggestion compose modal --- */
.compose-card {
  max-width: 540px;
  padding: 44px 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.compose-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 30px;
  color: #f7efe1;
  text-align: center;
  margin-bottom: 8px;
}
.compose-card .eyebrow { text-align: center; display: block; }
.compose-card .divider { width: 48px; height: 1px; background: var(--gold); margin: 8px auto 18px; opacity: 0.6; }

/* --- Add friend modal --- */
.add-friend-card { max-width: 540px; padding: 44px 36px 32px; }
.add-friend-card .eyebrow { text-align: center; display: block; }
.add-friend-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 30px;
  color: #f7efe1;
  text-align: center;
  margin: 8px 0 20px;
}
