/* memberships.css */

/* Farb-Variablen (kannst du anpassen/entfernen, wenn du sie nicht brauchst) */
:root {
  --primary-color: #c8a165;   /* Gold/Bronze */
  --heading-color: #333;
  --card-bg: #fff;
  --card-border: #ddd;
  --body-bg: #f7f7f7;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
}

/* Entfernt/Reduziert ggf. weißen Balken oben, passt den Hintergrund an */
.page-content.memberships-page {
  margin-top: 9vh;   /* Entfernt den weißen Spalt */
  padding-top: 0;
  background-color: var(--body-bg);
}

/* ===================================== */
/* Enhanced Membership Item Styling       */
/* ===================================== */

.membership-item.enhanced {
  margin-bottom: 15px;
  padding: 15px;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.membership-item.legacy {
  margin-bottom: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.membership-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.recurring-badge {
  background: var(--success-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

.class-type-badge {
  background: var(--info-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: capitalize;
}

.age-group-badge {
  background: var(--warning-color);
  color: #333;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  text-transform: capitalize;
}

.status-active {
  color: var(--success-color);
  font-weight: bold;
}

.status-expired {
  color: var(--danger-color);
  font-weight: bold;
}

.status-cancelled {
  color: var(--danger-color);
  font-style: italic;
}

/* ===================================== */
/* Filter-Bereich (aus deinem Snippet)   */
/* ===================================== */

.filter-bar {
  background-color: #000;
  padding: 10px;
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-bar select {
  width: 100%;
  padding: 8px;
  color: #000;
  background-color: #fff;
  border: none;
  border-radius: 4px;
}
.filter-group {
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  color: #fff;
}
.filter-group label {
  margin-bottom: 4px;
  font-size: 0.9em;
  /* Icon styling */
  display: flex;
  align-items: center;
}
.filter-group label i {
  margin-right: 5px;
  color: var(--primary-color); /* Gold/Bronze */
}
.filter-group select {
  padding: 6px;
  border: none;
  border-radius: 4px;
  color: #000;
  background-color: #fff;
}

/* ===================================== */
/* Liste der Memberships                 */
/* ===================================== */

/* Abstand zum Filterbereich verringern */
#membership-list {
  margin-top: 0; /* z.B. kein zusätzlicher Abstand */
  padding: 0 15px;
  box-sizing: border-box;
  margin-bottom: 100px; /* Passe diesen Wert ggf. an die Höhe deines Footers an */
}

/* Neue Styles für die Kategorien-Überschriften */
#membership-list h3 {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--heading-color);
  margin: 30px 0 15px; /* Mehr Abstand oben und unten */
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 5px;
}

/* Optional: Falls auch H4 für Unterkategorien verwendet werden, ähnlich anpassen */
#membership-list h4 {
  font-size: 1.2em;
  font-weight: 600;
  color: var(--heading-color);
  margin: 20px 0 10px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 3px;
}

/* Gruppe von Angeboten */
#membership-list ul.membership-group {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

/* Einzelnes Angebot */
#membership-list ul.membership-group li.offer {
  padding: 8px;
  margin-bottom: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
}

/* Card-Layout für den Angebotstext */
.offer-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
}

.offer-title {
  font-weight: bold;
  font-size: 1.1em;
}

.offer-description {
  font-size: 0.9em;
  color: #555;
}

.offer-price {
  font-size: 1em;
  color: var(--primary-color); /* Gold/Bronze */
  font-weight: bold;
}

/* Angepasste Styles für Heading-Angebote (übersichtlich, getrennt vom Card-Layout) */
.heading-offer {
  background: none;
  border: none;
  box-shadow: none;
  padding: 10px;  /* Mehr Abstand, damit es hervorsticht */
  text-align: center;
  border-radius: 0 !important;  /* Keine Ränder abrunden */
}

.heading-offer h5 {
  margin: 0;
  font-size: 1.2em;  /* Etwas größer */
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  display: inline-block;
  padding-bottom: 5px;
}

/* Heading-Angebote sollen den vollen Container einnehmen – horizontale Abstände entfernen */
li.heading-offer {
  /* Entferne den Container-Innendruck für Headings */
  margin-left: -15px;
  margin-right: -15px;
  padding-left: 15px;
  padding-right: 15px;
}

/* Optional: Den h5-Elementen in Headings ggf. noch etwas spezifischer anpassen */
li.heading-offer h5 {
  margin: 0;
}

/* Buy Membership Button */
.btn-outlined {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  padding: 8px 16px;
  margin-top: 10px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outlined:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Styling for payment dialog */
.dialog-content {
  padding: 16px;
  max-width: 500px;
  margin: 0 auto;
  transition: max-height 400ms ease;
}

.dialog-content h4 {
  margin-top: 0;
  color: var(--primary-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.price-display {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--primary-color);
  margin: 16px 0;
  text-align: center;
}

.payment-form {
  margin-top: 16px;
}

.payment-form .list {
  margin: 0;
}

.payment-form .item-content {
  padding-left: 0;
}

.payment-form .item-inner {
  padding-top: 8px;
  padding-bottom: 8px;
}

.payment-form input {
  font-size: 14px;
}

/* Payment method selection */
.payment-method-selection {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.payment-method-label {
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
  color: #333;
}

.payment-methods {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.payment-method-btn {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 8px 15px;
  height: 60px;
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-method-btn:hover {
  border-color: var(--primary-color);
}

.payment-method-btn.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(200,161,101,0.3);
}

.payment-method-btn img {
  max-height: 40px;
  max-width: 100px;
  object-fit: contain;
}

/* Stripe Elements styling */
.stripe-elements {
  margin-top: 15px;
}

.form-row {
  margin-bottom: 15px;
}

#card-element {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#card-errors {
  color: #df1b41;
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
  min-height: 20px;
}

/* Mock Stripe Elements for demo */
.mock-card-element {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-row {
  display: flex;
  gap: 10px;
}

.mock-input {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  color: #666;
  flex: 1;
}

/* Improved Mock Stripe Elements styling */
.mock-stripe-ui {
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.mock-stripe-field {
  margin-bottom: 16px;
}

.mock-stripe-field label {
  display: block;
  font-size: 14px;
  color: #32325d;
  margin-bottom: 6px;
  font-weight: 500;
}

.mock-input-container {
  position: relative;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  transition: all 0.2s ease;
  background-color: white;
  padding: 10px 12px;
  height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.mock-input-container.focused {
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.mock-input-container input {
  border: none;
  outline: none;
  font-size: 16px;
  color: #32325d;
  background: transparent;
  width: 100%;
  padding: 0;
  margin: 0;
}

.mock-stripe-row {
  display: flex;
  gap: 12px;
}

.mock-stripe-field.half {
  flex: 1;
}

/* Moved card brand icons to be between label and input */
.card-brand-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.card-icon {
  font-size: 10px;
  font-weight: bold;
  padding: 3px 5px;
  border-radius: 3px;
  color: white;
  background: #aaa;
  display: inline-block;
  text-transform: uppercase;
}

.card-icon.visa {
  background-color: #0157a2;
}

.card-icon.mastercard {
  background-color: #eb001b;
}

.card-icon.amex {
  background-color: #2671b8;
}

.card-icon.discover {
  background-color: #ff6c00;
}

/* Remove redundant icon styling */
.card-icons {
  display: none;
}

/* Add animation for processing state */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

#stripe-submit-btn:disabled {
  animation: pulse 1.5s infinite;
  background-color: var(--primary-color);
  cursor: not-allowed;
}

/* Submit button */
.payment-submit-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.2s ease;
}

.payment-submit-btn:hover {
  background-color: #b08a54;
}

/* Styles for the payment processing overlay */
.payment-processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s ease infinite;
}

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


/* TWINT Coming Soon */
.twint-coming-soon {
  text-align: center;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px dashed #ddd;
}

.coming-soon-message {
  font-size: 18px;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.coming-soon-message i {
  color: var(--primary-color);
}

/* Fix for dialog resizing */
.dialog.modal-in {
  transition: transform 400ms, height 400ms;
}

.dialog-content.content-changed {
  animation: refresh-layout 10ms;
}

@keyframes refresh-layout {
  from { opacity: 0.99; }
  to { opacity: 1; }
}

/* Make sure payment content sections transition smoothly */
.payment-content {
  transition: opacity 200ms ease, height 200ms ease;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.payment-content[style*="block"] {
  opacity: 1;
  height: auto;
  overflow: visible;
}

/* Styles für den "Meine Mitgliedschaften"-Button */
.view-memberships-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  padding: 12px 16px;
  border-radius: 30px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
  z-index: 1000;
  font-weight: 600;
  cursor: pointer;
}

/* Styles für die Mitgliedschaftsliste im Dialog */
.membership-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 5px;
}

/* ===================================== */
/* Altersbestätigung für Kids/Teens/Students */
/* ===================================== */

.age-confirmation {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.age-confirmation-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border-top: 4px solid var(--primary-color);
}

.age-confirmation-content h4 {
  color: var(--primary-color);
  margin: 0 0 20px 0;
  font-size: 1.4em;
  text-align: center;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

.age-confirmation-content p {
  color: #333;
  margin: 0 0 20px 0;
  font-size: 1.1em;
  line-height: 1.5;
}

.age-confirmation-content ul {
  margin: 0 0 25px 0;
  padding-left: 20px;
}

.age-confirmation-content li {
  color: #555;
  margin-bottom: 8px;
  font-size: 1em;
}

.age-checkboxes {
  margin-bottom: 25px;
}

.age-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  cursor: pointer;
  font-size: 1.1em;
  color: #333;
  transition: color 0.2s ease;
}

.age-checkbox:hover {
  color: var(--primary-color);
}

.age-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-right: 12px;
  position: relative;
  transition: all 0.2s ease;
  background: white;
}

.age-checkbox input[type="checkbox"]:checked + .checkmark {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.age-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.age-confirmation-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.age-confirmation-buttons .btn-outlined {
  flex: 1;
  max-width: 150px;
  padding: 12px 20px;
  font-size: 1em;
  font-weight: 600;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.age-confirmation-buttons .btn-outlined:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f5f5f5;
  color: #999;
  border-color: #ddd;
}

.age-confirmation-buttons .btn-outlined:not(:disabled):hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 161, 101, 0.3);
}

/* Responsive Design für Altersbestätigung */
@media (max-width: 768px) {
  .age-confirmation {
    padding: 15px;
  }
  
  .age-confirmation-content {
    padding: 20px;
    margin: 10px;
  }
  
  .age-confirmation-content h4 {
    font-size: 1.2em;
  }
  
  .age-confirmation-content p {
    font-size: 1em;
  }
  
  .age-checkbox {
    font-size: 1em;
  }
  
  .age-confirmation-buttons {
    flex-direction: column;
  }
  
  .age-confirmation-buttons .btn-outlined {
    max-width: none;
  }
}

/* ===================================== */
/* Mitgliedschaftsliste im Dialog */
/* ===================================== */

.membership-item {
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.membership-header {
  background-color: #f5f5f5;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ddd;
}

.membership-name {
  font-weight: 600;
  color: var(--primary-color);
}

.recurring-badge {
  background-color: var(--primary-color);
  color: white;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 10px;
}

.membership-details {
  padding: 10px;
  background-color: white;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 14px;
}

.detail-item .label {
  color: #666;
  font-weight: 500;
}

.detail-item .value {
  color: #333;
}

/* Remove extra space below the last membership card in popups/dialogs */
.dialog .membership-list .membership-item:last-child {
  margin-bottom: 32px;
}

/* Make the buy membership popup scrollable, keep space to top/bottom, and prevent horizontal scrolling */
.dialog .dialog-content {
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 5vh;
  margin-bottom: 5vh;
  border-radius: 12px;
  box-sizing: border-box;
  position: relative;
}

/* Enhanced buy membership popup style */
.dialog {
  background: transparent !important;
  box-shadow: none !important;
}

.dialog-inner{
  padding: 0 !important;
}

.dialog .dialog-content {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 1.5px 6px rgba(200,161,101,0.08);
  border-top: 6px solid var(--primary-color);
  padding: 16px 32px 28px 32px;
  max-width: 540px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.dialog .dialog-title {
  display: none;
}

.dialog .dialog-buttons{
  display: none;
}

.dialog .recurring-option label {
  font-size: 1rem;
  color: #444;
  font-weight: 500;
  margin-bottom: 12px;
}

.dialog .payment-method-selection {
  margin-top: 24px;
  border-top: 1px solid #eee;
  padding-top: 18px;
}

.dialog .payment-method-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 10px;
}

.dialog .payment-method-label {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--heading-color);
  text-align: left;
  line-height: 1.2;
}

.dialog .payment-methods {
  gap: 18px;
  margin-bottom: 24px;
}

.dialog .payment-method-btn {
  border: 2px solid #eee;
  border-radius: 10px;
  background: #faf8f6;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(200,161,101,0.07);
}

.dialog .payment-method-btn.active, .dialog .payment-method-btn:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(200,161,101,0.18);
}

.dialog .payment-submit-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 16px 0;
  padding-bottom: 20%;
  font-size: 1.15em;
  font-weight: 700;
  width: 100%;
  margin-top: 28px;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(200,161,101,0.10);
  transition: background 0.2s;
}

.dialog .payment-submit-btn:hover {
  background: #b89454;
}

.dialog .twint-coming-soon {
  background: #f7f7f7;
  border-radius: 8px;
  border: 1px dashed #ddd;
  padding: 18px;
  margin-top: 12px;
}

.dialog .coming-soon-message {
  color: #b89454;
  font-weight: 600;
}

.dialog .dialog-button {
  color: #888 !important;
  font-size: 1em;
  margin-top: 18px;
  text-align: center;
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
}

.dialog .dialog-button:hover {
  color: #c8a165 !important;
}
