/* EPM directory - "All EPMs" (copied unchanged from the React app's src/pages/EpmDetails.css). */

.epm-dir-page {
  background-color: #f8fafc;
  min-height: 100vh;
  padding-top: 80px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* TOP BAR */
.epm-dir-topbar {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px 24px 0;
}

.epm-dir-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  color: #166534;
  border: 1.5px solid #166534;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.epm-dir-back-btn:hover {
  background: #f0fdf4;
  transform: translateX(-2px);
}

/* HERO */
.epm-dir-hero-wrap {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.epm-dir-hero {
  position: relative;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  min-height: 280px;
}

.epm-dir-hero-content {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.epm-dir-title {
  font-size: 36px;
  font-weight: 800;
  color: #166534;
  margin: 0 0 12px;
}

.epm-dir-subtitle {
  font-size: 15px;
  color: #475569;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 450px;
}

.epm-dir-hero-stats {
  display: flex;
  gap: 16px;
}

.ed-stat-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  border: 1px solid #f1f5f9;
}

.ed-stat-pill strong {
  display: block;
  font-size: 13px;
  color: #1e293b;
}

.ed-stat-pill span {
  display: block;
  font-size: 11px;
  color: #64748b;
}

.epm-dir-hero-img-box {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 60%;
  z-index: 1;
}

.epm-dir-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.05) 8%, rgba(0,0,0,0.25) 20%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,1) 55%);
  mask-image: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.05) 8%, rgba(0,0,0,0.25) 20%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,1) 55%);
}

/* FILTER BAR */
.epm-dir-searchbar {
  max-width: 1600px;
  margin: 0 auto 32px;
  padding: 0 24px;
}

.ed-filters-form {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
}

.ed-filter-col {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-search-col {
  flex: 2;
  min-width: 220px;
}

.ed-filter-col label {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  padding-left: 4px;
}

.ed-input-wrap, .ed-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 16px;
  height: 44px;
  transition: all 0.2s;
}

.ed-input-wrap:focus-within, .ed-select-wrap:focus-within {
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.1);
}

.ed-input-wrap svg, .ed-select-wrap svg:first-child {
  color: #64748b;
  margin-right: 12px;
}

.ed-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #1e293b;
}

.ed-select-wrap {
  /* The chevron below is an absolute overlay drawn inside this reserved space, not a flex
     sibling - so the select's own box (padded out to meet it) stays clickable all the way to
     the wrapper's right edge instead of stopping short of the arrow. */
  padding-right: 0;
}

.ed-select-wrap select {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #1e293b;
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  height: 100%;
}

.ed-chev {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.ed-filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ed-btn-apply, .ed-btn-reset {
  justify-content: center;
  white-space: nowrap;
}

.ed-btn-apply {
  height: 44px;
  padding: 0 20px;
  background: #16a34a;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.ed-btn-apply:hover {
  background: #15803d;
}

.ed-btn-reset {
  height: 44px;
  padding: 0 16px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.ed-btn-reset:hover {
  background: #e2e8f0;
}

/* LAYOUT */
.epm-dir-layout {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}

/* SIDEBAR */
.epm-dir-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ed-sidebar-section {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
}

.ed-sb-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.ed-sb-categories {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-cat-btn:hover {
  background: #f8fafc;
}

.ed-cat-btn.active {
  background: #f0fdf4;
}

.ed-cat-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.ed-cat-btn.active .ed-cat-label {
  color: #16a34a;
}

.ed-cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.color-gray { background: #f1f5f9; color: #64748b; }
.color-green { background: #dcfce7; color: #16a34a; }
.color-blue { background: #dbeafe; color: #2563eb; }
.color-purple { background: #f3e8ff; color: #9333ea; }
.color-teal { background: #ccfbf1; color: #0d9488; }
.color-emerald { background: #d1fae5; color: #059669; }

.ed-cat-count {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.ed-cat-btn.active .ed-cat-count {
  color: #16a34a;
}

.ed-sb-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ed-link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s;
}

.ed-link-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.ed-link-btn.active {
  background: #f0fdf4;
  color: #16a34a;
}

/* MAIN AREA */
.ed-main-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
}

.ed-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ed-toolbar-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ed-toolbar-left h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.ed-toolbar-left p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.ed-toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ed-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.ed-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-tab.active {
  background: #fff;
  color: #16a34a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ed-view-toggle {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
}

.ed-view-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-view-btn.active {
  background: #fff;
  color: #16a34a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ed-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

/* EVENT LIST */
.ed-event-list {
  display: flex;
  flex-direction: column;
}

.ed-cards-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ed-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.ed-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f5f9;
  overflow: hidden;
  display: flex;
  transition: all 0.3s ease;
}

.ed-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.ed-card.list {
  flex-direction: row;
  align-items: center;
  padding: 24px;
  gap: 32px;
}

.ed-card.grid {
  flex-direction: column;
  padding: 24px;
  gap: 20px;
}

.ed-card-bg-art {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  -webkit-mask-image: linear-gradient(to right, transparent, black);
  mask-image: linear-gradient(to right, transparent, black);
  pointer-events: none;
}

.ed-card-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 96px;
  border-radius: 16px;
  background: #f8fafc;
  flex-shrink: 0;
}

.ed-card.style-tag-green .ed-card-date { background: #f0fdf4; color: #16a34a; }
.ed-card.style-tag-blue .ed-card-date { background: #eff6ff; color: #2563eb; }
.ed-card.style-tag-purple .ed-card-date { background: #faf5ff; color: #9333ea; }
.ed-card.style-tag-teal .ed-card-date { background: #f0fdfa; color: #0d9488; }
.ed-card.style-tag-emerald .ed-card-date { background: #ecfdf5; color: #059669; }
.ed-card.style-tag-orange .ed-card-date { background: #fff7ed; color: #ea580c; }

.ed-month { font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ed-day { font-size: 28px; font-weight: 800; line-height: 1; margin: 4px 0; }
.ed-dow { font-size: 11px; font-weight: 600; opacity: 0.8; }

.ed-card-info {
  flex: 1.5;
  min-width: 200px;
  z-index: 1;
}

.ed-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.ed-badge.tag-green { background: #dcfce7; color: #16a34a; }
.ed-badge.tag-blue { background: #dbeafe; color: #2563eb; }
.ed-badge.tag-purple { background: #f3e8ff; color: #9333ea; }
.ed-badge.tag-teal { background: #ccfbf1; color: #0d9488; }
.ed-badge.tag-emerald { background: #d1fae5; color: #059669; }
.ed-badge.tag-orange { background: #ffedd5; color: #ea580c; }

.ed-event-title {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 12px;
  line-height: 1.3;
}

.ed-event-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ed-event-meta-grid span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.ed-event-meta-grid span svg {
  color: #94a3b8;
}

.ed-card-desc {
  flex: 1.5;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1;
}

.ed-card-desc p {
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ed-attendees {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ed-avatars {
  display: flex;
}

.ed-avatars img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -8px;
}
.ed-avatars img:first-child { margin-left: 0; }

.ed-attendees span {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.ed-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  min-width: 140px;
  z-index: 1;
}

.ed-card.grid .ed-card-actions {
  flex-direction: row;
  align-items: center;
}

.ed-status-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.ed-status-pill.upcoming {
  background: #dcfce7;
  color: #16a34a;
}

.ed-status-pill.completed {
  background: #f1f5f9;
  color: #475569;
}

.ed-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ed-btn-details {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-btn-details:hover {
  border-color: #16a34a;
  color: #16a34a;
}

.ed-btn-bookmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-btn-bookmark:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.ed-state-msg {
  padding: 40px;
  text-align: center;
  font-size: 15px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  /* Below this the wrapped columns get squeezed too narrow to use comfortably -
     stack every field and both action buttons full-width instead. */
  .ed-filter-col, .ed-search-col {
    min-width: 100%;
  }

  .ed-filter-actions {
    width: 100%;
  }

  .ed-btn-apply, .ed-btn-reset {
    flex: 1;
  }
}

@media (max-width: 1024px) {
  .epm-dir-layout {
    grid-template-columns: 1fr;
  }
  
  .ed-card.list {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ed-card-actions {
    width: 100%;
    flex-direction: row;
    align-items: center;
  }
}

/* Register straight from an upcoming EPM's card (opens the form for that EPM). */
.ed-btn-register {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #16a34a;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.ed-btn-register:hover {
  background: #15803d;
  border-color: #15803d;
}

.ed-card.list .ed-action-btns { flex-wrap: wrap; justify-content: flex-end; }
