/**
 * Frontend styles for WP Booking Form
 */

/* Base Font Settings */
.wp-booking-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Typography Improvements */
.wp-booking-form h1, 
.wp-booking-form h2, 
.wp-booking-form h3, 
.wp-booking-form h4 {
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.wp-booking-form h1 { font-size: 2.25rem; }
.wp-booking-form h2 { font-size: 1.875rem; }
.wp-booking-form h3 { font-size: 1.5rem; }
.wp-booking-form h4 { font-size: 1.25rem; }

.wp-booking-form p {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    color: #555;
}

/* Progress Bar - Mobile-First Design by 30-Year UI Master */
.wp-booking-form-progress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem 1rem 1.25rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

/* Add subtle pattern overlay for depth */
.wp-booking-form-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.03)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

/* Modern Progress Bar */
.wp-booking-form-progress-bar {
    background: rgba(255, 255, 255, 0.15);
    height: 6px;
    border-radius: 3px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

.wp-booking-form-progress-fill {
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.9) 100%);
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    width: 25%;
    position: relative;
    overflow: hidden;
}

/* Animated shimmer effect */
.wp-booking-form-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Mobile-First Steps Design */
.wp-booking-form-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Mobile: Compact dot-style indicators */
.wp-booking-form-step {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.wp-booking-form-step.active {
    opacity: 1;
    transform: scale(1.1);
}

.wp-booking-form-step.completed {
    opacity: 0.8;
}

/* Mobile: Compact step numbers */
.wp-booking-form-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.wp-booking-form-step.active .wp-booking-form-step-number {
    background: #fff;
    color: #667eea;
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #fff;
}

.wp-booking-form-step.completed .wp-booking-form-step-number {
    background: #27ae60;
    color: #fff;
    border-color: #27ae60;
}

/* Mobile: Hide step labels by default */
.wp-booking-form-step-label {
    display: none;
}

/* Mobile: Show current step label prominently */
.wp-booking-form-current-step-info {
    text-align: center;
    margin-top: 0.75rem;
}

.wp-booking-form-current-step-label {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    opacity: 0.95;
    display: block;
}

.wp-booking-form-current-step-description {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Tablet Design (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .wp-booking-form-progress {
        padding: 2rem 1.5rem 1.75rem;
    }
    
    .wp-booking-form-progress-bar {
        height: 8px;
        border-radius: 4px;
        margin-bottom: 2rem;
    }
    
    .wp-booking-form-steps {
        justify-content: space-between;
        gap: 1rem;
    }
    
    .wp-booking-form-step {
        flex-direction: column;
        align-items: center;
        flex: 1;
        max-width: 120px;
    }
    
    .wp-booking-form-step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .wp-booking-form-step-label {
        display: block;
        font-size: 0.875rem;
        font-weight: 500;
        text-align: center;
        line-height: 1.3;
        opacity: 0.9;
    }
    
    .wp-booking-form-current-step-info {
        display: none;
    }
}

/* Desktop Design (1025px+) */
@media (min-width: 1025px) {
    .wp-booking-form-progress {
        padding: 2.5rem 2rem 2rem;
    }
    
    .wp-booking-form-progress-bar {
        height: 10px;
        border-radius: 5px;
        margin-bottom: 2.5rem;
    }
    
    .wp-booking-form-steps {
        justify-content: space-between;
        gap: 2rem;
    }
    
    .wp-booking-form-step {
        flex-direction: column;
        align-items: center;
        flex: 1;
        max-width: 150px;
    }
    
    .wp-booking-form-step-number {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
        margin-bottom: 1rem;
    }
    
    .wp-booking-form-step.active .wp-booking-form-step-number {
        transform: scale(1.05);
    }
    
    .wp-booking-form-step-label {
        display: block;
        font-size: 1rem;
        font-weight: 500;
        text-align: center;
        line-height: 1.3;
        opacity: 0.9;
    }
    
    .wp-booking-form-current-step-info {
        display: none;
    }
}

/* Enhanced interactions for touch devices */
@media (hover: none) and (pointer: coarse) {
    .wp-booking-form-step-number {
        min-width: 44px;
        min-height: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wp-booking-form-progress-bar {
        background: rgba(255, 255, 255, 0.3);
    }
    
    .wp-booking-form-progress-fill {
        background: #fff;
    }
    
    .wp-booking-form-step-number {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wp-booking-form-progress-fill,
    .wp-booking-form-step,
    .wp-booking-form-step-number {
        transition: none;
    }
    
    .wp-booking-form-progress-fill::after {
        animation: none;
    }
}

/* Original mobile responsive adjustments - updated */
@media (max-width: 768px) {
    .wp-booking-form-progress {
        padding: 1.5rem 1rem 1.25rem;
    }
    
    /* Ensure mobile-first design takes precedence */
    .wp-booking-form-steps {
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .wp-booking-form-step {
        flex-direction: row;
        width: auto;
        text-align: center;
    }
    
    .wp-booking-form-step-number {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .wp-booking-form-step-label {
        display: none;
    }
}

/* Form Content */
.wp-booking-form-content {
    padding: 2rem;
}

.wp-booking-form-section {
    margin-bottom: 2rem;
}

.wp-booking-form-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
}

.wp-booking-form-section-icon {
    font-size: 1.75rem;
}

/* Form Fields */
.wp-booking-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .wp-booking-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.wp-booking-form-field {
    display: flex;
    flex-direction: column;
}

.wp-booking-form-label {
    font-size: 1rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.wp-booking-form-required {
    color: #e74c3c;
    font-weight: 600;
}

/* Input Fields */
.wp-booking-form-input,
.wp-booking-form-select,
.wp-booking-form-textarea {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: #fff;
    color: #333;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.wp-booking-form-input:focus,
.wp-booking-form-select:focus,
.wp-booking-form-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wp-booking-form-input::placeholder,
.wp-booking-form-textarea::placeholder {
    color: #999;
    font-size: 0.9375rem;
}

.wp-booking-form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

/* Select Styling */
.wp-booking-form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* Field Errors - Hidden by default */
.wp-booking-form-field-error {
    font-size: 0.875rem;
    color: #e74c3c;
    margin-top: 0.375rem;
    min-height: 1.25rem;
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.wp-booking-form-field-error:not(:empty) {
    display: flex;
}

.wp-booking-form-field-error::before {
    content: "⚠";
    font-size: 0.875rem;
}

/* Error styling for fields */
.wp-booking-form-input.error,
.wp-booking-form-select.error,
.wp-booking-form-textarea.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Success styling for fields */
.wp-booking-form-input.valid,
.wp-booking-form-select.valid,
.wp-booking-form-textarea.valid {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

/* Store Details */
.wp-booking-form-store-details {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.wp-booking-form-store-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.wp-booking-form-store-icon {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.wp-booking-form-store-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.wp-booking-form-store-item {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
    align-items: start;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #f1f3f4;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.wp-booking-form-store-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.wp-booking-form-store-item:last-child {
    border-bottom: 1px solid #f1f3f4;
}

.wp-booking-form-store-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.wp-booking-form-store-value {
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
    padding: 0.25rem 0;
    word-break: break-word;
}

/* Step Actions */
.wp-booking-form-step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.wp-booking-form-btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    background: #667eea;
    color: #fff;
    min-width: 140px;
    justify-content: center;
}

.wp-booking-form-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wp-booking-form-btn:active {
    transform: translateY(0);
}

.wp-booking-form-btn-prev {
    background: #6c757d;
}

.wp-booking-form-btn-prev:hover {
    background: #5a6268;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.wp-booking-form-btn-submit {
    background: #27ae60;
    font-weight: 600;
    padding: 1rem 2rem;
}

.wp-booking-form-btn-submit:hover {
    background: #229954;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.wp-booking-form-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wp-booking-form-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Loading States */
.wp-booking-form-loading,
.wp-booking-form-success,
.wp-booking-form-error {
    text-align: center;
    padding: 3rem 2rem;
}

.wp-booking-form-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wp-booking-form-success-icon,
.wp-booking-form-error-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-booking-form-success-icon {
    background: #d4edda;
    color: #155724;
}

.wp-booking-form-error-icon {
    background: #f8d7da;
    color: #721c24;
}

.wp-booking-form-success-icon svg,
.wp-booking-form-error-icon svg {
    width: 2rem;
    height: 2rem;
}

.wp-booking-form-success h3,
.wp-booking-form-error h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.wp-booking-form-success-message,
.wp-booking-form-error-message {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #555;
}

.wp-booking-form-retry {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wp-booking-form-retry:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Review Section */
.wp-booking-form-review {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.wp-booking-form-review h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.wp-booking-form-review-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.wp-booking-form-review-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.wp-booking-form-review-label {
    font-weight: 500;
    color: #2c3e50;
    min-width: 120px;
}

.wp-booking-form-review-value {
    color: #555;
    text-align: right;
    flex: 1;
    margin-left: 1rem;
}

/* Submit Loading State */
.wp-booking-form-submit-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wp-booking-form-submit-loading .wp-booking-form-spinner {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    border-width: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wp-booking-form {
        margin: 1rem;
        border-radius: 8px;
    }
    
    .wp-booking-form-progress {
        padding: 1.5rem 1rem 1rem;
    }
    
    .wp-booking-form-content {
        padding: 1.5rem;
    }
    
    .wp-booking-form-step-label {
        font-size: 0.75rem;
        max-width: 60px;
    }
    
    .wp-booking-form-step-number {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
    
    .wp-booking-form-section-title {
        font-size: 1.25rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .wp-booking-form-section-icon {
        font-size: 1.5rem;
    }
    
    .wp-booking-form-step-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .wp-booking-form-btn {
        width: 100%;
        justify-content: center;
    }
    
    .wp-booking-form-review-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .wp-booking-form-review-value {
        text-align: left;
        margin-left: 0;
    }
    
    .wp-booking-form-store-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .wp-booking-form-store-label {
        min-width: auto;
    }
    
    .wp-booking-form-store-details {
        padding: 1.5rem;
    }
    
    .wp-booking-form-store-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .wp-booking-form-store-label {
        font-size: 0.875rem;
        font-weight: 700;
        color: #495057;
        margin-bottom: 0.25rem;
    }
    
    .wp-booking-form-store-value {
        font-size: 0.875rem;
        padding: 0;
        margin-top: 0.25rem;
    }
}

/* Accessibility */
.wp-booking-form input:focus,
.wp-booking-form select:focus,
.wp-booking-form textarea:focus,
.wp-booking-form button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wp-booking-form {
        border: 2px solid #000;
    }
    
    .wp-booking-form-input,
    .wp-booking-form-select,
    .wp-booking-form-textarea {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wp-booking-form * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Device Information Step Specific Styles */
.wp-booking-form-step-content[data-step="1"] {
    max-width: 100%;
}

.wp-booking-form-step-content[data-step="1"] .wp-booking-form-section {
    width: 100%;
}

.wp-booking-form-step-content[data-step="1"] .wp-booking-form-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.wp-booking-form-step-content[data-step="1"] .wp-booking-form-field {
    width: 100%;
}

/* Device model select styling */
.wp-booking-form-step-content[data-step="1"] .wp-booking-form-select {
    width: 100%;
    min-width: 100%;
    font-size: 1rem;
    padding: 0.875rem 1rem;
}

/* Device issue textarea styling */
.wp-booking-form-step-content[data-step="1"] .wp-booking-form-textarea {
    width: 100%;
    min-width: 100%;
    min-height: 120px;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.875rem 1rem;
    resize: vertical;
}

/* Phone number field specific styling */
.wp-booking-form-input[type="tel"] {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Field help text */
.wp-booking-form-field-help {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.375rem;
    line-height: 1.4;
}

/* Phone field specific help */
.wp-booking-form-field:has(input[type="tel"]) .wp-booking-form-field-help {
    font-style: italic;
}

/* Step visibility control */
.wp-booking-form-step-content {
    display: none;
}

.wp-booking-form-step-content.active {
    display: block !important;
}
