/**
 * Jay's Mobile Wash - Booking System Styles
 * Advanced styling for the appointment booking modal and components
 */

/* Glow effect for text and buttons */
.glow-text {
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5),
                 0 0 20px rgba(168, 85, 247, 0.3),
                 0 0 30px rgba(168, 85, 247, 0.2);
}

.glow-effect {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3),
                0 0 40px rgba(168, 85, 247, 0.2),
                0 0 60px rgba(168, 85, 247, 0.1);
}

/* Step Indicator Styles */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.step-indicator::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #374151;
    z-index: 1;
}

.step-indicator:last-child::after {
    display: none;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #374151;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-indicator.active {
    color: #a855f7;
}

.step-indicator.active .step-circle {
    background: linear-gradient(45deg, #a855f7, #ec4899);
    color: white;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.step-indicator.active::after {
    background: linear-gradient(90deg, #a855f7, #ec4899);
    height: 3px;
}

/* Package and Service Option Styles */
.package-option, .car-type-option {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.package-option:hover, .car-type-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.2);
}

.package-option.selected, .car-type-option.selected {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(236, 72, 153, 0.2));
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.package-option.selected::before, .car-type-option.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(45deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Custom Service Items */
.custom-service-item {
    transition: all 0.3s ease;
}

.custom-service-item:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
}

.custom-service-item .service-checkbox:checked + .checkbox-custom {
    background: linear-gradient(45deg, #a855f7, #ec4899);
    border-color: #a855f7;
}

.custom-service-item .service-checkbox:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #6b7280;
    border-radius: 4px;
    background: #374151;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Form Input Styles */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* Animated Buttons */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

button:hover::before {
    left: 100%;
}

/* Floating Book Now Button Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating-book-button {
    animation: float 3s ease-in-out infinite;
}

/* Loading Spinner - Hardware Accelerated */
@keyframes spin {
    0% { transform: rotate3d(0, 0, 1, 0deg); }
    100% { transform: rotate3d(0, 0, 1, 360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
}

/* Pulse Animation for Important Buttons - Optimized */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
        transform: scale3d(1, 1, 1);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
        transform: scale3d(1.02, 1.02, 1);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    will-change: transform, opacity, box-shadow;
    transform: translateZ(0);
}

/* Success Animation - Hardware Accelerated */
@keyframes bounceIn {
    0% {
        transform: scale3d(0, 0, 1);
        opacity: 0;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
    100% {
        transform: scale3d(1, 1, 1);
        opacity: 1;
    }
}

.success-icon {
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* Modal Backdrop - Optimized for Performance */
#booking-modal {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important;
    will-change: opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateZ(0);
    }
}

/* Modal Content Animation - GPU Accelerated */
#booking-modal > div > div {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

@keyframes slideUp {
    from {
        transform: translate3d(0, 30px, 0);
        opacity: 0;
    }
    to {
        transform: translate3d(0, 0, 0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .step-indicator {
        font-size: 0.75rem;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    #booking-modal > div > div {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .package-option, .custom-service-item {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    #booking-modal,
    .floating-book-button {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .package-option.selected,
    .car-type-option.selected {
        border: 3px solid #ffffff;
        background: #000000;
    }

    .step-indicator.active .step-circle {
        border: 2px solid #ffffff;
    }
}

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

    .floating-book-button {
        animation: none;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    .checkbox-custom {
        background: #1f2937;
        border-color: #4b5563;
    }

    input, select, textarea {
        background: #1f2937 !important;
        border-color: #4b5563 !important;
        color: #ffffff !important;
    }
}

/* Photo Upload Styles */
#photo-upload-area {
    transition: all 0.3s ease;
}

#photo-upload-area:hover {
    background: rgba(168, 85, 247, 0.05);
}

#photo-upload-area.border-purple-400 {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.photo-preview {
    position: relative;
    overflow: hidden;
}

.photo-preview img {
    transition: transform 0.3s ease;
}

.photo-preview:hover img {
    transform: scale(1.05);
}

.remove-photo-btn {
    background: rgba(220, 38, 38, 0.9);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.remove-photo-btn:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

/* Upload Progress Animation */
#progress-bar {
    background: linear-gradient(90deg, #a855f7, #ec4899, #06b6d4);
    background-size: 200% 100%;
    animation: gradientShift 2s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Photo Grid Responsive */
#photo-previews {
    gap: 1rem;
}

@media (max-width: 768px) {
    #photo-previews {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    #photo-upload-area {
        padding: 1.5rem;
    }

    #photo-upload-area p {
        font-size: 0.875rem;
    }
}

/* File Input Styling */
#car-photos-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Drag and Drop States */
#photo-upload-area.drag-over {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    transform: scale(1.02);
}

/* Photo Metadata Display */
.photo-metadata {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(4px);
}

/* Smooth Transitions */
.photo-preview,
.remove-photo-btn,
#photo-upload-area,
#upload-progress {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading States */
.photo-loading {
    background: linear-gradient(90deg, #374151, #4b5563, #374151);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

/* Smooth Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, visibility;
    transform: translateZ(0);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Enhanced Loading Spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(168, 85, 247, 0.3);
    border-top: 4px solid rgba(168, 85, 247, 1);
    border-radius: 50%;
    animation: smoothSpin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    will-change: transform;
    transform: translateZ(0);
}

@keyframes smoothSpin {
    0% { transform: rotate3d(0, 0, 1, 0deg); }
    100% { transform: rotate3d(0, 0, 1, 360deg); }
}

/* Performance Optimization for All Elements */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Optimize hover effects for smooth performance */
.package-option:hover,
.car-type-option:hover,
.custom-service-item:hover {
    transform: translate3d(0, -2px, 0);
    will-change: transform;
}
