/* =====================================================
   RSVP Section Layout Fixes
   
   After Events Calendar plugin updates, the HTML structure
   uses a grid layout with .tribe-tickets__rsvp-details-wrapper
   as one column. When that wrapper has no visible content,
   we need to hide it and make the actions section take full width.
   ===================================================== */

form.tribe-tickets__rsvp-ar.tribe-common-g-row.tribe-common-g-row--gutters {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  gap: 0 !important;
}

.tec-tickets-plus-waitlist-container__inner-wrap {
  text-align: center !important;
}

.tec-tickets-plus-waitlist-container--submit {
  justify-content: center !important;

}

/* Hide the empty details section AND its wrapper completely */
.event-tickets .tribe-tickets__rsvp-details,
.event-tickets .tribe-tickets__rsvp-details-wrapper,
.tribe-tickets__rsvp-details,
.tribe-tickets__rsvp-details-wrapper,
.event-tickets .tribe-tickets__rsvp-ar-sidebar,
.tribe-tickets__rsvp-ar-sidebar,
/* Also hide if it's a grid column with no content */
.tribe-tickets__rsvp .tribe-tickets__rsvp-details-wrapper.tribe-common-g-col,
.tribe-common-g-col.tribe-tickets__rsvp-details-wrapper {
  display: none !important;
  width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  visibility: hidden !important;
  overflow: hidden !important;
}

/* Remove any separators/borders from the RSVP section */
.tribe-tickets__rsvp-actions-rsvp::before,
.tribe-tickets__rsvp-actions-rsvp::after,
.tribe-tickets__rsvp::before,
.tribe-tickets__rsvp::after,
.tribe-tickets__rsvp-details-wrapper::before,
.tribe-tickets__rsvp-details-wrapper::after {
  display: none !important;
  content: none !important;
}

/* Fix the RSVP row layout when details wrapper is hidden */
.event-tickets .tribe-tickets__rsvp,
.tribe-tickets__rsvp,
.event-tickets .tribe-tickets__rsvp.tribe-common-g-row,
.tribe-tickets__rsvp.tribe-common-g-row,
.tribe-tickets__rsvp.tribe-common-g-row--gutters,
div.tribe-tickets__rsvp.tribe-common-g-row.tribe-common-g-row--gutters {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  gap: 0 !important;
  border: none !important;
}

/* Outer container - left aligned (not centered on page) */
#rsvp-now.tribe-common.event-tickets {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Container wrapper styling */
.event-tickets .tribe-tickets__rsvp-wrapper,
.tribe-tickets__rsvp-wrapper {
  max-width: 800px !important;
  margin: 20px 0 !important;
  padding: 20px;
  border: 1px solid #e0e0e0;
}

/* Make the RSVP actions section centered */
.event-tickets .tribe-tickets__rsvp-actions-rsvp,
.tribe-tickets__rsvp-actions-rsvp,
.tribe-tickets__rsvp-actions-rsvp.tribe-common-g-col {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  border: none !important;
  padding-left: 0 !important;
}

/* Style the RSVP heading */
.event-tickets .tribe-tickets__rsvp-actions-rsvp h2,
.tribe-tickets__rsvp-actions-rsvp h2,
.tribe-tickets__rsvp-actions-rsvp-heading,
.tribe-tickets__rsvp-title {
  text-align: center !important;
  margin-bottom: 15px;
  font-family: var(--hgea-font-league-spartan, 'League Spartan', sans-serif);
  font-weight: var(--hgea-font-weight-bold, 700);
  color: var(--hgea-color-dark-green, #1a472a);
}

/* Style the Going button container */
.event-tickets .tribe-tickets__rsvp-actions-wrapper,
.tribe-tickets__rsvp-actions-wrapper,
.tribe-tickets__rsvp-actions {
  display: flex;
  justify-content: center !important;
  width: 100%;
  border: none !important;
}

.event-tickets .tribe-tickets__rsvp-ar-sidebar-wrapper {
  border: none !important;
}

/* Going button - using default Tribe Events Calendar styling */

.event-tickets .tribe-tickets__rsvp-ar-form-wrapper {
  background-color: white !important;
}

/* =====================================================
   Mobile Responsive Styles
   ===================================================== */
@media (max-width: 768px) {
  .event-tickets .tribe-tickets__rsvp-wrapper {
    max-width: 100%;
    padding: 15px;
    margin: 15px 0;
  }

  .event-tickets .tribe-tickets__rsvp-actions-rsvp,
  .tribe-tickets__rsvp-actions-rsvp {
    max-width: 100%;
    padding: 0 15px;
  }
}

/* Hide RSVP when member already registered (set by JS) */
.hgea-rsvp-already-registered .tribe-tickets__rsvp-wrapper,
.hgea-rsvp-already-registered .tribe-tickets__rsvp,
.hgea-rsvp-already-registered .tribe-tickets__rsvp-actions,
.hgea-rsvp-already-registered .tribe-tickets__rsvp-actions-rsvp,
.hgea-rsvp-already-registered .tribe-tickets__rsvp-actions-button-going,
.hgea-rsvp-already-registered .tribe-tickets__rsvp-details,
.hgea-rsvp-already-registered .tribe-tickets__rsvp-details-wrapper,
.hgea-rsvp-already-registered .tribe-tickets__rsvp-actions-wrapper {
  display: none !important;
  pointer-events: none !important;
}

/* Already registered message styling */
.hgea-already-registered-message {
  padding: 20px !important;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  color: #155724;
  margin: 20px 0 !important;
  font-size: 16px !important;
  text-align: center;
  max-width: 400px !important;
}

.hgea-already-registered-message strong {
  font-size: 18px !important;
  display: block;
  margin-bottom: 10px;
}