/* =============================================================================
   SDLust — Events Styles
   Extends main.css — include after it.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   BROWSE PAGE
   ----------------------------------------------------------------------------- */
.events-layout { padding-top: var(--space-xl); padding-bottom: var(--space-2xl); }

.events-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.events-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-plum-border);
  padding-bottom: var(--space-md);
}

.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.filter-tab:hover { color: var(--color-text-primary); text-decoration: none; }
.filter-tab.active { color: var(--color-rose-light); border-bottom-color: var(--color-rose); }

/* Event list (browse) */
.event-list { display: flex; flex-direction: column; gap: var(--space-md); }

.event-card {
  display: flex;
  align-items: stretch;
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.event-card:hover {
  border-color: var(--color-rose);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}
.event-card--past { opacity: 0.7; }

.event-card-cover {
  width: 130px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-plum-light), #2e0a38);
  background-size: cover;
  background-position: center;
  position: relative;
}

.event-card-body { padding: var(--space-md) var(--space-lg); flex: 1; display: flex; flex-direction: column; gap: 4px; }

.event-card-meta-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.event-date   { font-size: 12px; color: var(--color-rose-light); font-weight: 600; }
.event-clique { font-size: 11px; color: var(--color-gold-light); background: var(--color-gold-subtle); padding: 2px 7px; border-radius: var(--radius-pill); }

.event-card-title { font-size: 17px; font-weight: 600; color: var(--color-text-primary); line-height: 1.3; }

.event-card-meta-bottom {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: 2px;
}
.event-loc   { font-size: 12px; color: var(--color-text-muted); }
.event-going { font-size: 12px; color: var(--color-text-muted); }
.event-age   {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.event-card-host {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* My-status badge on event card */
.event-my-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.event-status-going, .event-status-approved { background: rgba(46,194,126,0.12); color: var(--color-success); }
.event-status-maybe    { background: rgba(212,160,23,0.12); color: var(--color-gold-light); }
.event-status-waitlist { background: rgba(91,156,246,0.12); color: var(--color-info); }
.event-status-invited  { background: rgba(232,66,122,0.08); color: var(--color-rose-light); }

/* -----------------------------------------------------------------------------
   EVENT VIEW PAGE
   ----------------------------------------------------------------------------- */
.event-cover {
  height: 280px;
  background: linear-gradient(135deg, var(--color-plum-mid) 0%, #2e0a38 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}
.cover-past-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: rgba(0,0,0,0.6);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-xl);
  padding-top: var(--space-xl);
  padding-bottom: var(--space-2xl);
  align-items: start;
}

/* Event header */
.event-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}
.event-clique-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--color-gold-light);
  background: var(--color-gold-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-lg);
  text-decoration: none;
}
.event-clique-link:hover { text-decoration: none; color: var(--color-gold-light); opacity: 0.85; }

.event-details-list { display: flex; flex-direction: column; gap: var(--space-md); margin-top: var(--space-lg); }
.event-detail-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}
.detail-icon    { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; line-height: 1.4; }
.detail-secondary { display: block; font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.detail-link { color: var(--color-rose-light); }
.badge-full {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-error);
  background: rgba(224,72,72,0.1);
  border: 1px solid rgba(224,72,72,0.25);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
}

/* Event sections */
.event-section { margin-top: var(--space-xl); padding-top: var(--space-xl); border-top: 1px solid var(--color-plum-border); }
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.section-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--color-plum-light);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700;
  color: var(--color-text-muted);
  text-transform: none; letter-spacing: 0;
}
.event-description { color: var(--color-text-secondary); font-size: 15px; line-height: 1.75; }

/* Attendee table */
.attendee-table-wrap { overflow-x: auto; }
.attendee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.attendee-table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-plum-border);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.attendee-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid rgba(82,40,95,0.3); vertical-align: middle; }
.attendee-table tr:last-child td { border-bottom: none; }

.attendee-name-link {
  display: flex; align-items: center; gap: var(--space-sm);
  color: var(--color-text-primary); text-decoration: none;
}
.attendee-name-link:hover { color: var(--color-rose-light); }
.attendee-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.attendee-age    { font-size: 11px; color: var(--color-text-muted); }
.attendee-note   { color: var(--color-text-muted); font-size: 12px; max-width: 200px; }
.attendee-actions { display: flex; gap: 4px; }

/* RSVP badges */
.rsvp-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.rsvp-going, .rsvp-approved { background: rgba(46,194,126,0.12); color: var(--color-success); }
.rsvp-maybe    { background: rgba(212,160,23,0.12); color: var(--color-gold-light); }
.rsvp-declined { background: rgba(136,135,128,0.15); color: var(--color-text-muted); }
.rsvp-waitlist { background: rgba(91,156,246,0.12); color: var(--color-info); }
.rsvp-invited  { background: rgba(232,66,122,0.08); color: var(--color-rose-light); }
.rsvp-removed  { background: rgba(224,72,72,0.1); color: var(--color-error); }

/* Guest grid (public view) */
.guest-grid { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.guest-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: border-color var(--transition);
}
.guest-chip:hover { border-color: var(--color-rose); color: var(--color-text-primary); text-decoration: none; }
.guest-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* Invite search (layout-specific rules; shared component styles are in main.css) */
.invite-search-wrap { margin-top: var(--space-lg); }
.invite-search-row { position: relative; max-width: 360px; }
.invite-search-row .invite-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 200;
}

/* -----------------------------------------------------------------------------
   SIDEBAR: RSVP + HOST CONTROLS
   ----------------------------------------------------------------------------- */
.event-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.rsvp-card, .host-card {
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.rsvp-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: var(--space-md);
}
.rsvp-current { font-size: 13px; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.rsvp-full-msg, .rsvp-past-msg { color: var(--color-text-muted); font-size: 14px; text-align: center; padding: var(--space-md) 0; }

.rsvp-buttons { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-md); }
.rsvp-btn {
  padding: 12px var(--space-md);
  background: var(--color-plum-light);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.rsvp-btn:hover { border-color: var(--color-rose); color: var(--color-text-primary); }
.rsvp-active.rsvp-going, .rsvp-active.rsvp-approved {
  background: rgba(46,194,126,0.1);
  border-color: rgba(46,194,126,0.4);
  color: var(--color-success);
}
.rsvp-active.rsvp-maybe {
  background: rgba(212,160,23,0.1);
  border-color: rgba(212,160,23,0.4);
  color: var(--color-gold-light);
}
.rsvp-active.rsvp-declined {
  background: var(--color-plum-light);
  border-color: var(--color-plum-border);
  color: var(--color-text-muted);
}

.rsvp-form { margin-top: var(--space-md); padding-top: var(--space-md); border-top: 1px solid var(--color-plum-border); }

.host-card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

/* -----------------------------------------------------------------------------
   EVENT FORM
   ----------------------------------------------------------------------------- */
.form-section {
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-plum-border);
}

/* -----------------------------------------------------------------------------
   RESPONSIVE
   ----------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .event-body { grid-template-columns: 1fr; }
  .event-sidebar { position: static; order: -1; }
  .rsvp-buttons { flex-direction: row; }
  .rsvp-btn { flex: 1; }
}
@media (max-width: 640px) {
  .event-card-cover { width: 80px; }
  .event-title      { font-size: 26px; }
  .event-cover      { height: 180px; }
  .events-controls  { flex-direction: column; align-items: stretch; }
  .events-controls-right { flex-wrap: wrap; }
  .events-page-header { flex-wrap: wrap; gap: var(--space-sm); }
  .filter-tabs      { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab       { white-space: nowrap; flex-shrink: 0; }
  .search-form      { width: 100%; }
  .search-input     { flex: 1; max-width: none; }
  .form-row-2       { grid-template-columns: 1fr; }

  /* RSVP buttons: horizontal row on mobile for touch accessibility */
  .rsvp-buttons     { flex-direction: row; flex-wrap: wrap; }
  .rsvp-btn         { flex: 1; min-width: 0; font-size: 13px; padding: 10px var(--space-sm); }

  /* Attendee table: ensure horizontal scroll */
  .attendee-table-wrap { -webkit-overflow-scrolling: touch; }
}

/* =============================================================================
   CALENDAR VIEWS
   ============================================================================= */

/* Controls layout sub-sections */
.events-controls-left  { display: flex; align-items: center; }
.events-controls-right { display: flex; align-items: center; gap: var(--space-sm); }

/* View toggle (List / Month / Week) */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  padding: 3px;
  flex-shrink: 0;
}
.view-toggle-btn {
  padding: 5px 14px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.view-toggle-btn:hover { color: var(--color-text-primary); text-decoration: none; }
.view-toggle-btn.active {
  background: var(--color-plum-light);
  color: var(--color-rose-light);
  text-decoration: none;
}

/* Calendar navigation bar */
.cal-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.cal-nav-title {
  font-size: 17px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  color: var(--color-text-muted);
  font-size: 18px;
  text-decoration: none;
  line-height: 1;
  transition: border-color var(--transition), color var(--transition);
}
.cal-nav-btn:hover { border-color: var(--color-rose); color: var(--color-text-primary); text-decoration: none; }
.cal-today-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition);
}
.cal-today-btn:hover { border-color: var(--color-rose); color: var(--color-text-primary); text-decoration: none; }

/* ── Month grid ───────────────────────────────────────────────────────────── */
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--color-plum-border);
}
.cal-dow-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-sm) 0;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 110px);
  border-left: 1px solid var(--color-plum-border);
  border-top: 1px solid var(--color-plum-border);
}

.cal-day {
  border-right: 1px solid var(--color-plum-border);
  border-bottom: 1px solid var(--color-plum-border);
  padding: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
.cal-day:hover { background: rgba(255,255,255,0.03); }
.cal-day--out  { opacity: 0.35; }

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
}
.cal-day--today .cal-day-num {
  background: var(--color-rose);
  color: #fff;
  font-size: 12px;
}

.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.cal-event-chip {
  display: block;
  font-size: 11px;
  padding: 2px 5px;
  background: var(--color-rose);
  color: #fff;
  border-radius: 3px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  transition: opacity var(--transition);
}
.cal-event-chip:hover { opacity: 0.82; text-decoration: none; color: #fff; }
.cal-event-chip.cal-event-nsfw {
  background: var(--color-gold-light);
  color: #1a0a22;
}

.cal-more-btn {
  font-size: 11px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: 1px 3px;
  cursor: pointer;
  text-align: left;
  border-radius: 3px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.cal-more-btn:hover { color: var(--color-rose-light); }

/* ── Week grid ────────────────────────────────────────────────────────────── */
.cal-week-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 1px;
  background: var(--color-plum-border);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 560px;
}

.cal-week-col {
  background: var(--color-bg-dark);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}
.cal-week-col--today { background: rgba(232,66,122,0.04); }

.cal-week-header {
  padding: var(--space-sm) var(--space-sm);
  border-bottom: 1px solid var(--color-plum-border);
  text-align: center;
  flex-shrink: 0;
}
.cal-week-dow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.cal-week-date {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.cal-week-col--today .cal-week-date { color: var(--color-rose-light); }

.cal-week-events {
  padding: var(--space-sm) 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cal-event-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 7px;
  background: rgba(232,66,122,0.1);
  border-left: 3px solid var(--color-rose);
  border-radius: 0 3px 3px 0;
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 12px;
  transition: background var(--transition);
}
.cal-event-block:hover { background: rgba(232,66,122,0.18); text-decoration: none; }
.cal-event-block.cal-event-nsfw {
  border-left-color: var(--color-gold-light);
  background: rgba(212,160,23,0.08);
}
.cal-event-time  { font-size: 11px; color: var(--color-text-muted); }
.cal-event-title { font-weight: 500; color: var(--color-text-primary); word-break: break-word; }

.cal-no-events {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-lg) 0;
}

/* ── Day popup ────────────────────────────────────────────────────────────── */
.cal-popup {
  position: absolute;
  z-index: 600;
  width: 308px;
  background: var(--color-plum-mid);
  border: 1px solid var(--color-plum-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.cal-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-plum-border);
}
.cal-popup-date { font-size: 13px; font-weight: 600; color: var(--color-text-primary); }
.cal-popup-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--color-text-muted);
  padding: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  flex-shrink: 0;
}
.cal-popup-close:hover { color: var(--color-text-primary); }
.cal-popup-list { max-height: 320px; overflow-y: auto; }
.cal-popup-event {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid rgba(82,40,95,0.3);
  text-decoration: none;
  color: var(--color-text-primary);
  font-size: 13px;
  transition: background var(--transition);
}
.cal-popup-event:hover { background: rgba(255,255,255,0.04); text-decoration: none; }
.cal-popup-event:last-child { border-bottom: none; }
.cal-popup-time  { font-size: 11px; color: var(--color-rose-light); font-weight: 600; }
.cal-popup-title { color: var(--color-text-primary); font-weight: 500; }
.cal-popup-going { font-size: 11px; color: var(--color-text-muted); }
