/* SMART Bookings v1.2 */

/* ---- Widget container ---- */
.smartbk-widget, .smartbk-calendar-widget { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 600px; margin: 0 auto; }
.smartbk-error { padding: 15px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; color: #856404; }

/* ---- Steps ---- */
.smartbk-step, .smartbk-popup-step { display: none; }
.smartbk-step.smartbk-active, .smartbk-popup-step.smartbk-active { display: block; }
.smartbk-title { font-size: 1.3em; font-weight: 600; margin: 0 0 16px 0; }

/* ---- Forms ---- */
.smartbk-form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.smartbk-field { flex: 1; min-width: 140px; }
.smartbk-field-full { flex: 1 1 100%; }
.smartbk-field label { display: block; font-weight: 600; font-size: .85em; margin-bottom: 4px; color: #333; }
.smartbk-field input, .smartbk-field select, .smartbk-field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: .95em;
    box-sizing: border-box;
}
.smartbk-field input:focus, .smartbk-field select:focus, .smartbk-field textarea:focus { border-color: #0023FF; outline: none; box-shadow: 0 0 0 2px rgba(0,35,255,.15); }
.smartbk-form-actions { justify-content: space-between; align-items: center; margin-top: 16px; }

/* ---- Buttons ---- */
.smartbk-btn { display: inline-block; padding: 10px 22px; border-radius: 6px; font-size: .95em; font-weight: 600; cursor: pointer; border: none; transition: all .2s; }
.smartbk-btn-primary { background: #0023FF; color: #fff; }
.smartbk-btn-primary:hover { background: #001bcc; }
.smartbk-btn-primary:disabled { background: #999; cursor: wait; }
.smartbk-btn-secondary { background: #f0f0f0; color: #333; }
.smartbk-btn-secondary:hover { background: #e0e0e0; }
.smartbk-btn-link { background: none; color: #0023FF; padding: 10px 0; }
.smartbk-btn-link:hover { text-decoration: underline; }

/* ---- Slots ---- */
.smartbk-slots { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.smartbk-slot {
    padding: 10px 16px; border: 2px solid #e0e0e0; border-radius: 8px; cursor: pointer;
    text-align: center; min-width: 80px; transition: all .15s;
}
.smartbk-slot:hover { border-color: #0023FF; background: #f0f4ff; }
.smartbk-slot-selected { border-color: #0023FF; background: #0023FF; color: #fff; }
.smartbk-slot-time { font-weight: 700; font-size: 1.05em; }
.smartbk-slot-avail { font-size: .75em; opacity: .7; margin-top: 2px; }
.smartbk-loading { padding: 20px; text-align: center; color: #666; }
.smartbk-no-slots { text-align: center; padding: 20px; background: #fff9e6; border-radius: 8px; margin: 12px 0; }
.smartbk-date-display, .smartbk-p-date-display { font-size: .9em; color: #555; margin-bottom: 10px; }

/* ---- Summary ---- */
.smartbk-booking-summary { background: #f8f9fa; padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9em; line-height: 1.6; }
.smartbk-deposit-notice { background: #fff3cd; padding: 10px 14px; border-radius: 6px; margin: 12px 0; font-size: .9em; }
.smartbk-hold-notice { font-size: .8em; color: #888; margin-top: 8px; }

/* ---- Booking message ---- */
.smartbk-product-message { background: #e8f4fd; border-left: 4px solid #0023FF; padding: 12px 16px; margin-bottom: 16px; border-radius: 0 6px 6px 0; font-size: .9em; line-height: 1.5; }

/* ---- Free label ---- */
.smartbk-free-label { display: inline-block; background: #6ec81b; color: #fff; padding: 4px 12px; border-radius: 4px; font-weight: 700; font-size: .9em; }

/* ---- Confirmation ---- */
.smartbk-confirmation { text-align: center; padding: 30px 0; }
.smartbk-tick { font-size: 3em; color: #6ec81b; margin-bottom: 10px; }

/* ---- Modal ---- */
.smartbk-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.smartbk-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); }
.smartbk-modal-content { position: relative; background: #fff; border-radius: 12px; padding: 30px; max-width: 480px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.smartbk-modal-large { max-width: 600px; }
.smartbk-modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.5em; cursor: pointer; color: #666; line-height: 1; }
.smartbk-modal-close:hover { color: #000; }

/* ---- Product Book Now button ---- */
.smartbk-product-book-btn { width: 100%; margin: 10px 0; font-size: 1.1em; padding: 14px; }

/* ---- Product UI: View Appointments + Selection + Book Now ---- */
.smartbk-product-ui { margin: 20px 0; }
.smartbk-product-actions { margin-bottom: 12px; }
.smartbk-view-appointments-btn { width: 100%; padding: 14px 20px; font-size: 1.05em; text-align: center; }
.smartbk-booknow-btn { width: 100%; padding: 14px 20px; font-size: 1.1em; font-weight: 700; margin-top: 10px; }

/* Popup inline calendar */
.smartbk-popup-calendar { margin-bottom: 10px; }
.smartbk-popup-calendar .smartbk-cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center;
}
.smartbk-popup-calendar .smartbk-cal-day {
    padding: 8px 4px; cursor: pointer; border-radius: 6px; font-size: .9em; position: relative;
}
.smartbk-popup-calendar .smartbk-cal-day:hover:not(.smartbk-cal-past):not(.smartbk-cal-empty) {
    background: #e8f4fd;
}
.smartbk-popup-calendar .smartbk-cal-selected {
    background: #0023FF !important; color: #fff !important; font-weight: 700;
}
.smartbk-popup-calendar .smartbk-cal-selected .smartbk-cal-day-dot { background: #fff !important; }
.smartbk-popup-calendar .smartbk-cal-today { font-weight: 700; }
.smartbk-popup-calendar .smartbk-cal-past { color: #ccc; cursor: default; }
.smartbk-popup-calendar .smartbk-cal-empty { cursor: default; }
.smartbk-popup-calendar .smartbk-cal-header { font-weight: 600; font-size: .75em; color: #888; padding: 4px; }
.smartbk-popup-calendar .smartbk-cal-nav {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.smartbk-popup-calendar .smartbk-cal-prev,
.smartbk-popup-calendar .smartbk-cal-next {
    background: none; border: 1px solid #ddd; border-radius: 4px; width: 32px; height: 32px;
    cursor: pointer; font-size: 1.2em; display: flex; align-items: center; justify-content: center;
}
.smartbk-popup-calendar .smartbk-cal-month { font-weight: 600; font-size: 1em; }

/* Selection panel */
.smartbk-selection-panel {
    background: #f0faf0; border: 2px solid #6ec81b; border-radius: 10px;
    padding: 16px 20px; margin: 16px 0;
}
.smartbk-selection-header {
    font-size: 1em; margin-bottom: 10px; color: #2a7a0a;
}
.smartbk-selection-tick { color: #6ec81b; font-size: 1.3em; margin-right: 6px; }
.smartbk-selection-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.smartbk-selection-table td { padding: 5px 8px; font-size: .95em; border-bottom: 1px solid #d4ecd4; }
.smartbk-selection-table td:first-child { width: 100px; }
.smartbk-change-link { display: inline-block; margin-top: 8px; font-size: .85em; color: #0023FF; cursor: pointer; }
.smartbk-change-link:hover { text-decoration: underline; }
.smartbk-deposit-info { font-size: .85em; color: #666; margin-top: 6px; }

/* ---- Calendar ---- */
.smartbk-calendar-widget { max-width: 320px; margin: 0 auto; }
.smartbk-cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.smartbk-cal-nav button { background: none; border: 1px solid #ddd; border-radius: 4px; padding: 4px 10px; cursor: pointer; }
.smartbk-cal-month { font-weight: 700; font-size: 1em; }
.smartbk-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.smartbk-cal-header { text-align: center; font-size: .75em; font-weight: 700; color: #666; padding: 4px; }
.smartbk-cal-day { text-align: center; padding: 6px 2px; font-size: .85em; cursor: pointer; border-radius: 6px; position: relative; }
.smartbk-cal-day:hover:not(.smartbk-cal-past):not(.smartbk-cal-empty) { background: #f0f4ff; }
.smartbk-cal-empty { cursor: default; }
.smartbk-cal-past { color: #ccc; cursor: default; }
.smartbk-cal-today { font-weight: 700; }
.smartbk-cal-selected { background: #0023FF !important; color: #fff !important; }
.smartbk-cal-day-dot { display: block; width: 6px; height: 6px; border-radius: 50%; margin: 2px auto 0; }
.smartbk-cal-day-dot { display: none; width: 6px; height: 6px; border-radius: 50%; margin: 2px auto 0; }
.smartbk-cal-available .smartbk-cal-day-dot,
.smartbk-cal-partial .smartbk-cal-day-dot,
.smartbk-cal-full .smartbk-cal-day-dot { display: block; }
.smartbk-cal-available .smartbk-cal-day-dot { background: #6ec81b; }
.smartbk-cal-partial .smartbk-cal-day-dot { background: #F9BE05; }
.smartbk-cal-full .smartbk-cal-day-dot { background: #ff0000; }
.smartbk-cal-legend { display: flex; gap: 12px; justify-content: center; margin-top: 8px; font-size: .75em; color: #666; align-items: center; }
.smartbk-cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.smartbk-cal-dot.smartbk-cal-available { background: #6ec81b; }
.smartbk-cal-dot.smartbk-cal-partial { background: #F9BE05; }
.smartbk-cal-dot.smartbk-cal-full { background: #ff0000; }

/* ---- Thank You page ---- */
.smartbk-thankyou { max-width: 600px; margin: 30px auto; text-align: center; }
.smartbk-thankyou h2 { font-size: 1.4em; }
.smartbk-thankyou-tick { font-size: 3em; color: #6ec81b; margin: 10px 0; }
.smartbk-thankyou-card { background: #f8f9fa; border-radius: 10px; padding: 20px; margin: 16px 0; text-align: left; }
.smartbk-thankyou-card h3 { margin: 0 0 12px; }
.smartbk-thankyou-table { width: 100%; border-collapse: collapse; }
.smartbk-thankyou-table td { padding: 6px 8px; border-bottom: 1px solid #eee; font-size: .9em; }
.smartbk-thankyou-confirmed { color: #6ec81b; font-weight: 700; font-size: 1.1em; margin-top: 10px; text-align: center; }

/* ---- Print ---- */
@media print { .smartbk-btn { display: none !important; } }
@media (max-width: 480px) {
    .smartbk-form-row { flex-direction: column; }
    .smartbk-slots { justify-content: center; }
}
