/* ===== MODE TOGGLE SECTION ===== */
.mode-toggle-section {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
    text-align: center;
}

.mode-toggle-wrapper {
    display: inline-flex;
    background: #f5f5f5;
    border-radius: 50px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.mode-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 0;
    background: #e8e8e8;
    /* Light gray background for inactive */
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: #555;
    /* Darker gray text for visibility */
    transition: all 0.3s ease;
    position: relative;
}

.mode-btn:hover {
    background: #d8d8d8;
    /* Slightly darker on hover */
    color: #333;
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(253, 184, 19, 0.4);
}

.mode-description {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    min-height: 24px;
}

.mode-desc-strict,
.mode-desc-lax {
    transition: opacity 0.2s;
}

/* ===== FILTER BAR CONTAINER ===== */

.filter-bar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 40px;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.95);
    /* Slight glass or clean white */
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Premium shadow */
    position: relative;
    border-radius: 20px;
}

/* Dropdown Triggers (Pills) */
.filter-item {
    position: relative;
    /* This ensures dropdown is positioned relative to this item */
}

.filter-pill {
    width: 100%;
    height: 52px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    /* Consistent Radius */
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--dark);
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.filter-pill:hover,
.filter-pill.active {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(253, 184, 19, 0.15);
    background: #FFFEF9;
    /* Subtle tint */
}

.filter-pill.active {
    background: #fff;
    border-width: 2px;
}

.pill-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.pill-text {
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill-chevron {
    font-size: 0.7rem;
    margin-left: 10px;
    opacity: 0.5;
    transition: transform 0.2s;
}

.filter-pill.active .pill-chevron {
    transform: rotate(180deg);
}

/* Dropdown Panels */
.dropdown-panel {
    display: none;
    /* Hidden by default */
    position: absolute;
    top: 60px;
    /* Below pill */
    left: 0;
    width: 300px;
    /* Default width */
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 100;
    padding: 20px;
    border: 1px solid #eee;
    animation: fadeScale 0.2s ease-out;
}

.dropdown-panel.wide-panel {
    width: 400px;
}

.dropdown-panel.active {
    display: block;
}

.dropdown-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Interaction Inputs */
/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.custom-checkbox:hover {
    background: #f9f9f9;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 5px;
    margin-right: 12px;
    position: relative;
    border: 1px solid #ddd;
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

.custom-checkbox .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Custom Radio */
.custom-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.custom-radio:hover {
    background: #f9f9f9;
}

.custom-radio input {
    position: absolute;
    opacity: 0;
}

.radio-mark {
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 50%;
    margin-right: 12px;
    border: 1px solid #ddd;
    position: relative;
}

.custom-radio input:checked~.radio-mark {
    border-color: var(--primary);
    background: white;
}

.radio-mark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-radio input:checked~.radio-mark:after {
    display: block;
    top: 4px;
    left: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
}

/* Option List (Destination) */
.option-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.option-list li {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.95rem;
}

.option-list li:hover {
    background: #f5f5f5;
}

.option-list li.selected {
    background: #FFFEF9;
    /* Tint */
    color: var(--dark);
    font-weight: 700;
    border-left: 3px solid var(--primary);
}

/* Chips Toggle (Priority) */
.priority-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-toggle {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-toggle:hover {
    border-color: #bbb;
}

.chip-toggle.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(253, 184, 19, 0.4);
}

/* Footer Close Button */
.dropdown-footer {
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
    padding-top: 10px;
    text-align: right;
}

/* CTA Button */
.big-cta {
    padding: 16px 60px;
    font-size: 1.1rem;
    border-radius: 12px;
    font-weight: 800;
    box-shadow: 0 8px 25px rgba(253, 184, 19, 0.4);
    transition: transform 0.2s;
}

.big-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(253, 184, 19, 0.5);
}

/* Microcopy */
.microcopy {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Animation */
@keyframes fadeScale {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Grid System */
@media (max-width: 1024px) {

    /* Tablet: 2x2 Grid + Destination on top full width? 
       Req says "2 columns x 2 rows". 
       We have 5 items. 
       Let's do Destination full width, then 2x2 grid for others. */
    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .filter-item:nth-child(1) {
        /* Destination */
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {

    /* Mobile: Stacked */
    .filter-bar {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 12px;
    }

    .dropdown-panel {
        position: fixed;
        /* Bottom sheet behavior or fixed center */
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        border: none;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
        animation: slideUp 0.3s ease-out;
        max-height: 80vh;
        overflow-y: auto;
    }

    .dropdown-panel.wide-panel {
        width: 100%;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }
}