/*
 * ListDoctorFilterCss.css
 * Doktor Listesi — Filtre Paneli Unified Tasarım
 * Desktop (#filterArea) + Mobile (#offcanvasFilterPanel) aynı tasarım
 *
 * Renk referansları: /avartis-nova/assets/css/general-variables.css
 *   --av-inner-btn-bg      : #2b697d  → primary teal
 *   --av-inner-btn-hover-bg: #245e71  → hover teal
 *   --av-inner-btn-shadow  : rgba(43,105,125,0.35) → shadow (alpha ayarlı kullanılır)
 *   --av-inner-bg-subtle   : #f4f9fb  → çok hafif teal arka plan
 *   --av-inner-border      : #dce9ed  → hafif teal kenarlık
 *   --av-rating-star       : #f5a623  → puan yıldızı
 *   --av-sidebar-color     : #2b697d  → sidebar/filtre ana rengi (--av-inner-btn-bg ile aynı)
 */

/* =============================================
   0. STICKY FİLTRE PANEL (sadece desktop)
============================================= */

@media only screen and (min-width: 992px) {
    #filterArea {
        position: sticky;
        top: calc(var(--av-header-height, 80px) + 16px);
        align-self: flex-start;
    }
}

/* =============================================
   1. TEMEL KART YAPISI — .filter-new override
============================================= */

#filterArea .filter-new,
#offcanvasFilterPanel .filter-new {
    background: #fff;
    border: 1px solid var(--av-inner-border);
    border-radius: 10px;
    padding: 0;
    margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(43, 105, 125, 0.07);
    overflow: hidden;
}

/* =============================================
   2. BAŞLIK ALANI — .filter-header override
============================================= */

#filterArea .filter-header,
#offcanvasFilterPanel .filter-header {
    padding: 11px 14px;
    border-bottom: 1px solid var(--av-inner-border);
    background: var(--av-inner-bg-subtle);
    position: relative;
}

/* Global CSS'teki sol accent çizgisini kaldır */
#filterArea .filter-header::before,
#offcanvasFilterPanel .filter-header::before {
    display: none;
}

#filterArea .filter-header h4,
#offcanvasFilterPanel .filter-header h4 {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--av-sidebar-color);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    line-height: 1.4;
}

.refresh-search-form {
    font-size: 10.5px;
    font-weight: 500;
    color: #9bb5bd;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    flex-shrink: 0;
}

.refresh-search-form:hover {
    color: #c0392b;
}

.refresh-search-form u {
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

/* =============================================
   3. WIDGET ALANI — .filter-widget override
============================================= */

#filterArea .filter-new .filter-widget,
#offcanvasFilterPanel .filter-new .filter-widget {
    padding: 10px 14px 12px;
}

/* =============================================
   4. CHECKBOX GRUBU (Kurum, Hastane, Puan)
============================================= */

#filterArea .filter-checkbox .custom_check,
#offcanvasFilterPanel .filter-checkbox .custom_check {
    font-size: 13px;
    color: #495a63;
    padding-left: 25px;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    line-height: 1.4;
    top: 0;
}

#filterArea .filter-checkbox .custom_check .checkmark,
#offcanvasFilterPanel .filter-checkbox .custom_check .checkmark {
    width: 15px;
    height: 15px;
    border: 1.5px solid #b3cdd5;
    border-radius: 3px;
    background: var(--av-inner-bg-subtle);
    top: 2px;
    /* FA ikonunu merkeze kilitle */
    display: flex;
    align-items: center;
    justify-content: center;
}

#filterArea .filter-checkbox .custom_check input:checked ~ .checkmark,
#offcanvasFilterPanel .filter-checkbox .custom_check input:checked ~ .checkmark {
    background: var(--av-inner-btn-bg);
    border-color: var(--av-inner-btn-bg);
}

#filterArea .filter-checkbox .custom_check .checkmark::after,
#offcanvasFilterPanel .filter-checkbox .custom_check .checkmark::after {
    color: #fff;
    /* position: absolute override — flex container içinde statik konum */
    position: static;
    font-size: 10px;
    line-height: 1;
}

/* =============================================
   5. PUAN FİLTRESİ — Yıldızlar
============================================= */

#filterArea .filter-checkbox .rating i,
#offcanvasFilterPanel .filter-checkbox .rating i {
    font-size: 13px;
    color: #dde2e6;
}

#filterArea .filter-checkbox .rating i.filled,
#offcanvasFilterPanel .filter-checkbox .rating i.filled {
    color: var(--av-rating-star);
}

/* =============================================
   6. KONUM FİLTRESİ — Input
============================================= */

#filterArea .filter-location .form-control,
#offcanvasFilterPanel .filter-location .form-control {
    border: 1px solid var(--av-inner-border);
    border-radius: 7px;
    font-size: 13px;
    padding: 8px 12px;
    color: #444;
    background: var(--av-inner-bg-subtle);
    transition: border-color 0.15s, box-shadow 0.15s;
}

#filterArea .filter-location .form-control:focus,
#offcanvasFilterPanel .filter-location .form-control:focus {
    border-color: var(--av-inner-btn-bg);
    box-shadow: 0 0 0 3px rgba(43, 105, 125, 0.12);
    background: #fff;
    outline: none;
}

/* =============================================
   7. BRANŞ PICKER
   (filter-new içinde kart-içi kart etkisi olmaması
    için border/shadow kaldırıldı, başlıkla bütünleşiyor)
============================================= */

#filterArea .branch-picker-wrapper,
#offcanvasFilterPanel .branch-picker-wrapper {
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

#filterArea .branch-picker,
#offcanvasFilterPanel .branch-picker {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
}

/* Arama çubuğu */
#filterArea .branch-picker-search,
#offcanvasFilterPanel .branch-picker-search {
    padding: 9px 14px;
    border-bottom: 1px solid var(--av-inner-border);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

#filterArea .branch-picker-search > i,
#offcanvasFilterPanel .branch-picker-search > i {
    color: #b5ccd3;
    font-size: 12px;
    flex-shrink: 0;
}

.branch-search-input {
    border: none !important;
    outline: none !important;
    width: 100%;
    font-size: 13px;
    color: #444;
    background: transparent;
    box-shadow: none !important;
    padding: 0 !important;
}

.branch-search-input::placeholder {
    color: #b5ccd3;
}

/* Seçili sayaç bar */
.branch-selected-bar {
    display: flex;
    align-items: center;
    padding: 5px 14px;
    background: var(--av-inner-bg-subtle);
    border-bottom: 1px solid var(--av-inner-border);
    font-size: 12px;
}

.branch-selected-text {
    color: var(--av-sidebar-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.branch-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--av-inner-btn-bg);
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

/* Ağaç container */
.branch-tree-container {
    max-height: 370px;
    overflow-y: auto;
}

.branch-tree-container::-webkit-scrollbar { width: 4px; }
.branch-tree-container::-webkit-scrollbar-track { background: var(--av-inner-bg-subtle); }
.branch-tree-container::-webkit-scrollbar-thumb { background: #bfd5dc; border-radius: 4px; }

/* Ana kategori satırı */
.branch-group {
    border-bottom: 1px solid #f0f5f7;
}

.branch-group:last-child { border-bottom: none; }

.branch-group-header {
    display: flex;
    align-items: center;
    padding: 9px 10px 9px 14px;
    transition: background 0.12s;
}

.branch-group-header:hover { background: var(--av-inner-bg-subtle); }
.branch-group-header.has-selection {
    background: var(--av-inner-bg-subtle);
}

.branch-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
    user-select: none;
}

.branch-parent-cb {
    width: 15px !important;
    height: 15px !important;
    accent-color: var(--av-inner-btn-bg);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 !important;
}

.branch-group-name { flex: 1; line-height: 1.3; }

/* Alt kategori sayaç badge */
.branch-child-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--av-inner-btn-bg);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Accordion toggle butonu */
.branch-toggle-btn {
    background: none;
    border: none;
    padding: 3px 5px;
    cursor: pointer;
    color: #a8c5ce;
    font-size: 10px;
    line-height: 1;
    transition: transform 0.2s ease, color 0.15s;
    flex-shrink: 0;
    border-radius: 4px;
}

.branch-toggle-btn:hover {
    color: var(--av-inner-btn-bg);
    background: var(--av-inner-bg-subtle);
}

.branch-group.is-expanded > .branch-group-header .branch-toggle-btn {
    transform: rotate(90deg);
    color: var(--av-inner-btn-bg);
}

/* Alt kategoriler container */
.branch-children-container {
    background: var(--av-inner-bg-subtle);
    border-top: 1px solid var(--av-inner-border);
    padding: 3px 0;
}

/* Alt kategori satırı */
.branch-child-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 34px;
    cursor: pointer;
    font-size: 12.5px;
    color: #536878;
    margin: 0;
    transition: background 0.1s;
    width: 100%;
    user-select: none;
    line-height: 1.3;
}

.branch-child-item:hover {
    background: var(--av-inner-bg-subtle);
    color: var(--av-inner-btn-bg);
}

.branch-child-cb {
    width: 14px !important;
    height: 14px !important;
    accent-color: var(--av-inner-btn-bg);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0 !important;
}

/* Arama filtresiyle gizlenenler */
.branch-group.branch-hidden { display: none; }
.branch-child-item.branch-hidden { display: none; }

/* Sonuç bulunamadı mesajı */
.branch-no-results {
    padding: 20px 16px;
    text-align: center;
    font-size: 12.5px;
    color: #8a9ea6;
    line-height: 1.5;
}

/* =============================================
   8. MOBİL OFFCANVAS
============================================= */

@media only screen and (max-width: 768px) {
    #offcanvasFilterPanel {
        max-width: 100% !important;
        background: var(--av-inner-bg-subtle);
    }

    #offcanvasFilterPanel .filter-new {
        margin-bottom: 10px;
    }
}
