/* ═══════════════════════════════════════════════════════════
   Discovery Feed — Filterable Event Grid
   ═══════════════════════════════════════════════════════════ */

.feed-page {
  padding: 72px 16px 40px;
  max-width: 960px;
  margin: 0 auto;
}

/* ─── Toolbar (Search) ──────────────────────────────────── */
.feed-toolbar {
  position: sticky; top: 56px; z-index: 50;
  background: rgba(8, 12, 21, .9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 12px 0 4px;
}

.feed-search-wrap {
  position: relative;
}
.feed-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.feed-search {
  width: 100%; padding: 11px 40px 11px 42px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-size: 15px; outline: none;
  transition: border-color var(--transition);
}
.feed-search:focus { border-color: var(--accent); }
.feed-search::placeholder { color: var(--muted); }
.feed-search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: all var(--transition);
}
.feed-search-clear:hover { background: var(--surface3); color: var(--text); }

/* ─── Filter Sections ───────────────────────────────────── */
.feed-filter-sections {
  padding: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feed-filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  flex-shrink: 0;
  min-width: 48px;
}

.feed-filter-pills {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  padding: 2px 0;
}
.feed-filter-pills::-webkit-scrollbar { display: none; }

/* Generic pill button */
.feed-pill {
  flex-shrink: 0; padding: 6px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; font-size: 12px; font-weight: 600;
  color: var(--muted); white-space: nowrap;
  transition: all .15s ease;
}
.feed-pill:hover { border-color: rgba(255,255,255,.2); color: var(--text); }
.feed-pill.active {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent);
}

/* Controls row — sort, friends toggle, view toggle */
.feed-controls-row {
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.feed-sort-wrap {
  display: flex; align-items: center; gap: 8px;
}

.feed-sort-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: 6px 10px; font-size: 12px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.feed-sort-select:focus { border-color: var(--accent); }
.feed-sort-select option { background: var(--surface); color: var(--text); }

/* Friends toggle button */
.feed-friends-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 100px; font-size: 12px; font-weight: 700;
  color: var(--muted); cursor: pointer;
  transition: all .15s ease;
}
.feed-friends-toggle:hover {
  border-color: rgba(255,179,71,.3);
  color: var(--text);
}
.feed-friends-toggle.active {
  background: rgba(255,179,71,.12);
  border-color: rgba(255,179,71,.4);
  color: var(--warm);
}

.feed-view-toggle { display: flex; gap: 4px; margin-left: auto; }
.feed-view-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all var(--transition);
}
.feed-view-btn:hover { background: var(--surface2); color: var(--text); }
.feed-view-btn.active { background: var(--accent-dim); color: var(--accent); }

/* ─── Feed Header ────────────────────────────────────────── */
.feed-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 12px;
  gap: 12px;
}
.feed-count { font-size: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* Active filter chips */
.feed-active-filters {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.feed-active-chip {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 100px;
  background: rgba(255,107,157,.1); border: 1px solid rgba(255,107,157,.2);
  color: var(--accent); white-space: nowrap;
}

/* ─── Friends Banner ─────────────────────────────────────── */
.feed-friends-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,179,71,.08); border: 1px solid rgba(255,179,71,.2);
  border-radius: var(--radius); padding: 12px 16px;
  margin-bottom: 16px; font-size: 14px; font-weight: 600;
  color: var(--warm);
}
.ffb-icon { font-size: 20px; }

/* ─── Event Grid ─────────────────────────────────────────── */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* List view override */
.feed-grid.list-view {
  grid-template-columns: 1fr;
}
.feed-grid.list-view .event-card {
  display: flex; flex-direction: row; height: auto;
}
.feed-grid.list-view .ec-image {
  width: 120px; min-height: 100px; flex-shrink: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.feed-grid.list-view .ec-body { flex: 1; }

/* ─── Event Card ─────────────────────────────────────────── */
.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.event-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
}

.ec-image {
  width: 100%; height: 160px;
  background-size: cover; background-position: center;
  position: relative;
}
.ec-image-placeholder {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface3) 100%);
  display: flex; align-items: center; justify-content: center;
}
.ec-image-emoji { font-size: 40px; opacity: .6; }

.ec-body { padding: 16px; }
.ec-date {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.ec-title {
  font-size: 17px; font-weight: 700; line-height: 1.3;
  margin-bottom: 4px; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ec-venue {
  font-size: 13px; color: var(--muted); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}

.ec-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ec-tag {
  padding: 3px 10px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  text-transform: capitalize;
}

.ec-friends {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ec-friend-avatars { display: flex; }
.ec-friend-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--surface);
  color: var(--accent); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-left: -6px;
}
.ec-friend-dot:first-child { margin-left: 0; }
.ec-friend-count {
  font-size: 12px; font-weight: 600; color: var(--accent);
}

.ec-meta {
  display: flex; gap: 10px; font-size: 12px; color: var(--muted);
}
.ec-price, .ec-age {
  padding: 2px 8px; border-radius: 4px;
  background: var(--surface2); font-weight: 600;
}

/* ─── Clear Filters Button ──────────────────────────────── */
.feed-clear-filters {
  margin-top: 16px; padding: 10px 24px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-weight: 700; font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.feed-clear-filters:hover {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}

/* ─── Loading / Empty States ─────────────────────────────── */
.feed-loading, .feed-error {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 24px;
  color: var(--muted);
}
.feed-spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
.feed-error-detail {
  font-size: 12px; margin-top: 8px; opacity: .6;
  font-family: monospace; word-break: break-all;
}
.feed-retry-btn {
  margin-top: 16px; padding: 10px 24px;
  background: var(--accent); color: var(--bg);
  border-radius: var(--radius-sm); font-weight: 700;
}

.feed-empty {
  text-align: center; padding: 80px 24px; color: var(--muted);
}
.feed-empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.feed-empty h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.feed-empty p { font-size: 14px; margin-bottom: 4px; }

/* ─── Mobile Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
  .feed-page { padding: 66px 12px 32px; }
  .feed-grid {
    grid-template-columns: 1fr;
  }
  .ec-image { height: 140px; }
  .feed-filter-label { min-width: 40px; font-size: 10px; }
  .feed-pill { padding: 5px 10px; font-size: 11px; }
  .feed-controls-row { gap: 6px; }
}
