/* ========================================
   Filter Panel — Modern Premium Design
   ======================================== */

/* ── Panel Container ── */
.fp-panel {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 28px;
    box-shadow: 0 4px 24px rgba(15,23,42,0.07);
    border: 1px solid rgba(5,150,105,0.1);
    overflow: hidden;
    position: relative;
}
.fp-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary, #059669), #0ea5e9, var(--primary, #059669));
    background-size: 200% 100%;
    animation: fp-gradient 4s ease infinite;
}
@keyframes fp-gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ── Panel Header (mobile toggle) ── */
.fp-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: linear-gradient(135deg, #f0fdf4, #ecfeff);
}
.fp-header-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    display: flex;
    align-items: center;
    gap: 8px;
}
.fp-header-title i {
    color: var(--primary, #059669);
}
.fp-header-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary, #059669);
    color: #fff;
    min-width: 20px;
    text-align: center;
}
.fp-header-toggle {
    font-size: 18px;
    color: var(--gray, #64748b);
    transition: transform 0.3s;
}
.fp-panel.fp-open .fp-header-toggle {
    transform: rotate(180deg);
}

/* ── Panel Body ── */
.fp-body {
    padding: 20px 22px;
}

/* ── Filter Grid ── */
.fp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

/* ── Filter Group (each filter) ── */
.fp-group {
    flex: 1;
    min-width: 170px;
    position: relative;
}
.fp-group--search {
    flex: 2;
    min-width: 240px;
}
.fp-group--btn {
    flex: 0 0 auto;
    min-width: auto;
}

/* Label */
.fp-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray, #64748b);
    margin-bottom: 6px;
}
.fp-label i {
    margin-right: 3px;
    font-size: 11px;
}

/* Input Wrapper */
.fp-input-wrap {
    display: flex;
    align-items: center;
    background: var(--off-white, #f8fafc);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 0 12px;
    transition: all 0.25s ease;
    position: relative;
}
.fp-input-wrap:hover {
    border-color: rgba(5,150,105,0.3);
    background: #fff;
}
.fp-input-wrap:focus-within {
    border-color: var(--primary, #059669);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
    background: #fff;
}
.fp-input-wrap > i {
    font-size: 14px;
    color: var(--gray, #64748b);
    flex-shrink: 0;
    margin-right: 8px;
    transition: color 0.2s;
}
.fp-input-wrap:focus-within > i {
    color: var(--primary, #059669);
}

/* Text Input */
.fp-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 0;
    font-size: 0.88rem;
    color: var(--text, #1e293b);
}
.fp-input::placeholder {
    color: var(--text-light, #94a3b8);
}

/* Select */
.fp-select {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 24px 10px 0;
    font-size: 0.88rem;
    color: var(--text, #1e293b);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.fp-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--gray, #64748b);
    font-size: 12px;
}

/* Search Button */
.fp-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--primary, #059669), #047857);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}
.fp-search-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46);
    box-shadow: 0 4px 16px rgba(5,150,105,0.35);
    transform: translateY(-1px);
}
.fp-search-btn:active {
    transform: translateY(0);
}
.fp-search-btn i {
    font-size: 14px;
}

/* ── Quick Filters (alphabet / popular pills) ── */
.fp-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border, #e2e8f0);
}
.fp-quick-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}
.fp-quick-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: #f0fdf4;
    color: var(--primary, #059669);
    border: 1px solid rgba(5,150,105,0.2);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.fp-quick-pill:hover {
    background: var(--primary, #059669);
    color: #fff;
    border-color: var(--primary, #059669);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(5,150,105,0.2);
}
.fp-quick-pill.active {
    background: var(--primary, #059669);
    color: #fff;
    border-color: var(--primary, #059669);
}
.fp-quick-pill i {
    font-size: 11px;
}

/* ── Active Tags ── */
.fp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 14px 22px;
    background: linear-gradient(135deg, #f0fdf4, #ecfeff);
    border-top: 1px solid rgba(5,150,105,0.08);
}
.fp-tags-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray, #64748b);
    margin-right: 4px;
}
.fp-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #fff;
    color: var(--primary, #059669);
    border: 1px solid rgba(5,150,105,0.25);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fp-tag:hover {
    background: #fef2f2;
    color: #dc3545;
    border-color: rgba(220,53,69,0.3);
    text-decoration: none;
}
.fp-tag .bi-x-circle-fill {
    font-size: 12px;
    opacity: 0.7;
}
.fp-tag:hover .bi-x-circle-fill {
    opacity: 1;
}
.fp-clear {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    background: transparent;
    color: #dc3545;
    border: 1px dashed rgba(220,53,69,0.35);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: auto;
}
.fp-clear:hover {
    background: #fef2f2;
    border-style: solid;
    text-decoration: none;
    color: #dc3545;
}

/* ── Result Count ── */
.fp-result-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-light, #64748b);
    margin-bottom: 24px;
    font-weight: 500;
}
.fp-result-count strong {
    color: var(--text, #1e293b);
    font-weight: 700;
}
.fp-result-count i {
    color: var(--primary, #059669);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .fp-header {
        display: flex;
    }
    .fp-body {
        padding: 16px;
        display: none;
    }
    .fp-panel.fp-open .fp-body {
        display: block;
    }
    .fp-grid {
        flex-direction: column;
        gap: 12px;
    }
    .fp-group {
        min-width: 100%;
    }
    .fp-group--search {
        min-width: 100%;
    }
    .fp-search-btn {
        width: 100%;
        justify-content: center;
    }
    .fp-tags {
        padding: 12px 16px;
    }
    .fp-quick {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .fp-quick::-webkit-scrollbar { display: none; }
}
@media (max-width: 576px) {
    .fp-panel {
        border-radius: 12px;
        margin-left: -4px;
        margin-right: -4px;
    }
}
