/* =============================================================================
   Trip Search Form (.tsf) — isolated, reusable Go Blue Tours search form.
   Self-contained: depends on no utility framework. Namespaced under .tsf so it
   can be dropped into any page. Fonts: Inter (body) + Montserrat (display).
   ============================================================================= */

.tsf {
    width: 100%;
    max-width: 1024px;
    margin: 0 auto;
    background: rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 16px;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, sans-serif;
}
.tsf *,
.tsf *::before,
.tsf *::after { box-sizing: border-box; }

/* ---- Layout ------------------------------------------------------------- */
.tsf-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
}
@media (min-width: 1024px) {
    .tsf-form {
        grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
        gap: 0;
    }
}

.tsf-field {
    position: relative;
    padding: 8px 16px;
}
@media (min-width: 1024px) {
    .tsf-field--divide { border-right: 1px solid rgba(255, 255, 255, 0.15); }
}

/* ---- Labels & inputs ---------------------------------------------------- */
.tsf-label {
    display: block;
    margin-bottom: 4px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.tsf-input {
    width: 100%;
    background: transparent;
    border: 0;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}
.tsf-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.tsf-input[type='date'] { cursor: pointer; }
.tsf-input[type='date']::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.7; cursor: pointer; }

/* ---- Multi-select trigger ---------------------------------------------- */
.tsf-select-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.tsf-clear {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}
.tsf-clear:hover { color: #fff; }

.tsf-select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    outline: none;
}
.tsf-select-btn .tsf-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tsf-caret {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease;
}
.tsf-caret--open { transform: rotate(180deg); }

/* ---- Dropdown panel ----------------------------------------------------- */
.tsf-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 12px;
    z-index: 30;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.tsf-dropdown-list {
    max-height: 18rem;
    overflow-y: auto;
    padding: 8px 0;
}
.tsf-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.tsf-option:hover { background: #f8fafc; }
.tsf-option input[type='checkbox'] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #ff5c3a;
    cursor: pointer;
}
.tsf-option-icon {
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.tsf-option-label {
    color: #0e1116;
    font-weight: 600;
    font-size: 15px;
}
.tsf-dropdown-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 16px;
}
.tsf-foot-btn {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.tsf-foot-btn--clear { color: rgba(14, 17, 22, 0.6); }
.tsf-foot-btn--clear:hover { color: #0e1116; }
.tsf-foot-btn--done { color: #ff5c3a; }

/* ---- Selected chips (shown right below the selector) -------------------- */
.tsf-selected {
    grid-column: 1 / -1;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.tsf-selected-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.tsf-selected-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}
.tsf-selected-meta {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}
.tsf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tsf-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 9999px;
    padding: 6px 12px;
    transition: background 0.2s ease;
    animation: tsf-chip-in 0.3s ease;
}
.tsf-chip:hover { background: rgba(255, 255, 255, 0.2); }
.tsf-chip-img {
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}
.tsf-chip-name {
    color: #fff;
    font-weight: 600;
    font-size: 12px;
}
.tsf-chip-remove {
    margin-left: 4px;
    display: inline-flex;
    background: none;
    border: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease, transform 0.2s ease;
}
.tsf-chip-remove:hover { color: #fff; transform: rotate(90deg); }
.tsf-chip-remove svg { width: 14px; height: 14px; }

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

/* ---- Submit ------------------------------------------------------------- */
.tsf-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(90deg, #0057ff, #00aaff);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 16px;
    padding: 16px 28px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    transition: filter 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.tsf-submit:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}
.tsf-submit:active { transform: scale(0.95); }
.tsf-submit-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.tsf-submit-inner svg { width: 16px; height: 16px; }
