/* ==============================================
   Home Page Visual Polish
   Design: Premium dark UI — Spotify/Discord inspired
   ============================================== */

/* ── App-Wide Surface System ── */
body {
  background: var(--surface-low);
}

/* ── Home Screen Atmospheric Background ── */
#homeView {
  position: relative;
}

/* Disabled: these overlays were causing a dim/foggy appearance */
/* #homeView::before { ... } */
/* #homeView::after { ... } */
/* #homeView > * { z-index: 2; } */

/* ── Card Surface System (Home-scoped) ── */
#homeView .section {
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

#homeView .card {
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 13px;
}

#homeView .card:hover {
  background: #22222a;
}

/* Home feed items */

/* Account shelf spacing */
#homeView .account-shelf {
  margin-bottom: 20px;
}

/* ── Hero / Header Area ── */
#homeView .home-hero {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 4px;
  background: transparent;
}

#homeView .home-hero-bg {
  height: 120px;
  background:
    /* Base directional gradient */
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, transparent) 0%, color-mix(in srgb, var(--accent-soft) 18%, transparent) 40%, color-mix(in srgb, var(--accent) 12%, transparent) 100%);
  border-radius: 12px;
  position: relative;
}

#homeView .home-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Edge vignette — darker falloff at borders */
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 40%, rgba(0,0,0,0.12) 100%);
  border-radius: 12px;
  z-index: 1;
  pointer-events: none;
}

#homeView .home-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Subtle light bloom top-right + faint highlight */
  background:
    radial-gradient(ellipse 40% 50% at 75% 35%, color-mix(in srgb, var(--accent-soft) 12%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 30% 30% at 50% 20%, rgba(255,255,255,0.04) 0%, transparent 60%);
  border-radius: 12px;
  z-index: 2;
  pointer-events: none;
}

#homeView .home-hero-text {
  padding: 0 22px 18px;
  margin-top: -68px;
  position: relative;
  z-index: 2;
}

#homeView .home-hero-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.4px;
}

#homeView .home-hero-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
}

/* ── Discord Community Card ── */
.discord-community-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent) 0%, color-mix(in srgb, var(--accent) 5%, transparent) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.discord-community-card:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent) 0%, color-mix(in srgb, var(--accent) 8%, transparent) 100%);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.discord-community-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-soft);
}

.discord-community-body {
  flex: 1;
  min-width: 0;
}

.discord-community-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.discord-community-body p {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin: 0;
  line-height: 1.4;
}

.discord-community-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  background: #5865F2;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.discord-community-cta:hover {
  background: #4752c4;
}

/* ── Section Headers ── */
#homeView .shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 0;
}

#homeView .shelf-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.2px;
}

#homeView .shelf-view-all {
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}

#homeView .shelf-view-all:hover {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
}

/* ── View Community Button ── */

/* ── User Search Area ── */

/* ── Shelf Row Cards ── */
#homeView .shelf-char-card {
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#homeView .shelf-char-card:hover {
  background: #22222a;
  border-color: rgba(255,255,255,0.15);
}

/* ── Character Header Pill Rounding ── */
.char-header-pill {
  border-radius: 12px !important;
}

/* ── Home Feed Time & Meta ── */

/* ── Home Composer (community feed inline) ── */
#homeView .home-composer {
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px;
}

#homeView .home-composer textarea {
  background: #1e1e2a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text-primary);
}

/* ── Section dividers (visual rhythm) ── */
#homeView .shelf-row {
  gap: 10px;
}

/* ── Responsive: full-width CTA below on narrow screens ── */
@media (max-width: 480px) {
  .discord-community-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px;
  }
  
  .discord-community-body h3 {
    font-size: 14px;
  }

  .discord-community-cta {
    width: 100%;
    justify-content: center;
    padding: 10px 18px;
    font-size: 13px;
  }
}
