/* Global styles for Edelweiss plugin shortcodes (no inline CSS) */

/* Badge components (memberships/discounts) */
.mbl_sc-wrap { width:100%; box-sizing:border-box; margin:6px 0; }
.mbl_sc-heading { font-size:.9em; margin:8px 0 6px; font-weight:300; color:#222222; }
.mbl_badges { display:flex; flex-wrap:wrap; gap:6px; }
.mbl_badge { display:inline-block; padding:4px 8px; border:1px solid transparent; border-radius:0; font-size:.8em; line-height:1.2; }
.mbl_badge-active { background:#c3bf07; color:#fffff7; border-color:#c3bf07; }
.mbl_badge-possible { background:#222222; color:#c3bf07; border-color:#222222; }
.mbl_heading-icon { margin-left:8px; display:inline-flex; align-items:center; text-decoration:none; color:inherit; }
.mbl_heading-icon svg { width:14px; height:14px; display:block; }

/* Layout for next course dates shortcodes */
.mbl_layout_main { width: 100%; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-around; align-items: flex-start; }
@media all and (max-width: 996px) { .mbl_div_main{ width:95%; } }
.mbl_layout { width:100%; display:grid; grid-template-rows:100px; grid-template-columns:100px 1fr; gap:8px; justify-content:start; align-content:start; padding:0 7px 0 0; margin-bottom:10px; }
.mbl_shadow_box { -webkit-box-shadow: 3px 3px 15px 0px rgba(117,117,117,1); -moz-box-shadow: 3px 3px 15px 0px rgba(117,117,117,1); box-shadow: 3px 3px 15px 0px rgba(117,117,117,1); border-radius:7px; border:0; }
.mbl_img { border-radius:7px 0 0 7px; border:0; }
.mbl_font { font-size:0.8em; margin:0; }
/* Variant for white text (weiss shortcode) */
.mbl_white .mbl_font { color:#ffffff; }

/* Heatmap container defaults */
.mbl_edel_plz-heatmap-wrap { width:100%; }
.mbl_edel_plz-heatmap { width:100%; min-height:260px; border:1px solid #dadada; box-sizing:border-box; }

/* Heatmap: Tabelle unterhalb der Karte */
.mbl_edel_plz-heatmap-table-wrap { margin-top:8px; overflow:auto; }
.mbl_edel_plz-heatmap-table { width:100%; border-collapse:collapse; font-size:0.9em; }
.mbl_edel_plz-heatmap-table th, .mbl_edel_plz-heatmap-table td { border:1px solid #dadada; padding:6px 8px; text-align:left; }
.mbl_edel_plz-heatmap-table thead th { background:#f7f7f7; font-weight:600; }
.mbl_edel_plz-heatmap-table tbody tr:nth-child(odd) { background:rgba(230,224,0,0.06); }
.mbl_edel_plz-heatmap-table tbody tr:hover { background:rgba(230,224,0,0.12); }

/* Heatmap: Gesamtanzahl-Info unter der Karte, oberhalb der Tabelle */
.mbl_edel_plz-heatmap-total {
  background:#2f2f2f; /* Anthrazit */
  color:#ececec;      /* sehr helles Grau */
  padding:8px 10px;
  margin:8px 0 6px;
  font-size:1.0em;    /* etwas größer als der Tabellen-Text */
  border:1px solid #444;
}

/* Mein-Konto Menü (nur für unsere erzeugte Menügruppe, beeinflusst keine anderen Menüs) */
.mbl_account-icon,
svg.mbl_account-icon,
.mbl_account-menu .mbl_account-icon,
li.mbl_account-menu a .mbl_account-icon { 
    width: 1em !important; 
    height: 1em !important; 
    max-width: 24px !important; 
    max-height: 24px !important; 
    display: inline-block !important; 
    vertical-align: middle !important; 
    margin-right: 5px;
}
.menu-item.mbl_account-menu > .sub-menu { background:#ffffff; border:1px solid #eeeeee; padding:0; }
.menu-item.mbl_account-menu > .sub-menu > li { border-top:1px solid #e5e5e5; }
.menu-item.mbl_account-menu > .sub-menu > li:first-child { border-top:0; }

/* ==========================================================================
   Central Modal System (mbl_edel_modal)
   ========================================================================== */

/* 1. Modal Overlay */
.mbl_edel_modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(34, 34, 34, 0.92);
    z-index: 999999999;
    display: flex;
    align-items: center; /* Desktop: Vertically centered */
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mbl_edel_modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* 2. Modal Dialog Container */
.mbl_edel_modal-dialog {
    background: #222222;
    border: 1px solid #dadada;
    border-radius: 5px;
    width: 100%;
    max-width: 600px;
    position: relative;
    color: #dadada;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Prevent overflow on desktop */
    overflow: hidden;
    box-sizing: border-box !important;
}

.mbl_edel_modal-dialog *,
.mbl_edel_modal-dialog *::before,
.mbl_edel_modal-dialog *::after {
    box-sizing: border-box !important;
}

/* Variant: Info-Modal (wider) */
.mbl_edel_modal-dialog.mbl_edel_modal--info {
    max-width: 800px;
}

/* Variant: Form-Modal */
.mbl_edel_modal-dialog.mbl_edel_modal--form {
    max-width: 700px;
}

/* 3. Modal Header */
.mbl_edel_modal-header {
    padding: 14px;
    border-bottom: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #222222;
    z-index: 10;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    flex-shrink: 0;
}

.mbl_edel_modal-header h3,
.mbl_edel_modal-header h2 {
    margin: 0;
    color: #dadada !important;
    font-size: 1.25rem;
    font-weight: 600;
}

.mbl_edel_modal-close {
    background: var(--mbl_edel_accent, #e6e000) !important;
    border: 1px solid var(--mbl_edel_accent, #e6e000) !important;
    color: #000000 !important;
    padding: 4px 10px;
    cursor: pointer;
    line-height: 1;
    font-size: 1.4rem;
    font-weight: bold;
    transition: opacity 0.2s ease;
}

.mbl_edel_modal-close:hover {
    opacity: 0.8;
    background: var(--mbl_edel_accent, #e6e000) !important;
}

/* 4. Modal Body */
.mbl_edel_modal-body {
    padding: 14px;
    overflow-y: auto; /* Enable scrolling within body */
    flex-grow: 1;
    min-height: 0; /* Flexbox fix for inner scrolling */
}

/* Specific overrides for feedback text and accordion to ensure readability on dark background */
.mbl_edel_modal-dialog .mbl_feedback-text,
.mbl_edel_modal-dialog .mbl_feedback-text p,
.mbl_edel_modal-dialog .mbl_feedback-text strong,
.mbl_edel_modal-dialog .mbl_feedback-text em,
.mbl_edel_modal-dialog .mbl_slb_acc .acc-panel,
.mbl_edel_modal-dialog .mbl_slb_acc .acc-panel p,
.mbl_edel_modal-dialog .mbl_slb_acc .acc-panel strong {
    color: #dadada !important;
}

.mbl_edel_modal-dialog .mbl_slb_acc .acc-header button {
    background: #333333 !important;
    color: #dadada !important;
    border-color: #444444 !important;
}

.mbl_edel_modal-dialog .mbl_slb_acc .acc-header button:hover {
    background: #444444 !important;
}

/* 5. Modal Footer / Actions */
.mbl_edel_modal-actions {
    padding: 14px;
    border-top: 1px solid #444;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-shrink: 0;
    background: #222222;
}

/* Button styling for modals */
.mbl_edel_modal-actions .tab-btn,
.mbl_edel_modal-actions button[type="submit"],
.mbl_edel_modal-actions button[type="button"] {
    background-color: var(--mbl_edel_accent, #e6e000) !important;
    color: #000000 !important;
    border: 1px solid var(--mbl_edel_accent, #e6e000) !important;
    font-weight: 600 !important;
    padding: 8px 16px;
    cursor: pointer;
    text-transform: none;
}

.mbl_edel_modal-actions .tab-btn:hover,
.mbl_edel_modal-actions button:hover {
    opacity: 0.9;
}

/* Body scroll lock when modal is open */
body.mbl_edel_modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Form fields within mbl_edel_modal
   ========================================================================== */
.mbl_edel_modal-body .mbl_edel_field {
    margin-bottom: 15px;
}

.mbl_edel_modal-body label {
    display: block;
    margin-bottom: 6px;
    color: #dadada;
    font-weight: 500;
    font-size: 0.95em;
}

.mbl_edel_modal-body input[type="text"],
.mbl_edel_modal-body input[type="number"],
.mbl_edel_modal-body input[type="email"],
.mbl_edel_modal-body input[type="date"],
.mbl_edel_modal-body input[type="tel"],
.mbl_edel_modal-body input[type="file"],
.mbl_edel_modal-body select,
.mbl_edel_modal-body textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadada;
    background: #ffffff;
    color: #222222 !important;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.mbl_edel_modal-body input:focus,
.mbl_edel_modal-body select:focus,
.mbl_edel_modal-body textarea:focus {
    border-color: #e6e000;
    outline: none;
    box-shadow: 0 0 0 2px rgba(230, 224, 0, 0.2);
}

.mbl_edel_modal-status {
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
    min-height: 1.2em;
}

/* 6. Loading State Spinner */
.mbl_edel_modal-dialog.is-loading {
    pointer-events: none;
}

.mbl_edel_modal-dialog.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(34, 34, 34, 0.5);
    z-index: 20;
    border-radius: 5px;
}

.mbl_edel_modal-dialog.is-loading::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #dadada;
    border-radius: 50%;
    animation: mbl_edel_modal-spin 0.8s linear infinite;
    z-index: 21;
}

@keyframes mbl_edel_modal-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Grid for forms in modals */
.mbl_edel_modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (max-width: 600px) {
    .mbl_edel_modal-overlay {
        padding: 0;
        align-items: flex-end; /* Align to bottom or full screen */
    }

    .mbl_edel_modal-dialog {
        max-width: 100%;
        width: 100%;
        height: 100%; /* Full screen height on mobile */
        max-height: 100%;
        border-radius: 0;
        border: none;
    }

    .mbl_edel_modal-header {
        border-radius: 0;
    }

    .mbl_edel_modal-actions {
        position: sticky;
        bottom: 0;
        z-index: 10;
        box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0)); /* Handle notch/safe area */
    }

    .mbl_edel_modal-grid {
        grid-template-columns: 1fr;
    }
}

/**
 * WooCommerce: Styling für den Button "Zahlungsmethode ändern"
 * Auf der Stripe-Aktualisierungsseite
 */
#place_order[value="Zahlungsmethode ändern"],
#place_order[data-value="Zahlungsmethode ändern"] {
    background-color: #c2be13 !important;
    color: #222222 !important;
    border: 1px solid #c2be13 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    padding: 10px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#place_order[value="Zahlungsmethode ändern"]:hover,
#place_order[data-value="Zahlungsmethode ändern"]:hover {
    background-color: #a8a410 !important;
    border-color: #a8a410 !important;
    color: #000000 !important;
}
