/* Wizard-specific styles and animations */

/* Hide elements until Alpine.js is ready */
[x-cloak] {
    display: none !important;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Enhanced form focus states */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Custom radio button styling */
.radio-custom {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    background: white;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radio-custom:checked {
    border-color: #3b82f6;
    background: #3b82f6;
}

.radio-custom:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Enhanced button hover effects */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Voice card enhancements */
.voice-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.voice-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.voice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.voice-card:hover::before {
    left: 100%;
}

/* Avatar styling */
.voice-avatar {
    transition: all 0.3s ease;
}

.voice-card:hover .voice-avatar {
    transform: scale(1.05);
}

.voice-card.selected .voice-avatar {
    border-color: hsl(var(--coral));
    box-shadow: 0 0 0 3px hsla(var(--coral),0.2);
}

/* Payment option cards share the same hover chrome */
.payment-option-card {
    position: relative;
    display: block;
}

.payment-option-card > div {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.payment-option-card > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.payment-option-card:hover > div {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.payment-option-card:hover > div::before {
    left: 100%;
}

.payment-option-card input:checked + div {
    box-shadow: 0 16px 35px rgba(237, 126, 102, 0.35);
}

/* Progress bar animation */
.progress-fill {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #3b82f6);
    background-size: 200% 100%;
    animation: progress-shimmer 2s ease-in-out infinite;
}

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

/* Alpine.js transition classes */
.x-transition {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.x-transition-enter-start {
    opacity: 0;
    transform: translateX(20px);
}

.x-transition-enter-end {
    opacity: 1;
    transform: translateX(0);
}

.x-transition-leave-start {
    opacity: 1;
    transform: translateX(0);
}

.x-transition-leave-end {
    opacity: 0;
    transform: translateX(-20px);
}

/* Loading spinner enhancements */
.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Uniform list icons (payment benefits) */
.li-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: inline-block;
    flex-shrink: 0;
}

/* Floating action button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.6);
}

/* Responsive grid adjustments */
@media (max-width: 640px) {
    .voice-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .step-content {
        padding: 1.5rem;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-group button {
        width: 100%;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .voice-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-toggle {
        display: block;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid #000;
    }
    
    .voice-card {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .step-fade-enter,
    .step-fade-exit {
        transition: none;
    }
}
