/**
 * Bookly API Bridge Custom Booking Form Styles
 */

.bookly-custom-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.bookly-custom-form-container * {
    box-sizing: border-box;
}

.bookly-custom-form {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bookly-custom-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* Date Input Styling */
#bookly-date {
    background-color: #ffffff !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#bookly-date:focus {
    border-color: #162922 !important;
    box-shadow: 0 0 0 2px rgba(22, 41, 34, 0.1) !important;
    outline: none !important;
}

/* Remove readonly styling when date input is enabled */
#bookly-date:not([readonly]) {
    background-color: #ffffff !important;
    cursor: pointer !important;
}

/* Ensure date picker icon is visible */
#bookly-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
}

/* Form group spacing */
.bookly-form-group {
    margin-bottom: 20px;
}

.bookly-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.bookly-form-group input,
.bookly-form-group select,
.bookly-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.bookly-form-group input:focus,
.bookly-form-group select:focus,
.bookly-form-group textarea:focus {
    border-color: #162922;
    box-shadow: 0 0 0 2px rgba(22, 41, 34, 0.1);
    outline: none;
}

.bookly-form-control {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.bookly-form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.bookly-form-control:disabled,
.bookly-form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Submit button */
.bookly-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.bookly-btn-primary {
    background-color: #162922;
    color: #ffffff;
}

.bookly-btn-primary:hover {
    background-color: #0f1f1a;
    transform: translateY(-1px);
}

.bookly-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.bookly-btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5);
}

.bookly-btn-primary:disabled {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    opacity: 0.65;
    cursor: not-allowed;
}

.bookly-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.bookly-slot {
    flex: 0 0 calc(25% - 10px);
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bookly-slot:hover {
    background-color: #f1f1f1;
}

.bookly-slot.selected {
    background-color: #007bff;
    color: white;
    border-color: #0062cc;
}

/* New Time Slots Styling */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.time-slot-btn {
    background-color: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.time-slot-btn:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
    color: #007bff;
}

.time-slot-btn.selected {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.time-slot-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Loading and Message States */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.no-slots-message {
    text-align: center;
    padding: 20px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
}

.error-message {
    text-align: center;
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
}

/* Success and error messages */
.bookly-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.bookly-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Loading indicator */
.bookly-loading {
    text-align: center;
    padding: 20px;
    color: #162922;
    font-weight: 600;
}

/* Checkbox styling */
.bookly-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bookly-checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
    flex-shrink: 0;
}

.bookly-checkbox-group label {
    margin: 0;
    font-weight: normal;
    color: #555;
    line-height: 1.5;
}

/* Responsive styles */
@media (max-width: 768px) {
    .bookly-custom-form {
        padding: 20px 15px;
    }
    
    .bookly-slot {
        flex: 0 0 calc(50% - 10px);
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .time-slot-btn {
        padding: 10px 6px;
        font-size: 13px;
    }

    .bookly-form-group input,
    .bookly-form-group select,
    .bookly-form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .bookly-btn {
        width: 100%;
        padding: 16px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .bookly-slot {
        flex: 0 0 100%;
    }
    
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .time-slot-btn {
        padding: 12px 8px;
        font-size: 14px;
    }
}