/*
 * Booking Lifecycle Management Styles
 * Copyright (c) 2026. Perun Consulting Services FZ LLE
 * Bootstrap 5 based - shared across all booking-*.html pages
 */

/* ==================== Design Tokens ==================== */

:root {
    --blm-enquiry: #0d6efd;
    --blm-quoted: #6f42c1;
    --blm-option-held: #fd7e14;
    --blm-confirmed: #198754;
    --blm-amended: #0dcaf0;
    --blm-ticketed: #6610f2;
    --blm-completed: #146c43;
    --blm-cancelled: #dc3545;
    --blm-expired: #6c757d;
}

/* Page container width is set globally in tqadmin.css (max-width: 1400px) */

/* ==================== KPI Cards ==================== */

.tq-kpi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.blm-kpi-icon {
    font-size: 1.25rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.blm-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
}

.blm-kpi-title {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blm-kpi-revenue {
    flex-direction: column;
    align-items: stretch;
}

.blm-kpi-revenue .blm-kpi-icon {
    margin-bottom: 0;
}

.blm-kpi-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    width: 100%;
    margin-top: 0.25rem;
}

.blm-kpi-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blm-kpi-row-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.blm-kpi-row-label i {
    font-size: 0.6rem;
    margin-right: 0.2rem;
}

.blm-kpi-row-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #212529;
}

/* ==================== Status Badges ==================== */

.badge-ENQUIRY      { background-color: var(--blm-enquiry) !important; color: #fff; }
.badge-QUOTED       { background-color: var(--blm-quoted) !important; color: #fff; }
.badge-OPTION_HELD  { background-color: var(--blm-option-held) !important; color: #fff; }
.badge-CONFIRMED    { background-color: var(--blm-confirmed) !important; color: #fff; }
.badge-AMENDED      { background-color: var(--blm-amended) !important; color: #212529; }
.badge-TICKETED     { background-color: var(--blm-ticketed) !important; color: #fff; }
.badge-COMPLETED    { background-color: var(--blm-completed) !important; color: #fff; }
.badge-CANCELLED    { background-color: var(--blm-cancelled) !important; color: #fff; }
.badge-EXPIRED      { background-color: var(--blm-expired) !important; color: #fff; }

/* ==================== Service Type Badges ==================== */

.svc-HOTEL      { background-color: #0d6efd; color: #fff; }
.svc-FLIGHT     { background-color: #0ea5e9; color: #fff; }
.svc-TRANSFER   { background-color: #d97706; color: #fff; }
.svc-ACTIVITY   { background-color: #198754; color: #fff; }
.svc-INSURANCE  { background-color: #6f42c1; color: #fff; }
.svc-VISA       { background-color: #6610f2; color: #fff; }
.svc-OTHER      { background-color: #6c757d; color: #fff; }

/* ==================== Status Tabs ==================== */

.blm-status-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.blm-status-tabs .nav-link:hover {
    color: var(--primary-dark);
    border-bottom-color: rgba(42, 33, 73, 0.3);
}

.blm-status-tabs .nav-link.active {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
    font-weight: 600;
}

/* ==================== Booking Table ==================== */

.booking-row {
    cursor: pointer;
    transition: background-color 0.15s;
}

.booking-row:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* ==================== Timeline ==================== */

.blm-timeline {
    position: relative;
    padding-left: 2rem;
}

.blm-timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.blm-timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.blm-timeline-item:last-child {
    padding-bottom: 0;
}

.blm-timeline-dot {
    position: absolute;
    left: -1.55rem;
    top: 0.2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-dark);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}

.blm-timeline-dot.status-change { background: var(--blm-confirmed); }
.blm-timeline-dot.note          { background: var(--blm-enquiry); }
.blm-timeline-dot.amendment     { background: var(--blm-amended); }

.blm-timeline-time {
    font-size: 0.75rem;
    color: #6c757d;
}

.blm-timeline-content {
    font-size: 0.875rem;
}

/* ==================== Service Line Cards ==================== */

.blm-service-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    background: #fff;
    transition: box-shadow 0.15s;
}

.blm-service-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.blm-service-card .card-header {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blm-service-card .card-body {
    padding: 0.75rem 1rem;
}

/* ==================== Wizard Steps ==================== */

.blm-wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0;
    list-style: none;
    counter-reset: wizard-step;
}

.blm-wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    counter-increment: wizard-step;
}

.blm-wizard-step::before {
    content: counter(wizard-step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: background 0.3s, color 0.3s;
}

.blm-wizard-step.active::before {
    background: var(--primary-dark);
    color: #fff;
}

.blm-wizard-step.completed::before {
    content: '\2713';
    background: var(--blm-confirmed);
    color: #fff;
}

.blm-wizard-step-label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blm-wizard-step.active .blm-wizard-step-label {
    color: var(--primary-dark);
    font-weight: 600;
}

.blm-wizard-step.completed .blm-wizard-step-label {
    color: var(--blm-confirmed);
}

/* Connector line between steps */
.blm-wizard-step + .blm-wizard-step::after {
    content: '';
    position: absolute;
    top: 1rem;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: -1;
}

.blm-wizard-step.completed + .blm-wizard-step::after,
.blm-wizard-step.active + .blm-wizard-step::after {
    background: var(--blm-confirmed);
}

/* ==================== Detail Header ==================== */

.blm-detail-header {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

/* ==================== Passenger Table ==================== */

.blm-pax-table .lead-radio {
    cursor: pointer;
}

.blm-pax-warning {
    color: var(--blm-option-held);
    font-size: 0.8rem;
}

/* ==================== Tab Stub Placeholder ==================== */

.blm-stub-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.blm-stub-placeholder i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

/* ==================== Totals Row ==================== */

.blm-totals-row {
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    font-weight: 600;
}

/* ==================== Checkout (M3) ==================== */

.blm-method-card {
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.blm-method-card:hover {
    border-color: #adb5bd;
}
.blm-method-card.selected {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 1px var(--primary-dark);
    background-color: rgba(42, 33, 73, 0.04);
}
.blm-method-card .blm-method-icon {
    font-size: 1.5rem;
    color: var(--primary-dark);
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}
.blm-method-card .blm-method-label {
    font-weight: 600;
    font-size: 0.9rem;
}
.blm-method-card .blm-method-desc {
    font-size: 0.78rem;
    color: #6c757d;
}
.blm-method-panel {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
}
.blm-checkout-totals td {
    padding: 0.4rem 0;
}
.blm-checkout-totals .blm-grand-total td {
    border-top: 2px solid #212529;
    padding-top: 0.6rem;
    font-size: 1.1rem;
}
.blm-order-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6c757d;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    .tq-kpi-cards {
        grid-template-columns: 1fr;
    }
    .blm-wizard-steps {
        flex-direction: column;
        gap: 0.5rem;
    }
    .blm-wizard-step + .blm-wizard-step::after {
        display: none;
    }
}

/* ==================== Template Wizard (in-modal, M5) ==================== */

.modal .blm-wizard-steps { margin-bottom: 1.25rem; font-size: 0.85rem; }
.modal .blm-wizard-step::before { width: 1.75rem; height: 1.75rem; font-size: 0.75rem; }
.modal .blm-wizard-step-label { font-size: 0.65rem; }
.modal .blm-wizard-step.clickable { cursor: pointer; }

.tpl-wizard-summary {
    background: #f0f4ff;
    border-left: 4px solid var(--primary-dark);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.tpl-wizard-section { display: none; min-height: 180px; }
.tpl-wizard-section.active { display: block; }

.tpl-section-heading { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.tpl-section-help { font-size: 0.825rem; color: #6c757d; margin-bottom: 1rem; }

.tpl-sentence-builder {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.95rem;
    line-height: 2.5;
}
.tpl-sentence-builder .form-control,
.tpl-sentence-builder .form-select { width: auto; display: inline-block; }
.tpl-sentence-builder input[type="number"] { width: 5rem; }

.tpl-deadline-example {
    background: #f8f9fa;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.825rem;
    color: #495057;
    margin-top: 0.75rem;
}

.tpl-action-code-display {
    display: inline-block;
    background: #e9ecef;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-family: SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    color: var(--primary-dark);
    margin-top: 0.5rem;
}

.tpl-creation-cards,
.tpl-assignee-cards { display: flex; flex-direction: column; gap: 0.5rem; }
.tpl-creation-cards .blm-method-card,
.tpl-assignee-cards .blm-method-card { flex: 1; }

.tpl-result-field-row {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.tpl-field-key-hint { font-size: 0.7rem; color: #adb5bd; font-family: monospace; }
.tpl-type-toggle .btn { padding: 0.2rem 0.45rem; font-size: 0.75rem; }
.tpl-type-toggle .btn.active { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }

.tpl-condition-panel { margin-top: 0.75rem; padding: 0.75rem; background: #f8f9fa; border-radius: 0.5rem; }
