/* Clinic Booking System — Public Styles (RTL, Persian) */

.cbs-wrap {
    direction: rtl;
    font-family: 'Tahoma', 'IRANSans', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

.cbs-wrap *,
.cbs-wrap *::before,
.cbs-wrap *::after {
    box-sizing: border-box;
}

/* Step containers */
.cbs-step {
    margin-bottom: 20px;
}

.cbs-label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #444;
}

/* Select */
.cbs-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.cbs-select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

/* Calendar */
#cbs-calendar {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    padding: 12px;
    user-select: none;
}

.cbs-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cbs-cal-nav {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a90d9;
    transition: background 0.15s;
}

.cbs-cal-nav:hover {
    background: #f0f6ff;
}

.cbs-cal-title {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.cbs-cal-grid {
    width: 100%;
    border-collapse: collapse;
}

.cbs-cal-grid th {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 4px 2px;
    font-weight: normal;
}

.cbs-cal-grid td {
    text-align: center;
    padding: 2px;
}

.cbs-cal-day {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    color: #333;
    transition: background 0.15s, color 0.15s;
}

.cbs-cal-day:hover:not(:disabled):not(.cbs-cal-day--holiday):not(.cbs-cal-day--weekend) {
    background: #e8f4fd;
    color: #1a73e8;
}

.cbs-cal-day:disabled,
.cbs-cal-day--past {
    color: #ccc !important;
    cursor: default;
    pointer-events: none;
}

.cbs-cal-day--holiday,
.cbs-cal-day--weekend {
    color: #e53935;
    cursor: default;
    pointer-events: none;
}

.cbs-cal-day--selected {
    background: #1a73e8 !important;
    color: #fff !important;
}

.cbs-cal-day--today {
    font-weight: bold;
    border: 2px solid #1a73e8;
}

/* Time slots */
#cbs-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0;
}

.cbs-slot-btn {
    padding: 8px 18px;
    border: 2px solid #ccc;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.cbs-slot-btn:hover:not(:disabled) {
    border-color: #1a73e8;
    color: #1a73e8;
    background: #f0f6ff;
}

.cbs-slot-btn--selected {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

.cbs-slot-btn--taken {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #bbb;
    cursor: not-allowed;
    text-decoration: line-through;
}

.cbs-slots-loading {
    color: #888;
    font-size: 13px;
    padding: 8px 0;
}

.cbs-slots-message {
    color: #888;
    font-size: 13px;
    padding: 8px 0;
}

/* Form fields */
.cbs-form-row {
    margin-bottom: 14px;
}

.cbs-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
    transition: border-color 0.2s;
}

.cbs-input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

.cbs-input.cbs-input-error {
    border-color: #e53935;
}

.cbs-required {
    color: #e53935;
}

/* Submit button */
.cbs-btn {
    display: inline-block;
    padding: 10px 28px;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.cbs-btn-primary {
    background: #1a73e8;
    color: #fff;
}

.cbs-btn-primary:hover:not(:disabled) {
    background: #1558b0;
}

.cbs-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.cbs-messages {
    margin-top: 16px;
}

.cbs-message {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.cbs-message-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.cbs-message-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Responsive */
@media (max-width: 480px) {
    .cbs-wrap {
        padding: 10px;
    }

    .cbs-cal-day {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .cbs-slot-btn {
        padding: 6px 14px;
        font-size: 13px;
    }
}
