/* Reset / Base */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; background: #f5f5f5; color: #222; overflow-y: hidden; }

.app-loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-loading__spinner {
    width: 3rem;
    height: 3rem;
    color: #6F3AF2;
}

/* Blazor's default error banner - hidden until Blazor's runtime JS explicitly shows it on an unhandled error */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 0 10px 0 rgba(0,0,0,0.5);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* App wrapper - fixed viewport height so only the main content area scrolls */
.app-wrapper { display: flex; flex-direction: column; height: 100vh; }

/* Header */
.app-header {
    background: #fff;
    color: #222;
    padding: 0 24px;
    height: 52px;
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 500;
}

/* Header left zone */
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-title { font-size: 22px; font-weight: 700; letter-spacing: 0.4px; color: #1c1c1c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-right { display: flex; align-items: center; flex: 0 0 auto; min-width: 0; }

.oem-logo-link { display: inline-flex; align-items: center; margin-left: 15px; text-decoration: none; }
.header-logo { height: 32px; width: auto; display: block; }
.header-logo--byd { height: 46px; }
.header-logo--nextlane { height: 24px; max-width: 150px; object-fit: contain; margin-left: 4px; }

/* Main - the only scrollable region, so a window that is too short gets a scrollbar here
   instead of clipping the content */
.app-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-gutter: auto; max-width: 1400px; width: 100%; margin: 0 auto; padding: 14px 16px; }

/* Language dropdown */
.lang-dropdown { position: relative; margin-right: 12px; user-select: none; }
.lang-dropdown__trigger { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; background: #fff; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; font-size: 13px; color: #333; height: 30px; min-width: 130px; transition: border-color 0.15s; }
.lang-dropdown__trigger:hover, .lang-dropdown--open .lang-dropdown__trigger { border-color: #0066cc; }
.lang-dropdown__flag { width: 24px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.lang-dropdown__label { flex: 1; text-align: left; }
.lang-dropdown__caret { font-size: 10px; color: #888; }
.lang-dropdown__menu { position: absolute; top: calc(100% + 4px); right: 0; background: #fff; border: 1px solid #ccc; border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 200; min-width: 140px; overflow: hidden; }
.lang-dropdown__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px; background: none; border: none; cursor: pointer; font-size: 13px; color: #333; }
.lang-dropdown__item:hover { background: #f0f4ff; }
.lang-dropdown__item--active { background: #e6eeff; font-weight: 600; }

/* Handbook button */
.handbook-btn { background: none; border: none; padding: 0; margin-right: 15px; cursor: pointer; color: #444; display: inline-flex; align-items: center; line-height: 1; }
.handbook-btn svg, .handbook-btn .b-icon, .handbook-btn i { width: 18px; height: 18px; font-size: 18px; }
.handbook-btn:hover { color: #000; }

/* Handbook modal */
.handbook-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.handbook-modal { background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.22); width: 700px; max-width: 95vw; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.handbook-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #e0e0e0; background: #f7f4ff; }
.handbook-modal-title { font-size: 17px; font-weight: 700; color: #6F3AF2; }
.handbook-modal-close { background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer; color: #666; padding: 0 4px; border-radius: 4px; }
.handbook-modal-close:hover { color: #c00; background: #fff0f0; }
.handbook-modal-body { padding: 24px 32px; overflow-y: auto; }
.handbook-modal-body section { margin-bottom: 20px; }
.handbook-modal-body h2 { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: #1c1c1c; }
.handbook-modal-body p { margin: 0; line-height: 1.6; color: #444; font-size: 13px; }

/* Panel (reserved for the future portal UI story) */
.panel { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; color: #6F3AF2; }
.booking-heading-hint { color: #222; font-size: 14px; font-weight: 400; }
.booking-remark-panel { margin-top: 16px; width: 100%; }
.booking-remark-label { display: block; margin-bottom: 6px; font-weight: 700; color: #333; }
.booking-remark-input { display: block; width: 100%; min-width: 0; border: 1px solid #bbb; border-radius: 5px; padding: 8px 10px; font: inherit; color: #222; white-space: nowrap; overflow-x: auto; text-overflow: clip; }
.booking-remark-input:focus { outline: 2px solid rgba(111,58,242,0.25); border-color: #6F3AF2; }

/* Customer/vehicle row - spans the same width as the availability panel below it and both
   panels shrink/grow together with the window */
.details-row { display: flex; gap: 16px; }
.details-row .panel { flex: 1 1 0; min-width: 0; margin-bottom: 16px; }
@media (max-width: 700px) {
    .details-row { flex-direction: column; gap: 0; }
}

/* Drop-off/pickup selection - two equal columns on desktop, stacked on narrow screens. */
.booking-slots-row { display: flex; gap: 16px; align-items: flex-start; }
.booking-slot-panel { flex: 1 1 0; min-width: 0; }
@media (max-width: 900px) {
    .booking-slots-row { flex-direction: column; gap: 0; }
    .booking-slot-panel { width: 100%; }
}

/* Booking action bar - stays pinned to the bottom of the scroll area, button horizontally centred */
.booking-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 10px 0;
    background: linear-gradient(to bottom, rgba(245,245,245,0), #f5f5f5 40%);
}
.booking-btn {
    background: #6F3AF2;
    border: 1px solid #6F3AF2;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 40px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(111,58,242,0.25);
}
.booking-btn:hover:not(:disabled) { background: #5a2ecc; border-color: #5a2ecc; }
.booking-btn:disabled { background: #c9c9c9; border-color: #c9c9c9; color: #fff; cursor: not-allowed; box-shadow: none; }
.booking-btn--secondary { background: #6F3AF2; border: 1px solid #6F3AF2; color: #fff; }
.booking-btn--secondary:hover:not(:disabled) { background: #5a2ecc; border-color: #5a2ecc; color: #fff; }

.greeting { font-size: 15px; font-weight: 600; color: #1c1c1c; }

.booking-confirmation-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.booking-confirmation-modal { background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.22); width: 560px; max-width: 100%; overflow: hidden; }
.booking-progress-modal { background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.22); width: 320px; max-width: 100%; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.booking-progress-modal p { margin: 0; font-weight: 600; color: #333; }
.booking-confirmation-header { padding: 16px 24px; border-bottom: 1px solid #e0e0e0; background: #f7f4ff; }
.booking-confirmation-header--error { background: #fff0f0; }
.booking-confirmation-header h2 { margin: 0; color: #6F3AF2; font-size: 17px; font-weight: 700; }
.booking-confirmation-header--error h2 { color: #c00; }
.booking-confirmation-body { padding: 20px 24px; }
.booking-confirmation-details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 16px 0 0; }
.booking-confirmation-details dt { font-weight: 700; color: #333; }
.booking-confirmation-details dd { margin: 0; color: #222; }
.booking-customer-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 16px; }
.booking-customer-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; color: #333; }
.booking-customer-input { border: 1px solid #bbb; border-radius: 5px; padding: 8px 10px; font: inherit; font-weight: 400; color: #222; }
.booking-customer-input:focus { outline: 2px solid rgba(111,58,242,0.25); border-color: #6F3AF2; }
.booking-confirmation-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid #e0e0e0; }
.booking-confirmation-btn { border-radius: 6px; font-size: 14px; font-weight: 600; padding: 9px 20px; cursor: pointer; }
.booking-confirmation-btn--primary { background: #6F3AF2; border: 1px solid #6F3AF2; color: #fff; }
.booking-confirmation-btn--secondary { background: #fff; border: 1px solid #bbb; color: #333; }
.booking-confirmation-btn--danger { background: #c00; border: 1px solid #c00; color: #fff; }
.booking-confirmation-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Messages */
.error-msg { color: #c00; background: #fff0f0; border: 1px solid #faa; border-radius: 4px; padding: 8px 12px; }
.info-msg { color: #555; }
.booking-error-alert { margin-bottom: 16px; }

/* Service-advisor day/timeslot picker */
.ts-picker { width: 100%; }
.ts-picker--disabled { opacity: 0.65; }
.ts-picker__layout { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.ts-picker__timeslots { width: 100%; min-width: 0; }
.ts-picker__section-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: #111; }
.ts-picker__date-carousel { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ts-picker__carousel-btn { flex: 0 0 auto; width: 24px; height: 48px; border: none; background: transparent; color: #111; font-size: 32px; line-height: 1; cursor: pointer; }
.ts-picker__carousel-btn:disabled { color: #d6d6d6; cursor: not-allowed; }
.ts-picker__date-cards { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, minmax(72px, 1fr)); gap: 8px; min-width: 0; }
.ts-picker__date-card { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70px; padding: 8px 6px; border: none; border-radius: 7px; background: #f3f4f6; color: #111; cursor: pointer; }
.ts-picker__date-card:hover { background: #edf4fc; }
.ts-picker__date-card--selected { background: #6F3AF2; color: #fff; box-shadow: 0 0 0 2px #4f22c8 inset, 0 3px 10px rgba(111,58,242,0.28); }
.ts-picker__date-card--selected:hover { background: #5a2ecc; color: #fff; }
.ts-picker__date-card-day,
.ts-picker__date-card-date { font-size: 15px; font-weight: 700; line-height: 1.2; }
.ts-picker__date-card-count { margin-top: 4px; font-size: 13px; line-height: 1.2; }
.ts-picker__selected-date { margin: 0 0 10px; font-size: 16px; color: #333; font-weight: 700; }
.ts-picker__timeslot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-picker__timeslot-btn { min-width: 76px; background: #f3f4f6; border: none; border-radius: 7px; padding: 9px 12px; font-size: 14px; cursor: pointer; color: #111; }
.ts-picker__timeslot-btn:hover { background: #edf4fc; }
.ts-picker__timeslot-btn--selected { background: #6F3AF2; color: #fff; font-weight: 700; box-shadow: 0 0 0 2px #4f22c8 inset, 0 3px 10px rgba(111,58,242,0.28); }
.ts-picker__timeslot-btn--selected:hover { background: #5a2ecc; color: #fff; }
@media (max-width: 1200px) {
    .ts-picker__date-cards { grid-template-columns: repeat(2, minmax(72px, 1fr)); }
}
@media (max-width: 700px) {
    .booking-customer-form { grid-template-columns: 1fr; }
    .ts-picker__date-carousel { gap: 6px; }
    .ts-picker__date-cards { grid-template-columns: repeat(2, minmax(70px, 1fr)); gap: 8px; }
    .ts-picker__carousel-btn { width: 22px; font-size: 30px; }
    .ts-picker__timeslot-btn { min-width: 72px; }
}
