/**
 * BookingProgressBar Component Styles
 * 
 * Enhanced styles for the booking progress bar with improved responsiveness,
 * better visual design, and proper back navigation support.
 * 
 * Dark Theme Colors:
 * - Primary Background: #141416 (dark)
 * - Step Background: #1a1a1c (slightly lighter)
 * - Text Primary: #ffffff (white)
 * - Text Secondary: #a3a3a3 (gray)
 * - Border: #777E90 (gray border)
 * - Active Step: #8b5cf6 (purple)
 * - Completed Step: #4FF6B1 (green)
 * - Connector Line: #777E90 (gray)
 * - Hover State: #6d28d9 (darker purple)
 */

/* Component Reset - Prevent global style conflicts */
.booking-progress-bar,
.booking-progress-bar *,
.booking-progress-bar *::before,
.booking-progress-bar *::after {
    box-sizing: border-box;
}

/* Main Progress Bar Container */
.booking-progress-bar,
#gdlr-booking-process-bar {
    /* CSS Custom Properties - Override these for theming */
    --progress-bg: rgba(20, 20, 22, 0.8);
    --progress-border: rgba(119, 126, 144, 0.2);
    --progress-backdrop: blur(10px);
    
    --step-bg: #1f1f23;
    --step-bg-hover: color-mix(in srgb, var(--event-cta-color, #4323FF) 85%, black);
    --step-border: #777E90;
    --step-text: #a3a3a3;
    
    --step-active-bg: var(--event-primary-color, #4323FF);
    --step-active-border: var(--event-primary-color, #4323FF);
    --step-active-text: #ffffff;
    --step-active-glow: color-mix(in srgb, var(--event-cta-color, #4323FF) 40%, transparent);
    
    --step-complete-bg: var(--event-secondary-color, #4FF6B1);
    --step-complete-border: var(--event-secondary-color, #4FF6B1);
    --step-complete-text: #000000;
    --step-complete-glow: color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 30%, transparent);
    
    --step-shadow-default: rgba(0, 0, 0, 0.15);
    --step-shadow-hover: rgba(109, 40, 217, 0.4);
    
    
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px 20px !important;
    margin: 24px 0;
    font-family: var(--event-font-family, "DM Sans"), sans-serif;
    background: var(--progress-bg);
    border-radius: 16px;
    border: 1px solid var(--progress-border);
    -webkit-backdrop-filter: var(--progress-backdrop);
    backdrop-filter: var(--progress-backdrop);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset 0 0 0 1px var(--progress-border);
}

/* Back Button */
.booking-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 10%, transparent);
    border: 2px solid color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 30%, transparent);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    cursor: pointer;
}

.booking-back-button:hover {
    background: color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 20%, transparent);
    border-color: var(--event-secondary-color, #4FF6B1);
    transform: translateX(-4px) scale(1.1);
    box-shadow: 0 0 20px color-mix(in srgb, var(--event-secondary-color, #4FF6B1) 40%, transparent);
}

.booking-back-button svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.booking-back-button:hover svg {
    transform: translateX(-2px);
}



/* Individual Step */
.booking-progress-step {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 52px; /* Explicit minimum height to prevent collapse */
    padding: 16px 20px; /* Increased to compensate for 2px border visual offset */
    background: var(--step-bg);
    border: 2px solid var(--step-border);
    border-radius: 14px;
    font-family: var(--event-font-family, "DM Sans"), sans-serif !important; /* Event typography from Visual Settings */
    font-size: 15px;
    font-weight: 600;
    color: var(--step-text);
    text-align: center;
    line-height: 1 !important; /* Remove extra font space - must override theme */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    text-decoration: none;
    box-shadow: 0 0 8px var(--step-shadow-default);
    -webkit-user-select: none;
    user-select: none;
    transform-origin: center center;
    align-self: center; /* Ensure vertical centering in flex container */
    box-sizing: border-box !important; /* Ensure consistent box model */
}

/* Step Content Wrapper - Proper flexbox centering */
.booking-progress-step__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit !important; /* Use parent font (DM Sans) */
    font-size: inherit !important; /* Inherit size */
    line-height: 1 !important; /* Remove extra space above/below text - override theme */
    margin: 0 !important; /* Remove any margin */
    padding: 0 !important; /* Remove any padding */
    /* Key fix: Reset vertical-align to prevent baseline issues */
    vertical-align: baseline !important;
    /* Flexbox child alignment */
    align-self: center !important;
}

/* NOTE: Pseudo-elements removed to prevent interference with flex centering
   The debugging overrides and actual shadow rendering handle these */

/* Step States */
.booking-progress-step--active {
    background: var(--step-active-bg);
    border-color: var(--step-active-border);
    color: var(--step-active-text);
    transform: scale(1.02);
    box-shadow: 0 0 8px var(--step-active-glow), 0 0 0 2px color-mix(in srgb, var(--event-cta-color, #4323FF) 15%, transparent);
    font-weight: 700;
    z-index: 2;
    transform-origin: center center;
}

.booking-progress-step--completed {
    background: var(--step-complete-bg);
    border-color: var(--step-complete-border);
    color: var(--step-complete-text);
    font-weight: 700;
    box-shadow: 0 0 8px var(--step-complete-glow);
    cursor: pointer;
}

.booking-progress-bar .booking-progress-step--completed,
.booking-progress-bar .booking-progress-step--completed .booking-progress-step__content,
.booking-progress-bar .booking-progress-step--completed .booking-progress-step__number,
.booking-progress-bar .booking-progress-step--completed .booking-progress-step__text,
#gdlr-booking-process-bar .booking-progress-step--completed,
#gdlr-booking-process-bar .booking-progress-step--completed .booking-progress-step__content,
#gdlr-booking-process-bar .booking-progress-step--completed .booking-progress-step__number,
#gdlr-booking-process-bar .booking-progress-step--completed .booking-progress-step__text,
.booking-progress-step--completed a,
.booking-progress-step--completed a:visited,
.booking-progress-step--completed .booking-progress-step__link {
    color: var(--step-complete-text) !important;
}

.booking-progress-step--clickable {
    cursor: pointer;
}

.booking-progress-step--clickable:hover,
.booking-progress-step--completed:hover {
    border-color: var(--step-bg-hover);
    background: var(--step-bg-hover);
    color: var(--step-active-text);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 20px var(--step-shadow-hover);
}

.booking-progress-step--completed:hover .booking-progress-step__content,
.booking-progress-step--completed:hover .booking-progress-step__number,
.booking-progress-step--completed:hover .booking-progress-step__text,
.booking-progress-step--completed:hover .booking-progress-step__link,
.booking-progress-step--completed:hover a {
    color: var(--step-active-text) !important;
}

.booking-progress-step--clickable:active,
.booking-progress-step--completed:active {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 2px 12px var(--step-shadow-hover);
}

/* Disabled step state - prevents interaction on confirmation page */
.booking-progress-step--disabled {
    pointer-events: none !important;
    cursor: default !important;
    opacity: 0.7;
}

.booking-progress-step--disabled:hover,
.booking-progress-step--disabled.booking-progress-step--hover {
    transform: none !important;
    box-shadow: 0 0 8px var(--step-shadow-default) !important;
    border-color: inherit !important;
    background: inherit !important;
    color: inherit !important;
}

.booking-progress-step--disabled.booking-progress-step--clickable,
.booking-progress-step--disabled.booking-progress-step--completed {
    cursor: default !important;
}

/* Step with Link */
.booking-progress-step a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}


/* Step Numbers (optional) */
.booking-progress-step__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-family: inherit; /* Use parent font (DM Sans) */
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1 !important; /* Precise centering - override theme */
    margin: 0 !important; /* Remove any margin */
    padding: 0 !important; /* Remove any padding */
    vertical-align: middle !important; /* Force middle alignment */
}

.booking-progress-step--active .booking-progress-step__number {
    background: rgba(255, 255, 255, 0.3);
}

.booking-progress-step--completed .booking-progress-step__number {
    background: rgba(255, 255, 255, 0.3);
}

/* Step Text */
.booking-progress-step__text {
    font-family: inherit; /* Use parent font (DM Sans) */
    line-height: 1 !important; /* Remove extra space above/below text - override theme */
    white-space: nowrap;
    display: flex; /* Make it flex to control alignment */
    align-items: center; /* Vertically center the text */
    margin: 0 !important; /* Remove any margin */
    padding: 0 !important; /* Remove any padding */
    vertical-align: middle !important; /* Force middle alignment */
}

/* Error State */
.booking-progress-bar--error {
    background: #1a1a1c;
    border: 2px solid #ef4444;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.booking-progress-bar__error-message {
    color: #ef4444;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Responsive Design */
/* ========================================================================
   RESPONSIVE DESIGN - Mobile First
   ======================================================================== */

/* Mobile & Tablet (all screens up to 768px) */
@media (max-width: 768px) {
    .booking-progress-bar,
    #gdlr-booking-process-bar {
        flex-direction: row;
        gap: 8px;
        padding: 10px 12px;
        margin: 12px 0;
    }
    
    .booking-back-button {
        width: 32px;
        height: 32px;
    }
    
    .booking-back-button svg {
        width: 18px;
        height: 18px;
    }
    
    .booking-back-button:hover {
        transform: translateX(-2px) scale(1.05);
    }
    
    .booking-progress-step {
        min-width: 40px;
        max-width: 40px;
        width: 40px;
        min-height: 40px;
        max-height: 40px;
        height: 40px;
        padding: 0;
        font-size: 13px;
        touch-action: manipulation;
        justify-content: center;
        transform: none;
        border-radius: 50%;
        flex-shrink: 0;
    }
    
    .booking-progress-step__content {
        gap: 0;
    }
    
    .booking-progress-step__text {
        display: none;
    }
    
    .booking-progress-step__number {
        width: 24px;
        height: 24px;
        font-size: 13px;
        background: transparent;
    }
    
    .booking-progress-step--active {
        box-shadow: 0 0 12px var(--step-active-glow), 0 0 0 2px color-mix(in srgb, var(--event-cta-color, #8B5CF6) 20%, transparent);
        transform: none;
    }
    
    .booking-progress-step--clickable:hover,
    .booking-progress-step--completed:hover {
        transform: scale(1.1);
    }
    
    .booking-progress-step--clickable:active,
    .booking-progress-step--completed:active {
        transform: scale(0.95);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .booking-progress-step {
        border-width: 2px;
    }
    
    .booking-progress-step--active {
        border-width: 3px;
        font-weight: 800;
    }
    
    .booking-progress-step--completed {
        border-width: 2px;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .booking-progress-step,
    .booking-progress-step--active {
        transition: none;
        transform: none;
    }
    
    .booking-progress-step--clickable:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .booking-progress-bar {
        background: #fff;
        color: #000;
        border: 1px solid #000;
        border-radius: 8px;
        padding: 16px;
    }
    
    .booking-progress-step {
        background: #fff;
        border: 1px solid #000;
        color: #000;
    }
    
    .booking-progress-step--active {
        background: #ddd;
        font-weight: 800;
    }
    
    .booking-progress-step--completed {
        background: #eee;
    }
    
}

/* ========================================================================
   NOTE: Legacy class compatibility
   The following legacy classes still work via cascading/specificity:
   - #gdlr-booking-process-bar (inherits from .booking-progress-bar)
   - .gdlr-active (no longer output, but kept in responsive rules)
   - .gdlr-back (no longer output, but kept in responsive rules)
   ======================================================================== */


/* Accessibility */
.booking-progress-step:focus,
.booking-progress-step a:focus {
    outline: 2px solid var(--step-complete-bg);
    outline-offset: 2px;
}

/* Loading state */
.booking-progress-bar--loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.booking-progress-bar--loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, var(--step-active-glow), transparent);
    animation: loading-shimmer 1.5s infinite;
    border-radius: 16px;
}

@keyframes loading-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.booking-progress-bar--loading .booking-progress-step {
    opacity: 0.8;
    cursor: wait;
}

/* Focus states for accessibility */
.booking-progress-step:focus-visible {
    outline: 3px solid var(--step-complete-bg);
    outline-offset: 3px;
    border-color: var(--step-active-bg);
}

.booking-progress-step a:focus-visible {
    outline: 3px solid var(--step-complete-bg);
    outline-offset: 3px;
    border-radius: 8px;
}

