/**
 * Appointment Booking Styles
 * Better You Medical & Diagnostic Center
 */

.appointment-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 80vh;
}

.section-subtitle {
    text-align: center;
    color: #64748b;
    font-size: 18px;
    margin-bottom: 40px;
}

.appointment-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* Step Indicator */
.booking-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.booking-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.step.active .step-number,
.step.completed .step-number {
    background: #1e3a8a;
    color: white;
}

.step.completed .step-number::after {
    content: '✓';
}

.step-label {
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

.step.active .step-label {
    color: #1e3a8a;
    font-weight: 600;
}

/* Step Content */
.booking-step-content {
    animation: fadeIn 0.3s ease;
}

.booking-step-content h2 {
    color: #1e3a8a;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Calendar */
.calendar-wrapper {
    max-width: 400px;
    margin: 0 auto;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #1e3a8a;
}

.calendar-nav {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    color: #1e3a8a;
    transition: background 0.2s;
}

.calendar-nav:hover {
    background: #e2e8f0;
}

.calendar-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 8px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.calendar-day:hover:not(.disabled):not(.other-month) {
    background: #e2e8f0;
}

.calendar-day.selected {
    background: #1e3a8a;
    color: white;
}

.calendar-day.today {
    border-color: #1e3a8a;
}

.calendar-day.disabled,
.calendar-day.other-month {
    color: #cbd5e1;
    cursor: not-allowed;
}

.calendar-day.other-month {
    visibility: hidden;
}

.selected-date-display {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
}

.selected-date-display .label {
    color: #64748b;
    font-size: 14px;
}

.selected-date-display .date-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1e3a8a;
    margin-top: 5px;
}

/* Time Slots */
.time-instruction {
    text-align: center;
    color: #64748b;
    margin-bottom: 20px;
}

.time-slots-wrapper {
    min-height: 200px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.time-slot {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.time-slot:hover:not(.unavailable) {
    border-color: #1e3a8a;
    background: #f0f9ff;
}

.time-slot.selected {
    background: #1e3a8a;
    color: white;
    border-color: #1e3a8a;
}

.time-slot.unavailable {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    text-decoration: line-through;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #1e3a8a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-slots-message {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 0;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #334155;
}

.form-group .required {
    color: #dc2626;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1e3a8a;
}

/* Confirmation */
.confirmation-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.confirmation-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
}

.confirmation-card h3 {
    font-size: 16px;
    color: #1e3a8a;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.detail-label {
    color: #64748b;
}

.detail-value {
    font-weight: 600;
    color: #1e293b;
}

.confirmation-note {
    background: #fef3c7;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
}

.confirmation-note p {
    margin: 0;
    color: #92400e;
}

/* Success */
.booking-success {
    text-align: center;
    padding: 40px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.booking-success h2 {
    color: #059669;
}

.success-details {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: left;
}

/* Navigation */
.booking-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e2e8f0;
}

.btn-primary,
.btn-secondary {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: #1e3a8a;
    color: white;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-submit {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.form-message.show {
    display: block;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
}

/* Responsive */
@media (max-width: 768px) {
    .appointment-wrapper {
        padding: 20px;
        margin: 0 15px;
    }
    
    .booking-steps {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .booking-steps::before {
        display: none;
    }
    
    .step {
        flex: 0 0 calc(50% - 10px);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .confirmation-details {
        grid-template-columns: 1fr;
    }
    
    .booking-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calendar-wrapper {
        padding: 15px;
    }
}
