/**
 * Booking Forms Styles - Professional Layout
 * Prefix: bkf- (booking forms)
 * Version: 2.0
 */

/* ── Dynamic CSS Variables (overridable from admin settings via inline style) ── */
:root {
    --bkf-primary:            #ff6b35;
    --bkf-primary-dark:       #e55a28;
    --bkf-primary-light:      rgba(255, 107, 53, 0.12);
    --bkf-radius:             10px;
    --bkf-tab-radius:         10px;
    --bkf-btn-text:           #ffffff;
    --bkf-font:               -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Tab vars — all controlled exclusively by Tab Design settings */
    --bkf-tab-active-bg:      #ff6b35;
    --bkf-tab-active-text:    #ffffff;
    --bkf-tab-inactive-bg:    #f0f0f0;
    --bkf-tab-inactive-text:  #555555;
    --bkf-tab-font-size:      14px;
    --bkf-tab-font-weight:    600;
    /* Label font vars */
    --bkf-trip-label-fs:      13px;
    --bkf-trip-label-fw:      600;
    --bkf-field-label-fs:     13px;
    --bkf-field-label-fw:     600;
}

/* ── Container ── */
.bkf-container {
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: var(--bkf-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.09);
    overflow: hidden;
    font-family: var(--bkf-font);
    border: 1px solid #e8ecf0;
}

/* ── Tabs ── */
.bkf-tabs {
    display: flex;
    background: var(--bkf-tab-inactive-bg, #f0f0f0);
    border-bottom: 2px solid var(--bkf-tab-active-bg, #ff6b35);
    padding: 0 20px;
    gap: 4px;
}

.bkf-tab-btn {
    flex: 0 0 auto;
    padding: 14px 30px !important;
    background: var(--bkf-tab-inactive-bg, #f0f0f0);
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--bkf-tab-inactive-text, #555555);
    font-size: var(--bkf-tab-font-size, 14px);
    font-weight: var(--bkf-tab-font-weight, 600);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    border-radius: var(--bkf-tab-radius, 8px) var(--bkf-tab-radius, 8px) 0 0;
    letter-spacing: 0.1px;
}

/* ── Tab hover: use active colors, no opacity blending ── */
.bkf-tab-btn:hover {
    background: var(--bkf-tab-active-bg, #ff6b35);
    color: var(--bkf-tab-active-text, #ffffff);
    border-bottom-color: var(--bkf-tab-active-bg, #ff6b35);
}

.bkf-tab-btn.bkf-active {
    background: var(--bkf-tab-active-bg, #ff6b35);
    color: var(--bkf-tab-active-text, #ffffff);
    border-bottom-color: var(--bkf-tab-active-bg, #ff6b35);
}

/* ── Tab Style Variants (driven by data-tab-style attribute on .bkf-container) ── */

/* Underline style */
.bkf-container[data-tab-style="underline"] .bkf-tabs {
    background: transparent;
    border-bottom: 2px solid var(--bkf-tab-inactive-bg, #e0e4ea);
    padding: 0 20px;
}
.bkf-container[data-tab-style="underline"] .bkf-tab-btn {
    background: transparent !important;
    color: var(--bkf-tab-inactive-text, #555555);
    border-radius: 0;
    border-bottom: 3px solid transparent;
}
.bkf-container[data-tab-style="underline"] .bkf-tab-btn:hover,
.bkf-container[data-tab-style="underline"] .bkf-tab-btn.bkf-active {
    background: transparent !important;
    color: var(--bkf-tab-active-bg, #ff6b35);
    border-bottom-color: var(--bkf-tab-active-bg, #ff6b35);
}

/* Solid Block style */
.bkf-container[data-tab-style="solid"] .bkf-tabs {
    background: var(--bkf-tab-inactive-bg, #f0f0f0);
    border-bottom: none;
    padding: 8px 16px;
    gap: 2px;
}
.bkf-container[data-tab-style="solid"] .bkf-tab-btn {
    border-radius: 4px !important;
    border-bottom: none;
    margin-bottom: 0;
}
.bkf-container[data-tab-style="solid"] .bkf-tab-btn:hover,
.bkf-container[data-tab-style="solid"] .bkf-tab-btn.bkf-active {
    border-bottom: none;
}

/* Outline / Ghost style */
.bkf-container[data-tab-style="outline"] .bkf-tabs {
    background: transparent;
    border-bottom: 2px solid var(--bkf-tab-inactive-bg, #e0e4ea);
    padding: 0 20px;
    gap: 6px;
}
.bkf-container[data-tab-style="outline"] .bkf-tab-btn {
    background: transparent !important;
    color: var(--bkf-tab-inactive-text, #555555);
    border: 2px solid var(--bkf-tab-inactive-bg, #e0e4ea) !important;
    border-bottom: 2px solid transparent !important;
    border-radius: var(--bkf-tab-radius, 8px) var(--bkf-tab-radius, 8px) 0 0;
    margin-bottom: -2px;
}
.bkf-container[data-tab-style="outline"] .bkf-tab-btn:hover,
.bkf-container[data-tab-style="outline"] .bkf-tab-btn.bkf-active {
    background: var(--bkf-tab-active-bg, #ff6b35) !important;
    color: var(--bkf-tab-active-text, #ffffff);
    border-color: var(--bkf-tab-active-bg, #ff6b35) !important;
    border-bottom-color: transparent !important;
}

.bkf-tab-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* ── Tab Content ── */
.bkf-tab-content {
    display: none;
    padding: 28px 32px;
    animation: bkfFadeIn 0.22s ease;
}

.bkf-tab-content.bkf-active { display: block; }

@keyframes bkfFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Notifications ── */
.bkf-notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-radius: 7px;
    margin-bottom: 22px;
    font-weight: 500;
    font-size: 14px;
    animation: bkfSlideDown 0.3s ease;
}

@keyframes bkfSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bkf-notification.bkf-success {
    background: #eafaf2;
    color: #146c43;
    border: 1px solid #b7e4cb;
}

.bkf-notification.bkf-error {
    background: #fdf2f2;
    color: #9b1c1c;
    border: 1px solid #f5c6cb;
}

.bkf-notification svg { flex-shrink: 0; }

/* ── Form Layout ── */
.bkf-form { max-width: 100%; }

.bkf-section-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    margin: 25px 0 18px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bkf-primary, #ff6b35);
    display: inline-block;
}
.bkf-section-title:first-child { margin-top: 0; }

.bkf-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.bkf-trip-type-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eeeeee;
}

.bkf-row {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

/* ── Radio ── */
.bkf-radio-container { display: flex; flex-direction: column; gap: 8px; }

.bkf-radio-container > label {
    margin-bottom: 0;
    font-weight: var(--bkf-trip-label-fw, 600);
    color: #444;
    font-size: var(--bkf-trip-label-fs, 13px);
    text-transform: capitalize;
    letter-spacing: 0.2px;
}

.bkf-radio-group { display: flex; gap: 20px; align-items: center; }

.bkf-radio-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.bkf-radio-label input[type="radio"] {
    width: 17px; height: 17px;
    cursor: pointer; margin: 0;
    accent-color: var(--bkf-primary);
}

.bkf-radio-label span { user-select: none; }

/* ── Field Sizes ── */
.bkf-field         { flex: 1;   min-width: 180px; position: relative; }
.bkf-field-small   { flex: 0 0 100px; min-width: 100px; }
.bkf-field-medium  { flex: 1.2; min-width: 200px; }
.bkf-field-wide    { flex: 2;   min-width: 280px; }

.bkf-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: var(--bkf-field-label-fw, 600);
    color: #444;
    font-size: var(--bkf-field-label-fs, 13px);
    text-transform: capitalize;
    letter-spacing: 0.2px;
}

/* ── Input with Icon ── */
.bkf-input-icon { position: relative; display: flex; align-items: center; }

.bkf-input-icon svg {
    position: absolute;
    left: 12px;
    color: #b0b5bf;
    pointer-events: none;
}

.bkf-input-icon input,
.bkf-input-icon select { padding-left: 38px !important; }

/* ── Inputs / Selects / Textareas ── */
.bkf-field input,
.bkf-field select,
.bkf-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #dde2ea;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    background: #fafbfc;
    font-family: inherit;
    color: #333;
}

.bkf-field input,
.bkf-field select { height: 42px; }

.bkf-field textarea { min-height: 42px; resize: vertical; line-height: 1.5; }

.bkf-field input:focus,
.bkf-field select:focus,
.bkf-field textarea:focus {
    outline: none;
    border-color: var(--bkf-primary);
    box-shadow: 0 0 0 3px var(--bkf-primary-light);
    background: #fff;
}

.bkf-field input::placeholder,
.bkf-field textarea::placeholder { color: #b0b8c5; font-size: 13px; }

/* ── Select ── */
.bkf-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #fafbfc;
    padding-right: 35px;
}

/* ── Date ── */
.bkf-field input[type="date"] { cursor: pointer; }
.bkf-field input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; filter: opacity(0.5); }
.bkf-field input[type="date"]:hover::-webkit-calendar-picker-indicator { filter: opacity(0.85); }

/* ── Autocomplete ── */
.bkf-autocomplete { position: relative; }

.bkf-autocomplete-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #ffffff;
    border: 1.5px solid #dde2ea;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.10);
    display: none;
    margin-top: -1px;
}

.bkf-autocomplete-item {
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f2f4f7;
}

.bkf-autocomplete-item:last-child { border-bottom: none; }
.bkf-autocomplete-item:hover { background: var(--bkf-primary-light); }

.bkf-autocomplete-item strong { color: #222; font-size: 13px; display: block; font-weight: 600; }
.bkf-airport-details { font-size: 11px; color: #888; margin-top: 2px; }

/* ── Submit Button ── */
.bkf-submit {
    flex: 0 0 auto;
    padding: 11px 36px !important;
    background: var(--bkf-primary);
    color: var(--bkf-btn-text);
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: capitalize;
    height: 42px;
    margin-top: 20px;
    min-width: 160px;
    letter-spacing: 0.2px;
}

.bkf-submit:hover:not(:disabled) {
    background: var(--bkf-primary-dark);
    box-shadow: 0 4px 14px rgba(255,107,53,0.35);
    transform: translateY(-1px);
}

.bkf-submit:active:not(:disabled) { transform: scale(0.98); }
.bkf-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.bkf-btn-text, .bkf-btn-loader { display: flex; align-items: center; gap: 6px; }
.bkf-btn-loader svg { width: 18px; height: 18px; }
.bkf-spinner { animation: bkfSpin 1s linear infinite; }

@keyframes bkfSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Scrollbar ── */
.bkf-autocomplete-dropdown::-webkit-scrollbar { width: 6px; }
.bkf-autocomplete-dropdown::-webkit-scrollbar-track { background: #f5f5f5; }
.bkf-autocomplete-dropdown::-webkit-scrollbar-thumb { background: var(--bkf-primary); border-radius: 3px; }
.bkf-autocomplete-dropdown::-webkit-scrollbar-thumb:hover { background: var(--bkf-primary-dark); }

/* ── Responsive ── */
@media (max-width: 1200px) {
    .bkf-field        { flex: 1 1 calc(33.333% - 14px); min-width: 170px; }
    .bkf-field-medium { flex: 1 1 calc(50%     - 14px); }
    .bkf-field-wide   { flex: 1 1 calc(66.666% - 14px); }
}

@media (max-width: 992px) {
    .bkf-field { flex: 1 1 calc(50% - 14px); min-width: 150px; }
    .bkf-field-medium, .bkf-field-wide, .bkf-submit { flex: 1 1 100%; width: 100%; }
}

@media (max-width: 768px) {
    .bkf-tab-content { padding: 20px; }
    .bkf-row { gap: 12px; margin-bottom: 14px; }
    .bkf-field { flex: 1 1 calc(50% - 12px); min-width: 140px; }
    .bkf-field-small { flex: 1 1 calc(50% - 12px); }
    .bkf-tab-btn { padding: 11px 18px !important; font-size: 14px; }
    .bkf-field input, .bkf-field select, .bkf-field textarea { font-size: 13px; }
    .bkf-field input, .bkf-field select { height: 40px; }
    .bkf-submit { padding: 10px 24px; font-size: 14px; height: 40px; }
}

@media (max-width: 576px) {
    .bkf-tab-content { padding: 16px; }
    .bkf-field, .bkf-field-small, .bkf-field-medium, .bkf-field-wide { flex: 1 1 100%; min-width: 100%; }
    .bkf-tab-btn { flex-direction: column; gap: 3px; padding: 10px 14px !important; font-size: 13px; }
    .bkf-tab-btn svg { width: 16px; height: 16px; }
    .bkf-radio-group { flex-wrap: wrap; gap: 12px; }
}

/* ── Accessibility ── */
.bkf-submit:focus,
.bkf-field input:focus,
.bkf-field select:focus,
.bkf-field textarea:focus { outline: 2px solid var(--bkf-primary); outline-offset: 2px; }

.bkf-tab-btn:focus-visible { outline: 2px solid var(--bkf-primary); outline-offset: -2px; }
.bkf-radio-label input[type="radio"]:focus { outline: 2px solid var(--bkf-primary); outline-offset: 2px; }

@media (prefers-contrast: high) {
    .bkf-field input, .bkf-field select, .bkf-field textarea { border-width: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .bkf-container *, .bkf-container *::before, .bkf-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
