/**
 * Booking System V2 - Layout & Structure
 * 
 * Contains: Popup Overlay, Container, Progress Bar, Navigation, 
 * Content Area, Scrollbar, Step Container, Loading State
 * 
 * @package WerbeaufCustoms\BookingSystem
 * @version 5.0.0
 */

/* ============================================================
   POPUP OVERLAY & CONTAINER
   ============================================================ */

.bs-booking-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    overflow: hidden;
}

.bs-booking-popup.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Backdrop/Overlay */
.bs-booking-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1;
}

/* Main Container */
.bs-booking-container {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 981px) {
    .bs-booking-container {
        border-radius:20px !important;
    }
}


/* ============================================================
   PROGRESS BAR (ganz oben)
   ============================================================ */

.bs-progress-wrapper {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 30px;
    flex-shrink: 0;
}

.bs-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #495e77 0%, #6b7fa0 100%);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.bs-progress-text {
    margin-top: 12px;
    font-size: 16px;
    text-transform: uppercase;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    /*
    text-decoration:underline;
    text-underline-offset:5px;
    text-decoration-thickness:2px;
    */
}

/* ============================================================
   NAVIGATION BAR (Zurück / Schließen)
   ============================================================ */

.bs-navigation-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    gap: 20px;
}

.bs-btn-back {
    margin-right: auto;
}

/* ============================================================
   BACK & CLOSE BUTTONS (Structure only, styling from Admin)
   ========================================================= */
.bs-btn-back,
.bs-btn-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.bs-btn-back:hover,
.bs-btn-close:hover {
    transform: scale(1.04);
}

.bs-btn-back:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}


/* ============================================================
   CONTENT AREA (dynamische Höhe)
   ============================================================ */

.bs-content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5rem 3.5rem;
    min-height: 0;
}

/* Custom Scrollbar */
.bs-content-wrapper::-webkit-scrollbar {
    width: 10px;
}

.bs-content-wrapper::-webkit-scrollbar-track {
    background: #f9fafb;
}

.bs-content-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 5px;
}

.bs-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Inner Content Container */
.bs-content-inner {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================================
   STEPS - CUSTOM CSS
   ============================================================ */

/* Step 1 Spacing */
.bs-step[data-step="1"] .bs-step-title {
    margin-bottom: 3rem;
}
.bs-step[data-step="1"] .bs-step1-actions {
    margin-top: 4rem !important;
}

/* Step 2 (Service Selection): Full width for 3-column grid */
.bs-content-inner.bs-full-width {
    max-width: none !important;
}

/* Fallback for browsers that support :has() */
.bs-content-inner:has(.bs-step[data-step="2"].active) {
    max-width: none !important;
}

/* ============================================================
   STEP CONTAINER
   ============================================================ */

.bs-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.bs-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Header */
.bs-step-header {
    margin-bottom: 3rem;
    text-align: center;
}

.bs-step-title {
    margin: 0 0 20px 0;
    /* font-size, font-weight, color, line-height, letter-spacing, text-transform from Admin panel */
}


.bs-step-description {
    margin: 0;
    /* font-size, color, font-weight, line-height from Admin panel */
}

/* ============================================================
   BODY SCROLL LOCK
   ============================================================ */

body.bs-popup-open {
    overflow: hidden !important;
    height: 100vh;
}

/* ============================================================
   RESPONSIVE (Mobile <980px)
   ============================================================ */

@media screen and (max-width: 980px) {
    .bs-booking-container {
        width: 100%;
        height: 100vh;
    }

    .bs-progress-wrapper {
        padding: 16px 20px;
    }

    .bs-navigation-bar {
        padding: 16px 20px;
    }

    .bs-content-wrapper {
        padding: 4rem 2.5rem;
    }

    /* .bs-step-title font-size from Admin panel */
    /* .bs-step-description font-size from Admin panel */

}

@media screen and (max-width: 767px) {
    .bs-booking-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
    }

    .bs-navigation-bar {
        padding: 12px 16px;
    }

    .bs-content-wrapper {
        padding: 3rem 1rem;
    }

    /* .bs-step-title font-size from Admin panel */

}

/* ============================================================
   STEP VISIBILITY
   ============================================================ */

/* Hidden steps (e.g. Step 1 if disabled) */
.bs-step-hidden {
    display: none !important;
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.bs-loading {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    width: 100%;
    min-height: 200px;
    grid-column: 1 / -1; /* Spans all grid columns */
    margin: 0 auto;
}

.bs-loading p {
    margin: 15px 0 0 0;
    padding: 0;
    width: 100%;
    text-align: center;
    color: #495e77;
    font-size: 16px;
}

.bs-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #495e77;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
    display: block;
}

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