/**
 * Amelia Booking Form - Proper Implementation CSS
 * Path: assets/css/booking-form.css
 */

/* Base Container */
.amelia-booking-form {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.amelia-container {
    display: flex;
    min-height: 600px;
}

/* Sidebar */
.amelia-sidebar {
    background: #8B5A3C;
    color: white;
    width: 280px;
    display: flex;
    flex-direction: column;
}

.amelia-steps {
    flex: 1;
    padding: 0;
}

.amelia-step-item {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.amelia-step-item.active {
    background: rgba(255, 255, 255, 0.1);
}

.amelia-step-item.completed {
    background: rgba(255, 255, 255, 0.05);
}

.step-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.amelia-step-item.active .step-icon,
.amelia-step-item.completed .step-icon {
    opacity: 1;
}

.step-text {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.amelia-step-item.active .step-text {
    opacity: 1;
    font-weight: 600;
}

.amelia-collapse {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.collapse-btn {
    background: none;
    border: 2px solid #D4A574;
    color: #D4A574;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.collapse-btn:hover {
    background: #D4A574;
    color: #8B5A3C;
}

/* Main Content */
.amelia-content {
    flex: 1;
    background: white;
    position: relative;
}

.amelia-step-content {
    display: none;
    padding: 40px;
    height: 100%;
}

.amelia-step-content.active {
    display: block;
}

.amelia-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

.amelia-back-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.amelia-back-btn:hover {
    background: #f5f5f5;
}

h2 {
    font-size: 28px;
    font-weight: 400;
    color: #333;
    margin: 0;
}

/* Form Elements */
.amelia-form-group {
    margin-bottom: 24px;
}

.amelia-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.amelia-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.amelia-label.required::after {
    content: ' *';
    color: #e74c3c;
}

.amelia-select-wrapper {
    position: relative;
}

.amelia-select,
.amelia-input,
.amelia-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    background: white;
    transition: border-color 0.2s ease;
}

.amelia-select {
    appearance: none;
    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 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.amelia-select:focus,
.amelia-input:focus,
.amelia-textarea:focus {
    outline: none;
    border-color: #8B5A3C;
}

.amelia-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio Groups */
.amelia-radio-group {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

.amelia-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.amelia-radio input[type="radio"] {
    display: none;
}

.radio-mark {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    transition: border-color 0.2s ease;
}

.amelia-radio input[type="radio"]:checked + .radio-mark {
    border-color: #8B5A3C;
}

.amelia-radio input[type="radio"]:checked + .radio-mark::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #8B5A3C;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Calendar */
.amelia-calendar-wrapper {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.amelia-calendar-header {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.amelia-month-select,
.amelia-year-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.amelia-nav-arrows {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.amelia-arrow {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    color: #666;
    transition: background-color 0.2s ease;
}

.amelia-arrow:hover {
    background: #f5f5f5;
}

.amelia-calendar {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.amelia-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.amelia-day-header {
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.amelia-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    min-height: 44px;
}

.calendar-day:hover:not(.disabled) {
    background: rgba(139, 90, 60, 0.1);
    border-color: #8B5A3C;
}

.calendar-day.selected {
    background: #8B5A3C;
    color: white;
    border-color: #8B5A3C;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: #ccc;
}

/* Time Slots */
.amelia-time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.amelia-time-slot {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

.amelia-time-slot:hover:not(.disabled) {
    border-color: #8B5A3C;
    background: rgba(139, 90, 60, 0.1);
}

.amelia-time-slot.selected {
    background: #8B5A3C;
    color: white;
    border-color: #8B5A3C;
}

.amelia-time-slot.disabled {
    background: #f5f5f5;
    color: #ccc;
    cursor: not-allowed;
}

/* Summary */
.amelia-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.amelia-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.amelia-summary-item:last-child {
    border-bottom: none;
}

.summary-service {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-info {
    font-weight: 500;
    color: #333;
}

.service-details {
    font-size: 12px;
    color: #666;
}

.service-price {
    font-weight: 600;
    color: #8B5A3C;
    font-size: 16px;
}

.amelia-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
    padding: 16px 0 8px;
    border-top: 2px solid #dee2e6;
    margin-top: 12px;
}

.amelia-payment-note {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
}

/* Success Screen */
.amelia-success {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.amelia-success h2 {
    font-size: 32px;
    font-weight: 400;
    color: #333;
    margin-bottom: 8px;
}

.amelia-success p {
    color: #666;
    margin-bottom: 32px;
    font-size: 16px;
}

.amelia-success-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item span:first-child {
    color: #666;
    font-weight: 500;
}

.detail-item span:last-child {
    color: #333;
    font-weight: 400;
}

/* Buttons */
.amelia-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 40px;
}

.amelia-btn {
    padding: 12px 32px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 120px;
}

.amelia-btn-primary {
    background: #8B5A3C;
    color: white;
}

.amelia-btn-primary:hover:not(:disabled) {
    background: #7a4d33;
}

.amelia-btn-primary:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}

.amelia-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.amelia-btn-secondary:hover {
    background: #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .amelia-booking-form {
        margin: 20px;
    }
    
    .amelia-container {
        flex-direction: column;
    }
    
    .amelia-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }
    
    .amelia-steps {
        display: flex;
        flex-direction: row;
    }
    
    .amelia-step-item {
        flex-shrink: 0;
        min-width: 160px;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .amelia-step-item:last-child {
        border-right: none;
    }
    
    .amelia-collapse {
        display: none;
    }
    
    .amelia-step-content {
        padding: 24px;
    }
    
    .amelia-form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .amelia-time-slots {
        grid-template-columns: 1fr;
    }
    
    .amelia-actions {
        flex-direction: column-reverse;
    }
    
    .amelia-btn {
        width: 100%;
    }
    
    .amelia-calendar-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .amelia-nav-arrows {
        margin-left: 0;
        order: -1;
    }
}

@media (max-width: 480px) {
    .amelia-step-content {
        padding: 20px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    .amelia-radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .amelia-calendar-days {
        font-size: 11px;
    }
    
    .calendar-day {
        font-size: 12px;
        min-height: 36px;
    }
}

/* Animation */
.amelia-step-content {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.amelia-step-content:not(.active) {
    opacity: 0;
    transform: translateX(20px);
}

.amelia-step-content.active {
    opacity: 1;
    transform: translateX(0);
}

/* Focus States */
.amelia-select:focus,
.amelia-input:focus,
.amelia-textarea:focus,
.amelia-btn:focus,
.calendar-day:focus,
.amelia-time-slot:focus {
    outline: 2px solid #8B5A3C;
    outline-offset: 2px;
}

/* Loading States */
.amelia-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.amelia-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #8B5A3C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error States */
.amelia-error {
    background: #fff2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.amelia-input.error,
.amelia-select.error,
.amelia-textarea.error {
    border-color: #dc2626;
}

/* Calendar Add to Sidebar for Success */
.amelia-sidebar .calendar-add {
    padding: 24px;
}

.amelia-sidebar .calendar-add h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.calendar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.calendar-btn {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.calendar-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}