/**
 * WP BookingX - Frontend Styles
 * Ultra modern, clean, minimalistic design with blue-teal color scheme
 */

:root {
    --mbp-primary: #3B82F6;
    --mbp-primary-hover: #2563EB;
    --mbp-primary-light: #EFF6FF;
    --mbp-secondary: #64748B;
    --mbp-white: #ffffff;
    --mbp-light-gray: #F8FAFC;
    --mbp-gray: #E2E8F0;
    --mbp-dark-gray: #475569;
    --mbp-text: #1E293B;
    --mbp-text-muted: #64748B;
    --mbp-border: #E2E8F0;
    --mbp-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --mbp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --mbp-border-radius: 12px;
    --mbp-border-radius-sm: 8px;
    --mbp-transition: all 0.2s ease;
    --mbp-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Reset and base styles */
.mbp-booking-container * {
    box-sizing: border-box;
}

.mbp-booking-container {
    font-family: var(--mbp-font-family);
    color: var(--mbp-text);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Progress Bar */
.mbp-progress-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    position: relative;
}

.mbp-progress-bar::before {
    content: '';
    position: absolute;
    top: 1.5rem;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--mbp-gray);
    z-index: 1;
}

.mbp-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    max-width: 120px;
}

.mbp-step-number {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--mbp-gray);
    color: var(--mbp-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--mbp-transition);
    margin-bottom: 0.5rem;
}

.mbp-step-label {
    font-size: 0.875rem;
    color: var(--mbp-text-muted);
    text-align: center;
    transition: var(--mbp-transition);
}

.mbp-progress-step.mbp-step-active .mbp-step-number {
    background: var(--mbp-primary);
    color: var(--mbp-white);
}

.mbp-progress-step.mbp-step-active .mbp-step-label {
    color: var(--mbp-primary);
    font-weight: 600;
}

.mbp-progress-step.mbp-step-completed .mbp-step-number {
    background: var(--mbp-primary);
    color: var(--mbp-white);
}

.mbp-progress-step.mbp-step-completed .mbp-step-number::after {
    content: '✓';
}

/* Form Steps */
.mbp-booking-form {
    background: var(--mbp-white);
    border-radius: var(--mbp-border-radius);
    box-shadow: var(--mbp-shadow-lg);
    overflow: hidden;
}

.mbp-step {
    display: none;
    padding: 2.5rem;
    min-height: 500px;
}

.mbp-step.mbp-step-active {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mbp-step-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.mbp-step-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mbp-text);
    margin: 0 0 0.5rem 0;
}

.mbp-step-header p {
    font-size: 1rem;
    color: var(--mbp-text-muted);
    margin: 0;
}

/* Service Selection */
.mbp-services-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mbp-service-option {
    border: 2px solid var(--mbp-border);
    border-radius: var(--mbp-border-radius);
    padding: 0.875rem;
    transition: var(--mbp-transition);
    cursor: pointer;
    background: var(--mbp-white);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Mobile touch optimization */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.mbp-service-option:hover,
.mbp-service-option:active {
    border-color: var(--mbp-primary);
    box-shadow: var(--mbp-shadow);
    transform: translateY(-2px);
}

/* Mobile-specific active state and touch feedback */
@media (max-width: 768px) {
    .mbp-service-option:active,
    .mbp-service-option.mbp-touching,
    .mbp-service-option.mbp-selecting {
        background-color: #f0f8f0 !important;
        transform: scale(0.98) !important;
        border-color: var(--mbp-primary) !important;
        box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3) !important;
        transition: all 0.1s ease !important;
    }
    
    /* Ensure touch events work properly */
    .mbp-service-option {
        touch-action: manipulation !important;
        -webkit-touch-callout: none !important;
        -webkit-tap-highlight-color: rgba(40, 167, 69, 0.3) !important;
        pointer-events: auto !important;
    }
    
    /* Improve tap target size for mobile */
    .mbp-service-option {
        min-height: 80px;
        padding: 1rem;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(40, 167, 69, 0.3);
    }
    
    .mbp-select-service {
        min-height: 44px;
        min-width: 100px;
        padding: 0.75rem 1rem;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(40, 167, 69, 0.3);
    }
    
    /* Enhanced visual feedback for selection process */
    .mbp-service-option.mbp-selecting {
        position: relative;
    }
    
    .mbp-service-option.mbp-selecting::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(40, 167, 69, 0.1);
        border-radius: inherit;
        pointer-events: none;
    }
}

.mbp-service-option.selected {
    border-color: var(--mbp-primary);
    background: var(--mbp-primary-light);
}

.mbp-service-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mbp-text);
    margin: 0 0 0.5rem 0;
}

.mbp-service-description {
    color: var(--mbp-text-muted);
    font-size: 0.8rem;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.mbp-service-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
}

.mbp-service-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--mbp-text-muted);
}

.mbp-service-detail.mbp-service-price {
    font-weight: 600;
    color: var(--mbp-primary);
}

.mbp-icon {
    display: flex;
    align-items: center;
    color: var(--mbp-primary);
}

.mbp-price {
    font-size: 1.1rem;
    font-weight: 700;
}

.mbp-service-select {
    flex-shrink: 0;
}

/* Date & Time Selection */
.mbp-datetime-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .mbp-datetime-container {
        grid-template-columns: 1fr;
    }
}

.mbp-calendar-container,
.mbp-time-container {
    background: var(--mbp-light-gray);
    border-radius: var(--mbp-border-radius);
    padding: 1.5rem;
}

.mbp-calendar-container h3,
.mbp-time-container h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--mbp-text);
}

/* Calendar */
.mbp-calendar {
    background: var(--mbp-white);
    border-radius: var(--mbp-border-radius-sm);
    overflow: hidden;
    box-shadow: var(--mbp-shadow);
}

.mbp-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--mbp-primary);
    color: var(--mbp-white);
}

.mbp-calendar-title {
    font-weight: 600;
    font-size: 1rem;
}

.mbp-calendar-nav {
    background: none;
    border: none;
    color: var(--mbp-white);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--mbp-border-radius-sm);
    transition: var(--mbp-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbp-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mbp-calendar-grid {
    padding: 1rem;
}

.mbp-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.mbp-calendar-day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mbp-text-muted);
    padding: 0.5rem 0;
}

.mbp-calendar-dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.mbp-calendar-date {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--mbp-border-radius-sm);
    cursor: pointer;
    transition: var(--mbp-transition);
    font-size: 0.875rem;
    position: relative;
}

.mbp-calendar-date:hover {
    background: var(--mbp-light-gray);
}

.mbp-calendar-date.available {
    background: var(--mbp-white);
    border: 1px solid var(--mbp-border);
}

.mbp-calendar-date.available:hover {
    border-color: var(--mbp-primary);
    background: var(--mbp-primary-light);
}

.mbp-calendar-date.selected {
    background: var(--mbp-primary);
    color: var(--mbp-white);
}

.mbp-calendar-date.disabled {
    color: var(--mbp-text-muted);
    cursor: not-allowed;
}

.mbp-calendar-date.waiting-period {
    background: repeating-linear-gradient(
        45deg,
        #f8f9fa,
        #f8f9fa 3px,
        #e9ecef 3px,
        #e9ecef 6px
    );
    color: var(--mbp-text-muted);
    cursor: not-allowed;
    position: relative;
}

.mbp-calendar-date.waiting-period::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 1px;
    background: var(--mbp-text-muted);
    opacity: 0.5;
}

.mbp-calendar-date.other-month {
    color: var(--mbp-text-muted);
    opacity: 0.5;
}

/* Time Slots */
.mbp-time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.mbp-time-slot {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border: 1px solid var(--mbp-border);
    border-radius: var(--mbp-border-radius-sm);
    background: var(--mbp-white);
    cursor: pointer;
    transition: var(--mbp-transition);
    font-size: 0.875rem;
    font-weight: 500;
}

.mbp-time-slot:hover {
    border-color: var(--mbp-primary);
    background: var(--mbp-primary-light);
}

.mbp-time-slot.selected {
    background: var(--mbp-primary);
    color: var(--mbp-white);
    border-color: var(--mbp-primary);
}

.mbp-no-date-selected,
.mbp-no-times-available {
    text-align: center;
    color: var(--mbp-text-muted);
    padding: 2rem 1rem;
    font-style: italic;
}

/* Customer Form */
.mbp-customer-form {
    max-width: 600px;
    margin: 0 auto;
}

.mbp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .mbp-form-grid {
        grid-template-columns: 1fr;
    }
}

.mbp-form-group-full {
    grid-column: 1 / -1;
}

.mbp-form-group {
    display: flex;
    flex-direction: column;
}

.mbp-form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--mbp-text);
    font-size: 0.875rem;
}

.required {
    color: var(--mbp-primary);
}

.mbp-input,
.mbp-textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--mbp-border);
    border-radius: var(--mbp-border-radius-sm);
    font-size: 1rem;
    transition: var(--mbp-transition);
    background: var(--mbp-white);
    font-family: inherit;
}

.mbp-input:focus,
.mbp-textarea:focus {
    outline: none;
    border-color: var(--mbp-primary);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.mbp-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Error states for form validation */
.mbp-input.error,
.mbp-textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.mbp-field-error {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Required field indicator styling */
.required {
    color: #dc3545;
    font-weight: 600;
}

/* Enhanced required field styling */
.mbp-form-group label .required::before {
    content: '';
    margin-right: 2px;
}

/* Validation success state */
.mbp-input.valid,
.mbp-textarea.valid {
    border-color: var(--mbp-primary);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Form validation feedback */
.mbp-form-group.has-error .mbp-input,
.mbp-form-group.has-error .mbp-textarea {
    border-color: #dc3545;
}

.mbp-form-group.has-success .mbp-input,
.mbp-form-group.has-success .mbp-textarea {
    border-color: var(--mbp-primary);
}

/* Booking Summary */
.mbp-booking-summary {
    background: var(--mbp-light-gray);
    border-radius: var(--mbp-border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.mbp-booking-summary h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--mbp-text);
}

.mbp-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--mbp-border);
}

.mbp-summary-item:last-child {
    border-bottom: none;
}

.mbp-summary-total {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--mbp-primary);
    border-top: 2px solid var(--mbp-border);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.mbp-summary-label {
    color: var(--mbp-text-muted);
}

.mbp-summary-value {
    font-weight: 500;
    color: var(--mbp-text);
}

/* Buttons */
.mbp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--mbp-border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--mbp-transition);
    font-family: inherit;
    line-height: 1;
}

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

.mbp-btn-primary:hover:not(:disabled) {
    background: var(--mbp-primary-hover);
    transform: translateY(-1px);
}

.mbp-btn-secondary {
    background: var(--mbp-secondary);
    color: var(--mbp-white);
}

.mbp-btn-secondary:hover:not(:disabled) {
    background: var(--mbp-dark-gray);
}

.mbp-btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.mbp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.mbp-btn-loading .mbp-btn-text {
    display: none;
}

.mbp-btn-loading .mbp-btn-loading {
    display: flex !important;
}

.mbp-btn-success {
    background: #10B981 !important;
    border-color: #10B981 !important;
    cursor: default !important;
    pointer-events: none !important;
}

.mbp-btn-success:hover {
    background: #10B981 !important;
    border-color: #10B981 !important;
    transform: none !important;
}

.mbp-btn-completed {
    background: #10B981 !important;
    border-color: #10B981 !important;
    color: white !important;
    pointer-events: none !important;
    cursor: default !important;
    opacity: 1 !important;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbp-btn-completed:hover {
    background: #10B981 !important;
    border-color: #10B981 !important;
    transform: none !important;
}

.mbp-booking-completed {
    pointer-events: none !important;
    opacity: 0.8;
}

.mbp-booking-completed * {
    pointer-events: none !important;
}

.mbp-spinner {
    animation: spin 1s linear infinite;
}

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

/* Pulse animation for fallback button highlighting */
.mbp-btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* Step Actions */
.mbp-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--mbp-border);
}

@media (max-width: 480px) {
    .mbp-step-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mbp-step-actions .mbp-btn {
        width: 100%;
    }
}

/* Success Message */
.mbp-success-message {
    text-align: center;
    padding: 3rem 2rem;
}

.mbp-success-content {
    max-width: 400px;
    margin: 0 auto;
}

.mbp-success-icon {
    color: var(--mbp-primary);
    margin-bottom: 1.5rem;
}

.mbp-success-message h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mbp-text);
    margin: 0 0 1rem 0;
}

.mbp-success-message p {
    color: var(--mbp-text-muted);
    margin: 0 0 2rem 0;
    line-height: 1.6;
}

/* Loading States */
.mbp-loading {
    position: relative;
    pointer-events: none;
}

.mbp-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* Notices */
.mbp-notice {
    padding: 1rem 1.5rem;
    border-radius: var(--mbp-border-radius-sm);
    margin-bottom: 1rem;
    font-weight: 500;
}

.mbp-notice-success {
    background: var(--mbp-primary-light);
    color: var(--mbp-primary);
    border: 1px solid var(--mbp-primary);
}

.mbp-notice-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mbp-notice-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mbp-booking-container {
        padding: 1rem 0.5rem;
    }
    
    .mbp-step {
        padding: 1.5rem;
    }
    
    .mbp-services-grid {
        grid-template-columns: 1fr;
    }
    
    .mbp-progress-bar {
        margin-bottom: 2rem;
    }
    
    .mbp-step-number {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
    
    .mbp-step-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .mbp-step-header h2 {
        font-size: 1.5rem;
    }
    
    .mbp-service-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .mbp-time-slots {
        grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.mbp-service-option:focus,
.mbp-calendar-date:focus,
.mbp-time-slot:focus,
.mbp-btn:focus {
    outline: 2px solid var(--mbp-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .mbp-booking-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .mbp-btn {
        display: none;
    }
}

/* ============================================
   POWERED BY BRANDING (Free Version)
   ============================================ */

.mbp-powered-by {
    text-align: center;
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
    background: linear-gradient(180deg, transparent, rgba(249, 250, 251, 0.8));
    margin-top: auto;
}

.mbp-powered-by a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    font-size: 12px;
    color: #9ca3af;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
}

.mbp-powered-by a:hover {
    color: #6b7280;
    background: rgba(255, 255, 255, 0.8);
}

.mbp-powered-text {
    font-weight: 400;
}

.mbp-powered-brand {
    font-weight: 600;
    color: var(--mbp-primary);
    letter-spacing: -0.3px;
}

.mbp-powered-by a:hover .mbp-powered-brand {
    color: var(--mbp-primary-hover);
}

@media (max-width: 480px) {
    .mbp-powered-by {
        padding: 12px 16px;
    }
    
    .mbp-powered-by a {
        font-size: 11px;
    }
}
