/* ============================================================
   Booking Modal & Calendar Styles
   ============================================================ */

/* Overlay */
#optic-booking-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Modal Container */
#optic-booking-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: var(--optic-booking-width, 480px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: #2d3748;
}

/* Header */
.ob-header {
    background: linear-gradient(135deg, var(--optic-chat-primary, #268CCD) 0%, var(--optic-chat-secondary, #1a6ba3) 100%);
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ob-title {
    font-weight: 600;
    font-size: 17px;
}

.ob-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ob-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Body */
.ob-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ob-body::-webkit-scrollbar {
    width: 5px;
}

.ob-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

/* Footer */
.ob-footer {
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    background: #fafafa;
}

/* Buttons */
.ob-btn {
    padding: 10px 22px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ob-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ob-btn-next,
.ob-btn-submit {
    background: linear-gradient(135deg, var(--optic-chat-primary, #268CCD) 0%, var(--optic-chat-secondary, #1a6ba3) 100%);
    color: var(--optic-chat-button-text, #ffffff);
    margin-left: auto;
}

.ob-btn-next:not(:disabled):hover,
.ob-btn-submit:not(:disabled):hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.ob-btn-prev {
    background: #f0f4f8;
    color: #4a5568;
}

.ob-btn-prev:hover {
    background: #e2e8f0;
}

/* ============================================================
   Calendar
   ============================================================ */
.ob-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ob-cal-month-label {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.ob-cal-nav-btn {
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ob-cal-nav-btn:hover {
    background: #e2e8f0;
}

.ob-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.ob-cal-day-name {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    padding: 4px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ob-cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.ob-cal-empty {
    background: transparent;
    cursor: default;
}

.ob-cal-unavailable {
    color: #cbd5e0;
    background: transparent;
    cursor: not-allowed;
}

.ob-cal-available {
    background: #ebf8f0;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.ob-cal-available:hover {
    background: #9ae6b4;
    color: #276749;
}

.ob-cal-selected {
    background: var(--optic-chat-primary, #268CCD) !important;
    color: #ffffff !important;
    border-color: var(--optic-chat-primary, #268CCD) !important;
}

.ob-selected-date {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

/* ============================================================
   Time Slots
   ============================================================ */
.ob-slots-title {
    font-weight: 600;
    margin: 0 0 14px;
    color: #2d3748;
}

.ob-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.ob-slot-btn {
    padding: 10px 6px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8f9fb;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ob-slot-btn:hover {
    border-color: var(--optic-chat-primary, #268CCD);
    color: var(--optic-chat-primary, #268CCD);
    background: #ebf5fb;
}

.ob-slot-selected {
    border-color: var(--optic-chat-primary, #268CCD) !important;
    background: var(--optic-chat-primary, #268CCD) !important;
    color: #ffffff !important;
}

/* ============================================================
   Contact Form
   ============================================================ */
.ob-form-summary {
    background: #ebf5fb;
    border: 1px solid #bee3f8;
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    color: #2c5282;
    margin: 0 0 16px;
}

.ob-field {
    margin-bottom: 14px;
}

.ob-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
}

.ob-field input,
.ob-field select,
.ob-field textarea {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    color: #2d3748;
    background: #f8f9fb;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.ob-field input:focus,
.ob-field select:focus,
.ob-field textarea:focus {
    border-color: var(--optic-chat-primary, #268CCD);
    background: #ffffff;
}

.ob-field textarea {
    resize: vertical;
    min-height: 72px;
}

.ob-form-error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    display: block;
}

.ob-form-error:empty {
    display: none;
}

/* ============================================================
   Confirmation Screen
   ============================================================ */
.ob-confirm {
    text-align: center;
    padding: 24px 16px;
}

.ob-confirm-icon {
    font-size: 52px;
    margin-bottom: 12px;
}

.ob-confirm h3 {
    font-size: 20px;
    font-weight: 700;
    color: #276749;
    margin: 0 0 10px;
}

.ob-confirm p {
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 8px;
}

/* ============================================================
   Loader
   ============================================================ */
.ob-loader {
    text-align: center;
    padding: 24px;
    color: #718096;
    font-size: 14px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 520px) {
    #optic-booking-modal {
        max-height: 100vh;
        border-radius: 0;
    }

    #optic-booking-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .ob-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================
   Calendar / Provider Selection Step
   ============================================================ */
.ob-section-title {
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
    margin: 0 0 16px;
    text-align: center;
}

.ob-calendar-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 4px 0 8px;
}

.ob-calendar-btn {
    padding: 14px 10px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    line-height: 1.3;
}

.ob-calendar-btn:hover {
    border-color: var(--optic-chat-primary, #268CCD);
    background: #f0f8ff;
}

.ob-calendar-btn.ob-calendar-selected {
    border-color: var(--optic-chat-primary, #268CCD);
    background: var(--optic-chat-primary, #268CCD);
    color: #ffffff;
}

.ob-calendar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--optic-chat-primary, #268CCD);
    margin: 0 0 12px;
    text-align: center;
}

/* ============================================================
   Chat Booking Result Card
   ============================================================ */
.booking-result-card {
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.booking-result-success {
    background: #f0fff4;
    border: 1px solid #9ae6b4;
    color: #276749;
}

.booking-result-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.booking-result-icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.booking-result-details {
    flex: 1;
}

.booking-result-details p {
    margin: 2px 0;
}

.booking-result-msg {
    margin-bottom: 6px !important;
}
