/* ═══════════════════════════════════════════════════════════
   Home Dashboard — Bento Grid Layout
   ═══════════════════════════════════════════════════════════ */

.hb-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 80px 24px 100px;
  position: relative;
  z-index: 1;
}

/* ═══ Profile Header (combined profile + home) ═══════════ */
.hb-prof-header {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: hbCardIn 0.4s ease forwards;
}

.hb-prof-top-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hb-prof-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(124,156,255,.25);
}

.hb-prof-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hb-prof-avatar-initials {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,156,255,.3), rgba(196,113,237,.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.hb-prof-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.hb-prof-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.hb-prof-spirit {
  font-size: 12px;
  font-weight: 600;
  margin-top: 1px;
  background: linear-gradient(90deg, var(--vita-v, #ff6b9d), var(--vita-i, #ffb347), var(--vita-t, #7c9cff));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-prof-bio {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 3px;
}

.hb-prof-location {
  font-size: 11px;
  color: var(--text-dim, var(--muted));
  margin-top: 2px;
}

.hb-prof-edit-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(124,156,255,.1);
  border: 1px solid rgba(124,156,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  transition: all .15s;
}

.hb-prof-edit-btn:hover {
  background: rgba(124,156,255,.2);
  border-color: var(--accent);
}

/* Inline stats row */
.hb-prof-stats-row {
  display: flex;
  gap: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.hb-prof-stat {
  flex: 1;
  text-align: center;
}

.hb-prof-stat-num {
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.hb-prof-stat-label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}

/* Friend code strip */
.hb-prof-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(124,156,255,.04);
  border: 1px solid rgba(124,156,255,.08);
  border-radius: 10px;
}

.hb-prof-code-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.hb-prof-code-value {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--accent);
  flex: 1;
}

.hb-prof-code-copy,
.hb-prof-code-share {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  background: none;
  border: none;
  transition: all .15s;
}

.hb-prof-code-copy:hover,
.hb-prof-code-share:hover {
  background: rgba(124,156,255,.1);
  color: var(--accent);
}

/* ─── Centered Profile Layout ─────────────────────────── */
.hb-prof-centered {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hb-prof-avatar-lg {
  width: 88px;
  height: 88px;
  border-width: 3px;
}

.hb-prof-avatar-lg .hb-prof-avatar-img {
  width: 100%;
  height: 100%;
}

.hb-prof-avatar-lg .hb-prof-avatar-initials {
  font-size: 28px;
}

.hb-prof-username {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.hb-prof-stat-click {
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 2px;
  transition: background .15s;
}

.hb-prof-stat-click:hover {
  background: rgba(255,255,255,.04);
}

.hb-prof-stat-click:active {
  background: rgba(255,255,255,.08);
}

/* ─── Stat List Overlay ──────────────────────────────── */
.hb-stat-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}

.hb-stat-overlay-visible {
  opacity: 1;
}

.hb-stat-panel {
  width: 100%;
  max-width: 430px;
  max-height: 65vh;
  background: var(--surface, #0d1117);
  border: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: hbStatSlide .3s ease forwards;
}

@keyframes hbStatSlide {
  from { transform: translateY(30px); }
  to { transform: translateY(0); }
}

.hb-stat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.hb-stat-panel-title {
  font-size: 15px;
  font-weight: 700;
}

.hb-stat-panel-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hb-stat-panel-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

.hb-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  cursor: pointer;
  transition: background .12s;
}

.hb-stat-item:hover {
  background: rgba(255,255,255,.04);
}

.hb-stat-item-emoji {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hb-stat-item-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hb-stat-item-info {
  flex: 1;
  min-width: 0;
}

.hb-stat-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-stat-item-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Greeting (removed — kept for compat) ────────────── */
.hb-greeting {
  display: none;
}

/* ─── Bento Grid ───────────────────────────────────────── */
.hb-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  grid-auto-flow: dense;
  position: relative;
}

.hb-span-2 {
  grid-column: span 2;
}

/* ─── Card Base ────────────────────────────────────────── */
.hb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  transition: transform 0.35s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.3s ease;
  opacity: 0;
  animation: hbCardIn 0.5s ease forwards;
  cursor: pointer;
}

.hb-card:hover {
  transform: translateY(-3px) scale(1.008);
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

@keyframes hbCardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stripe accent */
.hb-stripe {
  height: 3px;
  width: 100%;
}

.hb-card-body {
  padding: 16px 18px 18px;
}

.hb-card-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ─── Hero Countdown ───────────────────────────────────── */
.hb-countdown-num {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #ffb347, #ff6b9d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-num-sm {
  font-size: 42px;
}

.hb-countdown-label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.hb-countdown-event {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.hb-countdown-venue {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.hb-hero-stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.hb-hero-stat {
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Quick Stats ──────────────────────────────────────── */
.hb-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.hb-stat-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.hb-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ─── Action Needed ────────────────────────────────────── */
.hb-action {
  border-left: 3px solid #ffb347;
}

.hb-action-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.hb-action-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0;
}

.hb-action-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.hb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Pill Button ──────────────────────────────────────── */
.hb-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  background: rgba(124,156,255,.15);
  color: var(--accent);
  font-family: inherit;
}

.hb-pill-btn:hover {
  opacity: 0.8;
}

/* ─── Crew Vote ────────────────────────────────────────── */
.hb-vote-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hb-poll-bar {
  margin-bottom: 8px;
}

.hb-poll-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 3px;
  color: var(--text);
}

.hb-poll-label span:last-child {
  color: var(--muted);
  font-weight: 600;
}

.hb-poll-track {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}

.hb-poll-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ─── Friend Activity ──────────────────────────────────── */
.hb-friend-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.hb-friend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity .15s;
}

.hb-friend-item:hover { opacity: .8; }

.hb-friend-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hb-friend-info {
  flex: 1;
  min-width: 0;
}

.hb-friend-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
}

.hb-friend-text strong {
  font-weight: 600;
}

.hb-friend-time {
  font-size: 10px;
  color: var(--muted);
}

.hb-see-all {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.hb-see-all:hover {
  text-decoration: underline;
}

/* ─── Suggested Event ──────────────────────────────────── */
.hb-suggested-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.hb-suggested-img {
  width: 40%;
  min-height: 120px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.hb-suggested-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(196,113,237,.2), rgba(124,156,255,.15));
}

.hb-suggested-emoji {
  position: relative;
  z-index: 1;
  font-size: 28px;
  opacity: 0.4;
}

.hb-suggested-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hb-suggested-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.hb-suggested-venue {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.hb-suggested-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.hb-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(124,156,255,.1);
  color: var(--accent);
}

.hb-suggested-friends {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.hb-avatar-stack {
  display: flex;
}

.hb-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  border: 1.5px solid var(--surface);
  margin-left: -6px;
  flex-shrink: 0;
}

.hb-avatar:first-child {
  margin-left: 0;
}

/* ─── Your Ride ────────────────────────────────────────── */
.hb-ride-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hb-ride-car {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.hb-ride-seats {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.hb-progress-bar {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
}

.hb-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

/* ─── Discover CTA ─────────────────────────────────────── */
.hb-discover-cta {
  cursor: pointer;
}

/* ─── Empty State ──────────────────────────────────────── */
.hb-empty-grid {
  position: relative;
}

.hb-ghost {
  opacity: 0.25;
  pointer-events: none;
  animation: none;
}

.hb-empty-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  background: rgba(10,14,26,.6);
  border-radius: 14px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  text-align: center;
  padding: 40px;
}

.hb-empty-overlay h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffb347, #ff6b9d, #c471ed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hb-empty-overlay p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.hb-empty-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hb-empty-btn {
  padding: 10px 22px;
  border-radius: 24px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity .2s;
}

.hb-empty-btn:hover {
  opacity: 0.8;
}

/* ─── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .hb-bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .hb-page {
    padding: 16px 16px 80px;
  }
  .hb-greeting h1 {
    font-size: 24px;
  }
}

@media (max-width: 520px) {
  .hb-bento {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .hb-span-2 {
    grid-column: span 2;
  }
  .hb-suggested-layout {
    flex-direction: column;
  }
  .hb-suggested-img {
    width: 100%;
    min-height: 60px;
  }
  /* Compact cards on mobile */
  .hb-card-body {
    padding: 12px 14px 14px;
  }
  .hb-countdown-num {
    font-size: 36px;
  }
  .hb-num-sm {
    font-size: 28px;
  }
  .hb-countdown-event {
    font-size: 14px;
  }
  .hb-countdown-label {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .hb-countdown-venue {
    font-size: 11px;
    margin-bottom: 8px;
  }
  .hb-hero-stats {
    gap: 10px;
    padding-top: 8px;
  }
  .hb-stat-num {
    font-size: 20px;
  }
  .hb-card-type {
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 6px;
  }
  .hb-action-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .hb-action-list li {
    font-size: 12px;
  }
  .hb-vote-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .hb-suggested-name {
    font-size: 14px;
  }
  /* Cap empty state grid so overlay isn't absurdly tall on single-column */
  .hb-empty-grid {
    max-height: 340px;
    overflow: hidden;
  }
  /* Smaller profile header on mobile */
  .hb-prof-header {
    padding: 14px;
    margin-bottom: 16px;
  }
  .hb-prof-avatar {
    width: 56px;
    height: 56px;
  }
  .hb-prof-avatar-initials {
    font-size: 18px;
  }
  .hb-prof-name {
    font-size: 16px;
  }
  .hb-prof-stat-num {
    font-size: 15px;
  }
}
