/* Frontend styles for appointment booking block */
.wp-block-clinicwp-appointment-booking {
    width: 100%;
}

.cwp-appointment-booking-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
}

.cwp-booking-title {
    margin: 0 0 25px;
    text-align: center;
}

/* Booking Messages */
#cwp-booking-messages {
    margin-bottom: 20px;
}

#cwp-booking-messages .cwp-message {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

#cwp-booking-messages .cwp-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#cwp-booking-messages .cwp-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Booking Form */
.cwp-booking-form {
    width: 100%;
}

/* Booking Steps */
.cwp-booking-step {
    margin-bottom: 25px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cwp-booking-step.cwp-step-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.cwp-booking-step.cwp-step-active {
    border-color: #4f46e5;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

.cwp-booking-step-header {
    background-color: #f9fafb;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.cwp-step-active .cwp-booking-step-header {
    background-color: #eef2ff;
}

.cwp-step-number {
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.cwp-step-disabled .cwp-step-number {
    background-color: #9ca3af;
}

.cwp-booking-step-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.cwp-booking-step-content {
    padding: 20px;
}

/* Form Groups */
.cwp-booking-form .cwp-form-group {
    margin-bottom: 20px;
}

.cwp-booking-form .cwp-form-group:last-child {
    margin-bottom: 0;
}

.cwp-booking-form .cwp-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.cwp-booking-form .cwp-form-group label .required {
    color: #dc2626;
    margin-left: 2px;
}

.cwp-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cwp-form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.cwp-form-control:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

textarea.cwp-form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Time Slots Grid */
#time-selection-group {
    margin-top: 15px;
}

.cwp-time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.cwp-time-slot {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: all 0.2s ease;
}

.cwp-time-slot:hover {
    border-color: #4f46e5;
    background-color: #eef2ff;
    color: #4f46e5;
}

.cwp-time-slot.selected {
    border-color: #4f46e5;
    background-color: #4f46e5;
    color: white;
}

.cwp-time-slot:active {
    transform: scale(0.98);
}

/*.cwp-time-slots-loading {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}*/
.cwp-time-slots-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.cwp-time-slots-loading p {
    margin: 0;
}

.cwp-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 70, 229, 0.1);
    border-radius: 50%;
    border-top-color: #4f46e5;
    animation: spin 0.8s linear infinite;
}

.cwp-time-slots-empty {
    text-align: center;
    padding: 30px;
    color: #6b7280;
    background-color: #f9fafb;
    border-radius: 6px;
}

/* Booking Actions */
.cwp-booking-actions {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.cwp-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.cwp-btn-primary {
    color: white;
}

.cwp-btn-primary:hover {
    opacity: 0.9;
}

.cwp-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.cwp-btn-secondary:hover {
    background-color: #e5e7eb;
}

.cwp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cwp-btn-primary:hover:not(:disabled) {
    background-color: var(--btn-hover-bg, #135e96) !important;
    color: var(--btn-hover-text, #ffffff) !important;
}

.cwp-btn-back:hover:not(:disabled) {
    background-color: var(--back-hover-bg, #e5e7eb) !important;
    color: var(--back-hover-text, #1f2937) !important;
}

/* reCAPTCHA */
.g-recaptcha {
    display: flex;
    justify-content: center;
}

/* Loading State */
.cwp-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cwp-appointment-booking-wrapper {
        padding: 20px 15px;
    }

    .cwp-booking-step-header {
        padding: 12px 15px;
    }

    .cwp-booking-step-content {
        padding: 15px;
    }

    .cwp-time-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .cwp-time-slot {
        padding: 10px 12px;
        font-size: 13px;
    }

    .cwp-booking-actions {
        flex-direction: column;
    }

    .cwp-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cwp-appointment-booking-wrapper {
        padding: 15px;
    }
    
    .cwp-booking-title {
        font-size: 20px;
    }
}