/* ==========================================================================
   EventFlow Pro — Frontend Styles
   Mobile-first, dark-mode-aware, WCAG 2.1 AA compliant
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  --efp-c-bg:         #fff;
  --efp-c-surface:    #f8fafc;
  --efp-c-border:     #e2e8f0;
  --efp-c-text:       #1e293b;
  --efp-c-muted:      #64748b;
  --efp-c-accent:     #6366f1;
  --efp-c-accent-dk:  #4f46e5;
  --efp-c-green:      #16a34a;
  --efp-c-red:        #dc2626;
  --efp-c-yellow:     #ca8a04;
  --efp-radius:       12px;
  --efp-radius-sm:    8px;
  --efp-shadow-sm:    0 1px 4px rgba(0,0,0,.08);
  --efp-shadow-md:    0 4px 16px rgba(0,0,0,.1);
  --efp-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --efp-c-bg:      #0f172a;
    --efp-c-surface: #1e293b;
    --efp-c-border:  #334155;
    --efp-c-text:    #e2e8f0;
    --efp-c-muted:   #94a3b8;
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.efp-events-wrap {
  font-family: var(--efp-font);
  color: var(--efp-c-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */
.efp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 28px;
  padding: 16px;
  background: var(--efp-c-surface);
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius);
}

.efp-filters input[type="search"],
.efp-filters select {
  padding: 9px 14px;
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius-sm);
  background: var(--efp-c-bg);
  color: var(--efp-c-text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.efp-filters input[type="search"]:focus,
.efp-filters select:focus {
  border-color: var(--efp-c-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.efp-filter-btn {
  padding: 9px 18px;
  background: var(--efp-c-accent);
  color: #fff;
  border: none;
  border-radius: var(--efp-radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.efp-filter-btn:hover { background: var(--efp-c-accent-dk); }

/* --------------------------------------------------------------------------
   Events Grid
   -------------------------------------------------------------------------- */
.efp-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.efp-events-list { display: flex; flex-direction: column; gap: 16px; }

/* --------------------------------------------------------------------------
   Event Card
   -------------------------------------------------------------------------- */
.efp-card {
  background: var(--efp-c-surface);
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius);
  overflow: hidden;
  transition: transform .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
}

.efp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--efp-shadow-md);
}

.efp-card__image {
  position: relative;
  padding-top: 56.25%; /* 16:9 */
  overflow: hidden;
  background: var(--efp-c-border);
}

.efp-card__image img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s;
}

.efp-card:hover .efp-card__image img { transform: scale(1.04); }

.efp-card__date-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--efp-c-accent);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  min-width: 46px;
  line-height: 1;
  font-weight: 700;
}

.efp-card__date-badge .day   { font-size: 22px; display: block; }
.efp-card__date-badge .month { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }

.efp-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.efp-card__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.efp-cat-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(99,102,241,.12);
  color: var(--efp-c-accent);
  text-decoration: none;
}
.efp-cat-pill:hover { background: rgba(99,102,241,.22); }

.efp-card__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.3;
  color: var(--efp-c-text);
}

.efp-card__title a {
  color: inherit;
  text-decoration: none;
}
.efp-card__title a:hover { color: var(--efp-c-accent); }

.efp-card__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--efp-c-muted);
  margin-bottom: 14px;
}

.efp-card__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.efp-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--efp-c-border);
}

.efp-card__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--efp-c-text);
}

.efp-card__price.free { color: var(--efp-c-green); }

.efp-card__cta {
  padding: 7px 16px;
  background: var(--efp-c-accent);
  color: #fff;
  border-radius: var(--efp-radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.efp-card__cta:hover { background: var(--efp-c-accent-dk); color: #fff; }

/* --------------------------------------------------------------------------
   Status badges
   -------------------------------------------------------------------------- */
.efp-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 8px;
  border-radius: 100px;
}

.efp-status--upcoming  { background: rgba(99,102,241,.12);  color: var(--efp-c-accent); }
.efp-status--ongoing   { background: rgba(22,163,74,.12);   color: var(--efp-c-green); }
.efp-status--past      { background: rgba(100,116,139,.12); color: var(--efp-c-muted); }
.efp-status--cancelled { background: rgba(220,38,38,.12);   color: var(--efp-c-red); }
.efp-status--postponed { background: rgba(202,138,4,.12);   color: var(--efp-c-yellow); }

/* --------------------------------------------------------------------------
   Calendar View
   -------------------------------------------------------------------------- */
.efp-calendar {
  background: var(--efp-c-surface);
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius);
  overflow: hidden;
}

.efp-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--efp-c-border);
}

.efp-calendar__nav {
  display: flex;
  gap: 8px;
}

.efp-calendar__nav button {
  padding: 6px 12px;
  background: var(--efp-c-bg);
  border: 1px solid var(--efp-c-border);
  border-radius: 6px;
  color: var(--efp-c-text);
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.efp-calendar__nav button:hover { background: var(--efp-c-accent); color: #fff; border-color: var(--efp-c-accent); }

.efp-calendar__title { font-size: 17px; font-weight: 700; }

.efp-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.efp-calendar__day-label {
  text-align: center;
  padding: 10px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--efp-c-muted);
  border-bottom: 1px solid var(--efp-c-border);
}

.efp-calendar__cell {
  min-height: 90px;
  padding: 8px;
  border-right: 1px solid var(--efp-c-border);
  border-bottom: 1px solid var(--efp-c-border);
  vertical-align: top;
}

.efp-calendar__cell:nth-child(7n) { border-right: none; }
.efp-calendar__cell.other-month   { opacity: .4; background: var(--efp-c-bg); }
.efp-calendar__cell.today .efp-calendar__date {
  background: var(--efp-c-accent);
  color: #fff;
}

.efp-calendar__date {
  font-size: 12px;
  font-weight: 600;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  cursor: default;
}

.efp-calendar__event {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  background: rgba(99,102,241,.15);
  color: var(--efp-c-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background .15s;
}
.efp-calendar__event:hover { background: rgba(99,102,241,.3); }

/* --------------------------------------------------------------------------
   Single Event Page
   -------------------------------------------------------------------------- */
.efp-single-event-header {
  position: relative;
  border-radius: var(--efp-radius);
  overflow: hidden;
  margin-bottom: 32px;
}

.efp-single-event-header img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

.efp-single-event-header__overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
  padding: 40px 32px 28px;
  color: #fff;
}

.efp-single-event-header h1 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.efp-event-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
  padding: 18px 20px;
  background: var(--efp-c-surface);
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius);
}

.efp-event-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.efp-event-meta-item .icon { font-size: 18px; }
.efp-event-meta-item .label { font-size: 11px; color: var(--efp-c-muted); text-transform: uppercase; font-weight: 600; }
.efp-event-meta-item .value { color: var(--efp-c-text); font-weight: 500; }

/* --------------------------------------------------------------------------
   RSVP / Ticket form
   -------------------------------------------------------------------------- */
.efp-rsvp-box {
  background: var(--efp-c-surface);
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius);
  padding: 24px;
  margin-bottom: 24px;
}

.efp-rsvp-box h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.efp-rsvp-box .efp-field {
  margin-bottom: 14px;
}

.efp-rsvp-box label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--efp-c-muted);
  margin-bottom: 5px;
}

.efp-rsvp-box input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--efp-c-border);
  border-radius: 8px;
  background: var(--efp-c-bg);
  color: var(--efp-c-text);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.efp-rsvp-box input:focus {
  border-color: var(--efp-c-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.efp-rsvp-submit {
  width: 100%;
  padding: 12px;
  background: var(--efp-c-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  margin-top: 4px;
}
.efp-rsvp-submit:hover { background: var(--efp-c-accent-dk); }

.efp-rsvp-success {
  text-align: center;
  padding: 24px;
  color: var(--efp-c-green);
  font-weight: 600;
  font-size: 16px;
}

/* --------------------------------------------------------------------------
   Load more
   -------------------------------------------------------------------------- */
.efp-load-more {
  display: block;
  margin: 32px auto 0;
  padding: 11px 32px;
  background: transparent;
  color: var(--efp-c-text);
  border: 2px solid var(--efp-c-border);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.efp-load-more:hover { border-color: var(--efp-c-accent); color: var(--efp-c-accent); }

/* --------------------------------------------------------------------------
   Loader spinner
   -------------------------------------------------------------------------- */
.efp-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--efp-c-border);
  border-top-color: var(--efp-c-accent);
  border-radius: 50%;
  animation: efp-spin .6s linear infinite;
}

@keyframes efp-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Countdown
   -------------------------------------------------------------------------- */
.efp-countdown {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.efp-countdown__unit {
  text-align: center;
  background: var(--efp-c-surface);
  border: 1px solid var(--efp-c-border);
  border-radius: var(--efp-radius-sm);
  padding: 12px 16px;
  min-width: 62px;
}

.efp-countdown__num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--efp-c-accent);
  font-variant-numeric: tabular-nums;
}

.efp-countdown__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--efp-c-muted);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Map embed
   -------------------------------------------------------------------------- */
.efp-map {
  width: 100%;
  height: 300px;
  border-radius: var(--efp-radius);
  overflow: hidden;
  border: 1px solid var(--efp-c-border);
  background: var(--efp-c-surface);
}

.efp-map iframe {
  width: 100%; height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .efp-events-grid { grid-template-columns: 1fr; }
  .efp-calendar__cell { min-height: 60px; padding: 4px; }
  .efp-single-event-header img { height: 220px; }
  .efp-event-meta-bar { gap: 12px; }
  .efp-countdown { gap: 8px; }
  .efp-countdown__unit { min-width: 52px; padding: 8px 10px; }
}

/* --------------------------------------------------------------------------
   Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .efp-card:hover,
  .efp-card:hover .efp-card__image img {
    transform: none;
    transition: none;
  }
  .efp-spinner { animation: none; }
}

:focus-visible {
  outline: 2px solid var(--efp-c-accent);
  outline-offset: 2px;
}
