/* ========================================
   BOOKING MODAL COMPONENT
   ======================================== */

.icb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100% !important;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.icb-modal.active {
    opacity: 1;
    visibility: visible;
}

.icb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.icb-modal-container {
    position: relative;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.icb-modal.active .icb-modal-container {
    transform: scale(1) translateY(0);
}

.icb-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.icb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.icb-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.icb-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.icb-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.icb-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Hide the original booking header since we have modal header */
.icb-modal .icb-booking-header {
    display: none;
}

/* Adjust booking container for modal */
.icb-modal .icb-booking-container {
    padding: 0;
    margin: 0;
}

/* Form chrome comes from the modal shell — avoid mismatched corner radii */
.icb-modal .icb-booking-form {
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* Modal responsive design */
@media (max-width: 768px) {
    .icb-modal-container {
        width: 98%;
        max-height: 98vh;
        border-radius: 12px;
    }
    
    .icb-modal-header {
        padding: 20px 24px;
    }
    
    .icb-modal-header h2 {
        font-size: 20px;
    }
    
    .icb-modal-close {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .icb-modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .icb-modal-header {
        padding: 16px 20px;
    }
    
    .icb-modal-header h2 {
        font-size: 18px;
    }
}

/* Animation for modal content */
.icb-modal .icb-booking-container {
    animation: fadeInUp 0.4s ease;
}

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

/* Prevent body scroll when modal is open */
body.icb-modal-open {
    overflow: hidden;
}

/* Custom scrollbar for modal body */
.icb-modal-body::-webkit-scrollbar {
    width: 6px;
}

.icb-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.icb-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.icb-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Override Astra theme content width for modal */
.icb-modal .entry-content[data-ast-blocks-layout] > * {
    max-width: var(--wp--custom--ast-content-width-size) !important;
}

/* Booking steps padding */
.icb-booking-steps {
    padding-top: 14px;
    padding-inline: 10px;
}

/* Hide step text on smaller screens (below 1023px) */
@media (max-width: 1023px) {
    .icb-step-text {
        display: none;
    }
    
    .icb-step {
        justify-content: center;
        min-width: 40px;
    }
}

/* Booking form scrolling for all screen sizes */
.icb-booking-form {
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 0;
}

/* Custom notification system - Notyf style */
.icb-notification-modal {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    width: auto;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.icb-notification-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.icb-notification-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #e5e7eb;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.icb-notification-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icb-notification-text {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    color: #374151;
}

.icb-notification-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.icb-notification-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Notification types */
.icb-notification-modal.error .icb-notification-content {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.icb-notification-modal.error .icb-notification-text {
    color: #dc2626;
}

.icb-notification-modal.success .icb-notification-content {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.icb-notification-modal.success .icb-notification-text {
    color: #059669;
}

.icb-notification-modal.warning .icb-notification-content {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.icb-notification-modal.warning .icb-notification-text {
    color: #d97706;
}

.icb-notification-modal.info .icb-notification-content {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.icb-notification-modal.info .icb-notification-text {
    color: #2563eb;
}

/* Progress bar for auto-hide */
.icb-notification-modal::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 12px 12px;
    animation: notificationProgress 5s linear forwards;
}

.icb-notification-modal.error::after {
    background: #ef4444;
}

.icb-notification-modal.success::after {
    background: #10b981;
}

.icb-notification-modal.warning::after {
    background: #f59e0b;
}

.icb-notification-modal.info::after {
    background: #3b82f6;
}

@keyframes notificationProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .icb-notification-modal {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
    
    .icb-notification-content {
        padding: 14px 16px;
        gap: 10px;
    }
    
    .icb-notification-icon {
        font-size: 18px;
        width: 20px;
        height: 20px;
    }
    
    .icb-notification-text {
        font-size: 13px;
    }
    
    .icb-notification-close {
        font-size: 16px;
        width: 20px;
        height: 20px;
    }
}

/* Navigation buttons sticky positioning (desktop / tall content) */
.icb-booking-navigation {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 20px;
    z-index: 10;
}

/* Step 3 content styling */
.icb-step-content-3 {
    /* No individual scrolling - uses main form scroll */
}

/* Pin nav to modal bottom on mobile/tablet — fill height instead of stretching grids */
@media (max-width: 1023px) {
    .icb-modal-container {
        display: flex;
        flex-direction: column;
        height: 95vh;
        max-height: 95vh;
    }

    .icb-modal-content {
        flex: 1;
        min-height: 0;
    }

    .icb-modal-body {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .icb-modal .icb-booking-container {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .icb-modal .icb-booking-steps {
        flex-shrink: 0;
    }

    .icb-modal .icb-booking-form {
        flex: 1;
        min-height: 0;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-inline: 0;
        padding-bottom: 0;
    }

    .icb-modal .icb-booking-step {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0;
        padding-bottom: 8px;
    }

    .icb-modal .icb-booking-step h3 {
        padding-inline: 16px;
    }

    .icb-modal .icb-staff-grid,
    .icb-modal .icb-services-grid {
        padding-inline: 16px;
    }

    .icb-modal .icb-step-content-4 {
        padding-inline: 16px;
    }

    .icb-modal .icb-booking-navigation {
        position: relative;
        bottom: auto;
        margin-top: auto;
        flex-shrink: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .icb-booking-form {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .icb-modal-container {
        height: 98vh;
        max-height: 98vh;
    }
}

/* Mobile and tablet scrolling for devices below 500px */
@media (max-width: 500px) {
    .icb-modal-container {
        min-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
    }

    .icb-modal-body {
        overflow: hidden;
    }
}