/* ============================================
   TEMPLATE BOOKING SECTION STYLES
   ============================================
   Scoped, embeddable clone of booking.css's proven design.
   Every rule is namespaced under .template-booking-section so this
   partial can be safely injected into index.html / tour-details pages
   without leaking .section-title / .form-label / .btn-primary etc.
   onto unrelated sections of the host page.
   Uses ONLY main.css variables - no hardcoded colours/fonts/spacing.
   ============================================ */

/* ============================================
   SECTION WRAPPER
   ============================================ */

.template-booking-section {
    background: var(--bg-primary);
    position: relative;
}

.template-booking-section .booking-form,
.template-booking-section .form-section,
.template-booking-section .form-group,
.template-booking-section .smart-helper-container,
.template-booking-section .booking-progress-wrapper {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   SMART HELPER ASSISTANT
   ============================================ */

.template-booking-section .smart-helper-container {
    max-width: 900px;
    margin: 0 auto;
}

.template-booking-section .smart-helper {
    background: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-teal) 100%);
    color: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-5) var(--spacing-6);
    display: flex;
    gap: var(--spacing-5);
    align-items: flex-start;
    box-shadow: var(--shadow-navy);
    animation: tbs-slideInDown 0.5s ease;
}

@keyframes tbs-slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.template-booking-section .helper-avatar {
    width: 50px;
    height: 50px;
    background: var(--color-white-20);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    flex-shrink: 0;
}

.template-booking-section .helper-content { flex: 1; }

.template-booking-section .helper-text {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin: 0;
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */

.template-booking-section .booking-progress-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.template-booking-section .booking-progress {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-8);
    box-shadow: var(--shadow-md);
}

.template-booking-section .progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.template-booking-section .progress-steps::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--border-secondary);
    z-index: 0;
}

.template-booking-section .step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-2);
    position: relative;
    z-index: 1;
}

.template-booking-section .step-number {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    font-size: var(--text-xl);
    border: 3px solid var(--border-secondary);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.template-booking-section .step-icon {
    font-size: var(--text-xl);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.template-booking-section .step-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    transition: all 0.3s ease;
}

.template-booking-section .step.active .step-number {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    color: var(--color-navy-deep);
    transform: scale(1.1);
}

.template-booking-section .step.active .step-icon { opacity: 1; transform: scale(1.1); }

.template-booking-section .step.active .step-label {
    color: var(--primary-orange);
    font-weight: var(--font-weight-semibold);
}

.template-booking-section .step.completed .step-number {
    background: var(--primary-teal);
    color: var(--white);
}

.template-booking-section .step.completed .step-icon { opacity: 1; }

.template-booking-section .step.completed .step-label { color: var(--primary-teal); }

/* ============================================
   BOOKING CARD
   ============================================ */

.template-booking-section .booking-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-10);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   FORM SECTIONS
   ============================================ */

.template-booking-section .form-section {
    padding: var(--spacing-8) 0;
    border-bottom: 1px solid var(--border-secondary);
}

.template-booking-section .form-section:last-child { border-bottom: none; }

.template-booking-section .form-section .section-header { margin-bottom: var(--spacing-6); text-align: left; }

.template-booking-section .form-section .section-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    margin: 0;
    font-family: var(--font-primary);
    letter-spacing: normal;
}

.template-booking-section .form-section .section-title i { color: var(--primary-orange); font-size: var(--text-xl); }

/* ============================================
   FORM LABELS
   ============================================ */

.template-booking-section .form-label {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-2);
    font-size: var(--text-sm);
}

.template-booking-section .form-label.required::after {
    content: '*';
    color: var(--primary-red);
    margin-left: var(--spacing-1);
}

.template-booking-section .label-text { display: inline-block; }

.template-booking-section .label-status {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    float: right;
}

/* ============================================
   SMART FIELD STATES
   ============================================ */

.template-booking-section .smart-field .form-control { transition: all 0.3s ease; }

.template-booking-section .smart-field .form-control.user-filled {
    border-color: var(--primary-teal);
    background: var(--teal-50);
}

.template-booking-section .smart-field .user-filled ~ .label-status { color: var(--primary-teal); }

.template-booking-section .smart-field .form-control.auto-filled {
    border-color: var(--primary-orange);
    background: var(--orange-50);
    animation: tbs-gentle-pulse 2s ease-in-out;
}

.template-booking-section .smart-field .auto-filled ~ .label-status { color: var(--primary-orange); }

@keyframes tbs-gentle-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.01); }
}

.template-booking-section .smart-field .form-control.locked {
    border-color: var(--orange-600);
    background: var(--orange-50);
}

.template-booking-section .smart-field .locked ~ .label-status { color: var(--orange-600); }

/* ============================================
   FIELD HELPERS
   ============================================ */

.template-booking-section .field-helper {
    font-size: var(--text-sm);
    color: var(--text-light);
    margin-top: var(--spacing-1);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-1);
    line-height: var(--leading-normal);
}

/* ============================================
   DURATION DISPLAY
   ============================================ */

.template-booking-section .duration-display {
    background: linear-gradient(135deg, var(--teal-50) 0%, var(--teal-100) 100%);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-5);
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    margin-top: var(--spacing-3);
}

.template-booking-section .duration-icon {
    width: 50px;
    height: 50px;
    background: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--primary-teal);
}

.template-booking-section .duration-info { flex: 1; }

.template-booking-section .duration-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-1);
}

.template-booking-section .duration-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--primary-teal);
}

/* ============================================
   FLEXIBLE DATES OPTION
   ============================================ */

.template-booking-section .flexible-dates-option {
    padding: var(--spacing-4);
    background: var(--light-bg);
    border-radius: var(--border-radius-md);
}

.template-booking-section .form-check-label i { color: var(--primary-teal); }

/* ============================================
   TOUR PICKER (LITE MODE)
   ============================================ */

.template-booking-section #tour-picker-summary { display: none; }
.template-booking-section.lite-mode #tour-picker-full { display: none; }
.template-booking-section.lite-mode #tour-picker-summary { display: block; }

.template-booking-section .selected-tour-badge {
    background: linear-gradient(135deg, var(--orange-50) 0%, var(--orange-100) 100%);
    border: 2px solid var(--orange-300);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-5);
    display: flex;
    align-items: center;
    gap: var(--spacing-4);
    flex-wrap: wrap;
}

.template-booking-section .selected-tour-icon {
    width: 56px;
    height: 56px;
    background: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    flex-shrink: 0;
}

.template-booking-section .selected-tour-info { flex: 1; min-width: 180px; }

.template-booking-section .selected-tour-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    color: var(--text-muted);
    margin-bottom: var(--spacing-1);
}

.template-booking-section .selected-tour-title {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.template-booking-section .selected-tour-duration {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

/* ============================================
   PACKAGE PREVIEW CARD
   ============================================ */

.template-booking-section .package-preview-card {
    background: linear-gradient(135deg, var(--orange-50) 0%, var(--orange-100) 100%);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-5);
    border: 2px solid var(--orange-300);
}

.template-booking-section .preview-icon {
    width: 60px;
    height: 60px;
    background: var(--white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
}

.template-booking-section .preview-title {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-1);
}

.template-booking-section .preview-duration {
    font-size: var(--text-base);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.template-booking-section .preview-description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

/* ============================================
   DURATION MISMATCH PANEL
   ============================================ */

.template-booking-section .duration-mismatch-panel .alert-warning {
    background: var(--orange-50);
    border-color: var(--orange-400);
    color: var(--text-primary);
}

.template-booking-section .mismatch-details {
    padding: var(--spacing-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-md);
}

.template-booking-section #user-dates-summary,
.template-booking-section #package-duration-summary {
    color: var(--primary-orange);
    font-weight: var(--font-weight-semibold);
}

/* ============================================
   BOOKING SUMMARY
   ============================================ */

.template-booking-section .booking-summary-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-6);
}

.template-booking-section .summary-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-5);
    text-align: center;
    border: 2px solid var(--border-secondary);
}

.template-booking-section .summary-icon { font-size: var(--text-2xl); margin-bottom: var(--spacing-2); }

.template-booking-section .summary-label {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--ls-wide);
    margin-bottom: var(--spacing-2);
}

.template-booking-section .summary-value {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-1);
}

.template-booking-section .summary-item .badge { margin-top: var(--spacing-1); }
.template-booking-section .summary-item .badge.bg-success { background: var(--primary-teal) !important; }
.template-booking-section .summary-item .badge.bg-warning { background: var(--orange-400) !important; }
.template-booking-section .summary-item .badge.bg-info    { background: var(--teal-300) !important; }

/* ============================================
   SUBMIT SECTION
   ============================================ */

.template-booking-section .btn-primary {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
    border: none;
    color: var(--color-navy-deep);
    padding: var(--spacing-4) var(--spacing-10);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
}

.template-booking-section .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-gold);
    background: linear-gradient(135deg, var(--secondary-orange) 0%, var(--primary-orange) 100%);
}

.template-booking-section .btn-primary:active { transform: translateY(0); }

.template-booking-section .btn-outline-primary {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

.template-booking-section .btn-outline-primary:hover {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--color-navy-deep);
}

.template-booking-section .trust-indicators .text-primary { color: var(--primary-orange) !important; }
.template-booking-section .trust-indicators .text-success { color: var(--primary-teal) !important; }
.template-booking-section .trust-indicators .text-danger  { color: var(--primary-red) !important; }

/* ============================================
   ALERTS
   ============================================ */

.template-booking-section .alert-success { background: var(--teal-50); border: 1px solid var(--color-success); color: var(--text-primary); }
.template-booking-section .alert-danger  { background: var(--red-50);  border: 1px solid var(--color-error);   color: var(--text-primary); }
.template-booking-section .alert-warning { background: var(--orange-50); border: 1px solid var(--color-warning); color: var(--text-primary); }
.template-booking-section .alert-info    { background: var(--teal-50); border: 1px solid var(--color-info);    color: var(--text-primary); }

/* ============================================
   FORM VALIDATION
   ============================================ */

.template-booking-section .form-control:focus,
.template-booking-section .form-select:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 0.25rem var(--color-gold-glow-sm);
}

.template-booking-section .form-control.is-invalid { border-color: var(--primary-red); }
.template-booking-section .invalid-feedback { color: var(--primary-red); }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .template-booking-section .booking-card { padding: var(--spacing-6) var(--spacing-5); }
    .template-booking-section .progress-steps { flex-wrap: wrap; gap: var(--spacing-5); }
    .template-booking-section .step-label { font-size: var(--text-xs); }
    .template-booking-section .smart-helper { flex-direction: column; text-align: center; }
    .template-booking-section .selected-tour-badge { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .template-booking-section .step-number { width: 40px; height: 40px; font-size: var(--text-base); }
    .template-booking-section .form-section .section-title { font-size: var(--text-lg); }
}
