/*
 * Eggplant Event Portal – Front-end styles
 * Colors are driven by CSS custom properties set via inline style (PHP).
 */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--eg-bg, #000);
  color: var(--eg-text, #f1faee);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--eg-primary, #e63946); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Utility ── */
.eg-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eg-section-title {
  font-size: 1.8rem;
  color: var(--eg-primary, #e63946);
  margin-bottom: 1.2rem;
  text-align: center;
  letter-spacing: .04em;
}

/* ── CAROUSEL ── */
.eg-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #111;
  border-bottom: 3px solid var(--eg-primary, #e63946);
}

.eg-carousel__track {
  display: flex;
  transition: transform .5s ease;
  will-change: transform;
}

.eg-carousel__slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 3.5rem;
}

.eg-carousel__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.eg-carousel__img-wrap {
  flex: 0 0 auto;
  width: 220px;
  height: 150px;
  overflow: hidden;
  border-radius: 6px;
  border: 2px solid var(--eg-secondary, #457b9d);
}

.eg-carousel__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eg-carousel__content { flex: 1; }
.eg-carousel__title   { font-size: 1.6rem; color: var(--eg-primary, #e63946); margin-bottom: .4rem; }
.eg-carousel__desc    { font-size: .95rem; opacity: .85; margin-bottom: .4rem; }
.eg-carousel__date    { font-size: .85rem; color: var(--eg-secondary, #457b9d); font-weight: 600; }

.eg-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
  z-index: 10;
}
.eg-carousel__btn:hover { background: var(--eg-primary, #e63946); }
.eg-carousel__btn--prev { left: .5rem; }
.eg-carousel__btn--next { right: .5rem; }

.eg-carousel__dots {
  position: absolute;
  bottom: .6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .5rem;
}
.eg-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.eg-carousel__dot--active,
.eg-carousel__dot:hover { background: var(--eg-primary, #e63946); }

/* ── MAIN ── */
.eg-main { padding: 3rem 0 4rem; }

/* ── LEGEND ── */
.eg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  list-style: none;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: .9rem;
}
.eg-legend li { display: flex; align-items: center; gap: .4rem; }
.eg-legend__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.eg-legend__dot--available { background: var(--eg-available, #2a9d8f); }
.eg-legend__dot--booked    { background: var(--eg-booked,    #e63946); }
.eg-legend__dot--held      { background: var(--eg-held,      #f4a261); }

/* ── CALENDAR ── */
.eg-calendar-section { margin-bottom: 3rem; }

.eg-calendar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.eg-calendar__nav button {
  background: transparent;
  border: 2px solid var(--eg-secondary, #457b9d);
  color: var(--eg-text, #f1faee);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eg-calendar__nav button:hover { background: var(--eg-secondary, #457b9d); }

#eg-cal-heading { font-size: 1.25rem; font-weight: 700; min-width: 180px; text-align: center; }

.eg-calendar__grid-wrap {
  max-width: 700px;
  margin: 0 auto;
}

.eg-calendar__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: .6;
  margin-bottom: .3rem;
}

.eg-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.eg-calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: .95rem;
  cursor: default;
  background: #1a1a1a;
  transition: transform .15s;
  position: relative;
}

.eg-calendar__day.eg-day--empty { background: transparent; }
.eg-calendar__day.eg-day--today { outline: 2px solid var(--eg-primary, #e63946); }

.eg-calendar__day.eg-day--available {
  background: var(--eg-available, #2a9d8f);
  cursor: pointer;
  color: #fff;
}
.eg-calendar__day.eg-day--booked {
  background: var(--eg-booked, #e63946);
  color: #fff;
}
.eg-calendar__day.eg-day--held {
  background: var(--eg-held, #f4a261);
  color: #000;
}

.eg-calendar__day.eg-day--available:hover,
.eg-calendar__day.eg-day--booked:hover,
.eg-calendar__day.eg-day--held:hover { transform: scale(1.1); z-index: 1; }

.eg-calendar__day.eg-day--selected { outline: 3px solid #fff; }

/* ── SLOT DETAIL PANEL ── */
.eg-slot-detail {
  max-width: 700px;
  margin: 1.5rem auto 0;
  background: #1a1a1a;
  border: 1px solid var(--eg-secondary, #457b9d);
  border-radius: 8px;
  padding: 1.2rem 1.5rem;
}
.eg-slot-detail[hidden] { display: none; }
.eg-slot-detail h3 { margin-bottom: .75rem; color: var(--eg-primary, #e63946); }
.eg-slot-detail ul { list-style: none; margin-bottom: 1rem; }
.eg-slot-detail ul li {
  padding: .3rem .5rem;
  border-bottom: 1px solid #333;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.eg-slot-badge {
  font-size: .75rem;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
}
.eg-slot-badge--available { background: var(--eg-available, #2a9d8f); color: #fff; }
.eg-slot-badge--booked    { background: var(--eg-booked,    #e63946); color: #fff; }
.eg-slot-badge--held      { background: var(--eg-held,      #f4a261); color: #000; }

/* ── BUTTONS ── */
.eg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.eg-btn:hover { opacity: .88; transform: translateY(-1px); }
.eg-btn:active { transform: translateY(0); }
.eg-btn--primary { background: var(--eg-primary, #e63946); color: #fff; }

/* ── BOOKING FORM ── */
.eg-booking-section {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.eg-booking-form .eg-form-row {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.2rem;
}

.eg-booking-form label {
  font-size: .9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .75;
}

.eg-booking-form input,
.eg-booking-form select,
.eg-booking-form textarea {
  background: #1e1e1e;
  border: 1px solid #444;
  color: var(--eg-text, #f1faee);
  padding: .55rem .8rem;
  border-radius: 5px;
  font-size: 1rem;
  width: 100%;
  transition: border-color .2s;
}
.eg-booking-form input:focus,
.eg-booking-form select:focus,
.eg-booking-form textarea:focus {
  outline: none;
  border-color: var(--eg-primary, #e63946);
}

#eg-booking-response {
  margin-top: 1rem;
  font-size: .95rem;
  padding: .6rem 1rem;
  border-radius: 5px;
  display: none;
}
#eg-booking-response.eg-response--success {
  background: rgba(42, 157, 143, .2);
  border: 1px solid var(--eg-available, #2a9d8f);
  color: var(--eg-available, #2a9d8f);
  display: block;
}
#eg-booking-response.eg-response--error {
  background: rgba(230, 57, 70, .2);
  border: 1px solid var(--eg-booked, #e63946);
  color: var(--eg-booked, #e63946);
  display: block;
}

/* ── Loading spinner ── */
.eg-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: eg-spin .7s linear infinite;
  vertical-align: middle;
  margin-right: .4rem;
}
@keyframes eg-spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .eg-carousel__slide { flex-direction: column; padding: 1rem 1.5rem; }
  .eg-carousel__img-wrap { width: 100%; height: 180px; }
  .eg-calendar__day { font-size: .8rem; }
  .eg-booking-section { padding: 1.2rem; }
}
