/* ════════════════════════════════════════════════════════════════
   EVENTS — "All Events" browser (Campus Connect sub-feature)
   Card grid + persistent Event Details panel. All classes .ev-*.
   Built on semantic tokens (var(--card)/--line/--ink/--plum) so the
   whole thing flips correctly in dark mode.
   ════════════════════════════════════════════════════════════════ */

.ev-embed {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  align-items: start;
  padding: 4px 4px 28px;
}

/* ───── MAIN COLUMN ───── */
.ev-main { min-width: 0; }

.ev-head { margin-bottom: 16px; }
.ev-head h2 {
  margin: 0 0 4px; font-size: 24px; font-weight: 800;
  color: var(--text-primary); letter-spacing: -.01em;
}
.ev-head p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* category tabs (segmented) */
.ev-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 14px;
}
.ev-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.ev-tab:hover { border-color: var(--plum-soft); color: var(--text-primary); }
.ev-tab.active {
  background: var(--plum); border-color: var(--plum); color: #fff;
}
.ev-tab-n {
  font-size: 11px; font-weight: 700; opacity: .8;
  background: rgba(0,0,0,.08); border-radius: 999px; padding: 1px 7px;
}
.ev-tab.active .ev-tab-n { background: rgba(255,255,255,.22); }

/* filter bar */
.ev-filters {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.ev-filters .ev-search {
  position: relative; flex: 1 1 220px; min-width: 180px;
}
.ev-search-ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.ev-search input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px 9px 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-primary); font-size: 13px;
}
.ev-select {
  padding: 9px 30px 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11 3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.ev-view-toggle {
  margin-left: auto; display: inline-flex; gap: 4px;
  border: 1px solid var(--line); border-radius: 10px; padding: 3px;
  background: var(--surface-2);
}
.ev-view-btn {
  width: 30px; height: 28px; display: grid; place-items: center;
  border: none; background: transparent; border-radius: 7px;
  color: var(--text-muted); cursor: pointer; font-size: 14px;
}
.ev-view-btn.active { background: var(--plum); color: #fff; }

/* ───── CARD GRID ───── */
.ev-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.ev-grid.list { grid-template-columns: 1fr; }

.ev-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ev-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px var(--shadow);
  border-color: var(--plum-soft);
}
.ev-card.active { border-color: var(--plum); box-shadow: 0 0 0 1px var(--plum); }

.ev-card-cover {
  position: relative; height: 132px;
  display: flex; align-items: flex-end;
}
.ev-card-cat {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.ev-ai-badge {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em;
}

.ev-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ev-card-body h3 {
  margin: 0; font-size: 16px; font-weight: 800;
  color: var(--text-primary); line-height: 1.25;
}
.ev-card-org { font-size: 12px; color: var(--text-muted); }
.ev-card-org b { color: var(--text-secondary); font-weight: 700; }

.ev-meta { display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.ev-meta-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-secondary);
}
.ev-meta-row i { color: var(--plum); font-size: 13px; width: 15px; text-align: center; }

.ev-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 4px;
}

/* avatar stack */
.ev-going { display: flex; align-items: center; gap: 8px; }
.ev-stack { display: flex; }
.ev-ava {
  width: 26px; height: 26px; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--plum-soft), var(--teal-soft));
  color: var(--plum-d); font-size: 10px; font-weight: 700;
}
.ev-ava img { width: 100%; height: 100%; object-fit: cover; }
.ev-stack .ev-ava { margin-left: -9px; border: 2px solid var(--card); }
.ev-stack .ev-ava:first-child { margin-left: 0; }
.ev-going-n { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.ev-register {
  width: 100%; margin-top: 8px;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--plum); background: transparent;
  color: var(--plum); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s ease;
}
.ev-register:hover { background: var(--plum-glow); }
.ev-register.done { background: var(--plum); color: #fff; }

.ev-empty {
  grid-column: 1 / -1; text-align: center; padding: 48px 20px;
  color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.ev-empty i { font-size: 30px; opacity: .6; }
.ev-empty b { color: var(--text-secondary); }

.ev-loadmore-wrap { text-align: center; margin-top: 24px; }
.ev-loadmore {
  padding: 11px 28px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text-primary); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s ease;
}
.ev-loadmore:hover { border-color: var(--plum); color: var(--plum); }

/* ───── DETAIL PANEL ───── */
.ev-detail {
  position: sticky; top: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.ev-detail-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-size: 13px; font-weight: 800; color: var(--text-primary);
}
.ev-detail-cover {
  position: relative; height: 150px; display: flex; align-items: flex-end;
}
.ev-detail-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ev-detail-body h3 { margin: 0; font-size: 19px; font-weight: 800; color: var(--text-primary); }

.ev-detail-org {
  display: flex; align-items: center; gap: 10px;
}
.ev-detail-org .ev-ava { width: 36px; height: 36px; font-size: 12px; }
.ev-detail-org-id { line-height: 1.3; }
.ev-detail-org-id b { font-size: 13px; color: var(--text-primary); }
.ev-detail-org-id small { display: block; font-size: 11px; color: var(--text-muted); }
.ev-contact {
  margin-left: auto; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  color: var(--text-secondary); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.ev-contact:hover { border-color: var(--plum); color: var(--plum); }

.ev-detail-meta { display: flex; flex-direction: column; gap: 10px; }
.ev-detail-meta .ev-meta-row { font-size: 13px; }
.ev-detail-meta .ev-meta-row i { font-size: 15px; width: 18px; }
.ev-detail-meta .ev-meta-row span b { color: var(--text-primary); font-weight: 700; }

.ev-detail-sec h4 {
  margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--text-primary);
}
.ev-detail-sec p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }

.ev-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ev-highlight {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.4;
}
.ev-highlight i { color: var(--emerald); font-size: 15px; margin-top: 1px; }

.ev-register-lg {
  width: 100%; padding: 12px; border-radius: 11px; border: none;
  background: var(--plum); color: #fff; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: filter .15s ease;
}
.ev-register-lg:hover { filter: brightness(1.08); }
.ev-register-lg.done { background: var(--emerald); }

.ev-share-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.ev-share-sec h4 { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: var(--text-primary); }
.ev-share { display: flex; gap: 8px; }
.ev-share button {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-secondary); cursor: pointer; font-size: 15px; transition: all .15s ease;
}
.ev-share button:hover { border-color: var(--plum); color: var(--plum); }

/* ───── responsive ───── */
@media (max-width: 1100px) {
  .ev-embed { grid-template-columns: 1fr; }
  .ev-detail { position: static; }
}
