/* Booking System - Enhanced Styles */

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

@keyframes stepperPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,123,255,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0,123,255,0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.card {
    animation: fadeIn 0.3s ease-out;
}

/* ======================================== */
/* Selection Card Enhancements               */
/* ======================================== */
.selection-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.selection-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 0;
}

.selection-card.selected::before {
    opacity: 0.05;
}

.selection-card > * {
    position: relative;
    z-index: 1;
}

.selection-card.selected {
    border: 3px solid var(--primary) !important;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12), 0 0 0 4px rgba(0,123,255,0.15);
}

/* ======================================== */
/* Enhanced Stepper                          */
/* ======================================== */
.stepper-item.active .stepper-circle {
    box-shadow: 0 0 0 4px rgba(0,123,255,0.2);
    animation: stepperPulse 2s ease-in-out infinite;
}

.stepper-item.completed .stepper-circle {
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
}

/* ======================================== */
/* Sticky Price Bar                          */
/* ======================================== */
.sticky-price-bar {
    position: fixed;
    z-index: 1000;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

.sticky-price-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sticky-price-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sticky-price-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-price-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
}

.sticky-price-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

/* Desktop: floating card bottom-right */
@media (min-width: 769px) {
    .sticky-price-bar {
        bottom: 24px;
        right: 24px;
        border-radius: var(--radius-md);
        padding: 16px 24px;
        max-width: 320px;
    }
}

/* ======================================== */
/* Popular Package Badge                     */
/* ======================================== */
.package-card.popular {
}

.popular-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: var(--primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 0 var(--radius-md) 0 var(--radius-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Enhanced Package Price */
.package-price-large {
    text-align: center;
    padding: 8px 0;
}

.package-price-large .price-currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    vertical-align: super;
}

.package-price-large .price-amount {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -1px;
}

.package-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

/* ======================================== */
/* Enhanced Time Preference Cards            */
/* ======================================== */
.time-pref-card.selected {
    box-shadow: 0 0 0 4px rgba(0,123,255,0.2), 0 8px 25px rgba(0,0,0,0.12);
}

.time-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.25s ease;
}

.time-icon.morning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #f59e0b;
}

.time-icon.afternoon {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #3b82f6;
}

.time-pref-card.selected .time-icon {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* ======================================== */
/* Form Enhancements                         */
/* ======================================== */
.form-input:focus {
    transform: translateY(-1px);
}

/* Button loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
}

/* ======================================== */
/* Mobile Optimizations                      */
/* ======================================== */
@media (max-width: 768px) {
    /* Fixed bottom navigation */
    .step-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-white);
        padding: 12px 20px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
        z-index: 1001;
        display: flex;
        flex-direction: row;
        gap: 12px;
        border-top: 1px solid var(--border-color);
    }

    .step-navigation .btn {
        min-height: 48px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    /* Back button compact, Next button fills space */
    .step-navigation .btn-secondary {
        flex: 0 0 auto;
        padding: 12px 16px;
    }

    .step-navigation .btn-primary {
        flex: 1;
    }

    /* Bottom margin for card to clear fixed nav */
    .card {
        margin-bottom: 100px;
    }

    /* Sticky price bar on mobile: above fixed nav */
    .sticky-price-bar {
        bottom: 73px;
        bottom: calc(73px + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 10px 20px;
    }

    /* Extra bottom space when sticky bar is visible */
    .card.has-sticky-bar {
        margin-bottom: 150px;
    }

    /* Touch-friendly targets */
    .selection-card {
        min-height: 56px;
    }

    .form-input {
        min-height: 48px;
        font-size: 16px; /* prevents iOS auto-zoom */
    }

    .time-pref-card {
        padding: 28px 16px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .btn-large {
        padding: 14px 20px;
        font-size: 1rem;
    }

    .package-price-large .price-amount {
        font-size: 1.75rem;
    }
}

/* ======================================== */
/* Print Styles                              */
/* ======================================== */
@media print {
    .header, .footer, .step-navigation, .sticky-price-bar {
        display: none;
    }

    .main-content {
        max-width: 100%;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 0;
    }
}
