:root {
    --mosk-orange: #FD7E14;
    --bs-primary:       #FD7E14;
    --bs-primary-rgb:   253, 126, 20;
}
html, body { width:100%; height:100%; overflow:hidden; background:var(--bs-body-bg) !important; margin:0; padding:0; }
#map { position:fixed; inset:0; z-index:0; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: rgba(var(--bs-body-color-rgb), 0.2); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* Leaflet zoom controls styling - sağ altta, custom butonların solunda */
.leaflet-control-zoom {
    border: 1px solid rgba(var(--bs-border-color-rgb), 0.7) !important;
    border-radius: 8px !important;
    overflow: hidden;
    margin-right: 76px !important; /* Ev+konum butonlarının soluna */
    margin-bottom: 15px !important;
}
.leaflet-control-zoom a {
    background: rgba(var(--bs-body-bg-rgb), 0.92) !important;
    color: rgba(var(--bs-body-color-rgb), 0.85) !important;
    border-bottom: 1px solid rgba(var(--bs-border-color-rgb), 0.7) !important;
}
.leaflet-control-zoom a:hover {
    background: rgba(var(--bs-body-color-rgb), 0.06) !important;
}

/* Koordinat göstergesi - zoom butonlarının solunda durması için right değerini 130px yaptık */
#coords-pill {
    position: fixed;
    bottom: 20px;
    right: 130px;
    z-index: 1000;
}

@media (max-width:767px) {
    #coords-pill { display:none !important; }
    .leaflet-control-zoom { display: none !important; }
}

.glass-panel {
    backdrop-filter:blur(16px) saturate(1.4);
    background:rgba(var(--bs-body-bg-rgb), 0.90) !important;
    border:1px solid rgba(var(--bs-border-color-rgb), 0.70) !important;
    color:var(--bs-body-color);
}

.btn-primary, .bg-primary, .badge.bg-primary, .bg-gradient-primary { background-color:var(--mosk-orange) !important; border-color:var(--mosk-orange) !important; }
.text-primary  { color:var(--mosk-orange) !important; }
.border-primary { border-color:var(--mosk-orange) !important; }
.form-check-input:checked { background-color:var(--mosk-orange) !important; border-color:var(--mosk-orange) !important; }
.accordion-button:focus { box-shadow:none !important; }

.floating-card { position:fixed; top:58px; right:14px; width:320px; max-height:calc(100vh - 200px); transition:transform .3s cubic-bezier(.4,0,.2,1), opacity .25s; }
.floating-card.card-hidden { transform:translateX(calc(100% + 20px)); opacity:0; pointer-events:none; }
@media (max-width:767px) {
    .floating-card { top:70px !important; right:12px !important; width:280px !important; max-width:calc(100vw - 24px) !important; max-height:45vh !important; border-radius:12px !important; z-index:1049 !important; }
    .floating-card.card-hidden { transform:translateX(20px) !important; opacity:0 !important; }
    .floating-card .card-body { max-height:calc(45vh - 80px); overflow-y:auto; }
}
@media (min-width:768px) { .floating-card { width:320px; } }

.layer-item { border-left:3px solid transparent; transition:all .15s; }
.layer-item:hover { background:rgba(253,126,20,.08) !important; border-left-color:var(--mosk-orange) !important; }
.chart-bar-row { transition:background .2s, opacity .18s ease, transform .18s ease, box-shadow .18s ease; cursor:pointer; }
.chart-bar-row:hover { background:rgba(var(--bs-body-color-rgb), .04) !important; }
#bar-chart.has-active .chart-bar-row:not(.chart-bar-row-active) { opacity:.52; }
.chart-bar-row.chart-bar-row-active {
    opacity:1 !important;
    transform:translateY(-1px);
    box-shadow:0 0 0 2px rgba(var(--bs-primary-rgb), .22);
}
.nearby-item { transition:all .2s; cursor:pointer; }
.nearby-item:hover { background:rgba(253,126,20,.1) !important; border-color:var(--mosk-orange) !important; }

#bm-bar-container { position:relative; }
.bm-item { cursor:pointer; transition:all .2s; padding:.25rem; border-radius:6px; }
.bm-item:hover { background:rgba(var(--bs-body-color-rgb), .08); }
.bm-item.active { background:rgba(253,126,20,.2); border:1px solid var(--mosk-orange); }
.bm-thumb { width:48px; height:48px; object-fit:cover; border-radius:4px; border-width:2px !important; border-color:rgba(var(--bs-body-color-rgb), .18); transition:all .2s; }
.bm-item:hover .bm-thumb { border-color:rgba(var(--bs-body-color-rgb), .35) !important; transform:translateY(-2px); }
.bm-item.active .bm-thumb { border-color:var(--mosk-orange) !important; box-shadow:0 0 0 1px var(--mosk-orange), 0 0 12px rgba(253,126,20,.3); }

/* POI resim ikonları (svg/png) — font ikonlarla aynı hizada/kutu içinde dursun */
.poi-ikon { display:inline-flex; object-fit:contain; vertical-align:middle; flex-shrink:0; }

.map-marker { width:40px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:50%; cursor:pointer; transition:box-shadow .2s, background-color .2s; font-size:20px; box-shadow:0 1px 4px rgba(0,0,0,.35); }
.map-marker:hover { box-shadow:0 0 8px rgba(var(--rgb-color,253,126,20),.4); }
.map-marker.active { box-shadow:0 0 0 3px rgba(var(--rgb-color,253,126,20),.3), 0 0 16px rgba(var(--rgb-color,253,126,20),.6); animation:glow-pulse 1.5s ease-in-out infinite; }
@keyframes glow-pulse {
    0%,100% { box-shadow:0 0 0 3px rgba(var(--rgb-color,253,126,20),.3), 0 0 16px rgba(var(--rgb-color,253,126,20),.6); }
    50%      { box-shadow:0 0 0 6px rgba(var(--rgb-color,253,126,20),.4), 0 0 24px rgba(var(--rgb-color,253,126,20),.8); }
}

/* Marker wrapper with label (altında, minimal stil) */
.marker-wrapper {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
    cursor:pointer;
}
.marker-label {
    color:var(--bs-body-color);
    font-size:10px;
    font-weight:700;
    white-space:nowrap;
    pointer-events:none;
    text-shadow:
        -1px -1px 0 rgba(var(--bs-body-bg-rgb), 1),
        1px -1px 0 rgba(var(--bs-body-bg-rgb), 1),
        -1px 1px 0 rgba(var(--bs-body-bg-rgb), 1),
        1px 1px 0 rgba(var(--bs-body-bg-rgb), 1),
        0 0 4px rgba(var(--bs-body-bg-rgb), 1),
        0 0 8px rgba(var(--bs-body-bg-rgb), 0.9),
        0 2px 3px rgba(0,0,0,0.4);
}
/* Spiderfied (ikili açılım) durumunda label'ları gizle */
.marker-cluster-spider .marker-label {
    display: none !important;
}


/* Top-center citizen UI */
#top-center-ui {
    position:fixed;
    top:14px;
    left:50%;
    transform:translateX(-50%);
    z-index:1050;
    width:min(420px, calc(100vw - 24px));
    transition: width .22s ease;
}
#top-center-ui.expanded { width:min(760px, calc(100vw - 24px)); }
#top-center-ui-row { display:flex; align-items:center; gap:8px; }
#top-center-ui .search-wrap { padding:10px 12px; border-radius:999px; }
#search-inline-wrap {
    flex: 1 1 auto;
    min-width: 0;
}
#search-inline-wrap .search-input-wrap {
    background: rgba(var(--bs-body-bg-rgb), .35);
    border: 1px solid rgba(var(--bs-border-color-rgb), .65);
    border-radius: 999px;
    min-height: 34px;
    padding-inline: 8px;
}
#btn-nearest {
    min-width: 124px;
    height: 42px;
    font-size: .82rem;
    white-space: nowrap;
    color: #fff !important;
    background: linear-gradient(180deg, #ff9a3d, var(--mosk-orange)) !important;
    border: 1px solid #e2740e !important;
    box-shadow: 0 6px 16px rgba(253, 126, 20, .36), inset 0 0 0 1px rgba(255,255,255,.15);
}
#btn-nearest i {
    font-size: 1.1rem;
    line-height: 1;
}
#btn-nearest:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}
#btn-nearest.nearby-active {
    box-shadow: 0 0 0 3px rgba(253,126,20,.30), 0 8px 20px rgba(253,126,20,.40);
}
#listModal.nearby-mode .modal-content { border: 1px solid rgba(var(--bs-border-color-rgb), .75); }
#listModal.nearby-mode .nearby-setup-card { background: rgba(var(--bs-body-bg-rgb), .72); border-color: rgba(var(--bs-border-color-rgb), .75) !important; }
#listModal.nearby-mode .quick-action-chip { min-height: 32px; }
#listModal.nearby-mode #nearby-results {
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 2px;
}
#listModal.nearby-mode .modal-dialog { max-width: min(780px, calc(100vw - 28px)); }
#listModal.nearby-mode #list-modal-body { max-height: 82vh !important; }
#listModal.nearby-mode .card-body { padding: .75rem .9rem; }
#top-center-ui:not(.expanded) #search-suggestions { display:none !important; }
#top-center-ui:not(.expanded) #btn-search-reset { display:none !important; }

/* Web & Mobil: Arama kapalıyken Yakındakiler butonu - Sadece İkon */
#top-center-ui:not(.expanded) #btn-nearest {
    min-width: 42px !important;
    width: 42px !important;
    padding-inline: 0 !important;
    justify-content: center;
}
#top-center-ui:not(.expanded) #btn-nearest i {
    display: block !important;
    margin: 0 !important;
}
#top-center-ui:not(.expanded) #btn-nearest span {
    display: none !important;
}
#btn-search-reset {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 999px;
    padding: 0;
}

/* İkon Kayma ve Merkezleme Kesin Çözümü (Samsung/Android Fix) */
.material-icons {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    font-size: 20px;
    user-select: none;
}

/* İkonları barındıran kapsayıcıların esnekliği */
.btn, .map-marker, .s-ico, .avatar, .accordion-button {
    display: inline-flex;
    align-items: center;
}

/* Çarpı butonu gibi spesifik ikon butonlarının merkezlenmesi */
#btn-search-reset {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#btn-search-reset i {
    margin: 0 !important;
    padding: 0 !important;
}

/* YENİ: Altın Sarısı Favoriler Butonu */
.btn-outline-gold {
    color: #fff !important; /* Yandex gibi metin her zaman beyaz */
    border-color: #FFC107 !important;
    background: transparent;
}
.btn-outline-gold:hover {
    background: #FFC107 !important;
    color: #111827 !important; /* Üzerine gelince siyahımsı olsun ki okunsun */
    border-color: #FFC107 !important;
}

/* YENİ: Turuncu Kent Rehberi Butonu */
.btn-outline-orange {
    color: #fff !important; /* Yandex gibi metin her zaman beyaz */
    border-color: var(--mosk-orange) !important;
    background: transparent;
}
.btn-outline-orange:hover {
    background: var(--mosk-orange) !important;
    color: #fff !important;
    border-color: var(--mosk-orange) !important;
}

#top-center-ui .search-input {
    border:none !important;
    background:transparent !important;
    color:var(--bs-body-color) !important;
    outline:none !important;
    box-shadow:none !important;
}
#top-center-ui .search-input::placeholder { color:rgba(var(--bs-body-color-rgb), .55); }
#top-center-ui .btn { line-height: 1.2; }
#quick-filters {
    margin-top:10px;
    display:flex;
    gap:8px;
    overflow-x:auto;
    padding-bottom:6px;
    -webkit-overflow-scrolling:touch;
    cursor: grab;
    user-select: none;
    /* Kaydırılabilir olduğunu belli eden kenar fade ipucu (sağ kenar daha belirgin = "devamı var") */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 26px), transparent 100%);
}
#quick-filters .btn {
    font-size: .78rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
    color: var(--bs-body-color) !important;
    border-color: rgba(var(--bs-border-color-rgb), .72) !important;
    background: rgba(var(--bs-body-bg-rgb), .72) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--bs-body-color-rgb), .06);
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}
#quick-filters .btn.quick-filter-active {
    opacity: 1 !important;
    transform: translateY(-1px);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), .28), inset 0 0 0 1px rgba(var(--bs-primary-rgb), .16);
}
#quick-filters.has-active .btn:not(.quick-filter-active) {
    opacity: .52;
}
#quick-filters .btn .text-truncate { max-width: 140px !important; }
#quick-filters::-webkit-scrollbar { height:6px; }
#quick-filters::-webkit-scrollbar-thumb { background:rgba(var(--bs-body-color-rgb), .32); border-radius:4px; }
#quick-filters::-webkit-scrollbar-thumb:hover { background:rgba(var(--bs-body-color-rgb), .5); }

/* Search suggestions dropdown */
#search-suggestions {
    margin-top: 8px;
    display: none;
    padding: 8px;
    border-radius: 12px;
    max-height: 260px;
    overflow: auto;
}
#search-suggestions.show { display: block; }
#search-suggestions .s-group-title {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: rgba(var(--bs-body-color-rgb), .55);
    padding: 2px 6px 6px; margin-top: 2px;
}
#search-suggestions .s-group-title:not(:first-child) {
    margin-top: 8px; border-top: 1px solid rgba(var(--bs-border-color-rgb), .5); padding-top: 8px;
}
#search-suggestions .s-item {
    width: 100%;
    text-align: left;
    border-radius: 10px;
    padding: 10px 10px;
    min-height: 44px;
    border: 1px solid rgba(var(--bs-border-color-rgb), 0.65);
    background: rgba(var(--bs-body-bg-rgb), 0.65);
    color: var(--bs-body-color);
}
#search-suggestions .s-item:hover { background: rgba(var(--bs-body-bg-rgb), 0.90); }
#search-suggestions .s-meta { color: rgba(var(--bs-body-color-rgb), 0.65); font-size: .75rem; }
#search-suggestions .s-ico { width: 28px; height: 28px; border-radius: 999px; display:flex; align-items:center; justify-content:center; background: rgba(var(--bs-body-color-rgb), .06); }
@media (max-width:767px) {
    /* Mobile: search sits below municipality brand pill */
    #top-center-ui {
        top: 64px;
        left: 10px;
        transform: none;
        width: 170px; /* Daha minik ve kibar başlangıç boyutu */
        z-index: 1061;
    }
    #top-center-ui.expanded { width: calc(100vw - 20px); }
    #top-center-ui .search-wrap { padding: 6px 8px; }
    #top-center-ui-row { gap: 6px; }

    /* Kapalı haldeki Yakındakiler butonu - Tam Yuvarlak ve İkonlu */
    #btn-nearest {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }
    #btn-nearest i {
        font-size: 1.1rem !important;
        display: flex !important;
        margin: 0 !important;
    }
    #btn-nearest span {
        display: none !important;
    }

    /* Açık haldeki (expanded) Yakındakiler butonu - Hap Şeklinde ve Sadece Yazı */
    #top-center-ui.expanded #btn-nearest {
        min-width: auto !important;
        width: auto !important;
        height: 36px !important;
        padding-inline: 14px !important;
        border-radius: 999px !important;
    }
    #top-center-ui.expanded #btn-nearest i {
        display: none !important;
    }
    #top-center-ui.expanded #btn-nearest span {
        display: inline-block !important;
        margin-left: 0 !important;
        font-size: 0.75rem !important;
    }

    /* Diğer modal mobil kuralları aynen kalsın */
    #listModal.nearby-mode .quick-action-chip { min-height: 34px; font-size: .72rem; }
    #listModal.nearby-mode .modal-dialog { max-width: calc(100vw - 18px); }
    #listModal.nearby-mode #list-modal-body { max-height: 78vh !important; }
    #listModal.nearby-mode #nearby-results { max-height: 38vh; }
    body.mobile-panels-open #quick-filters,
    body.mobile-panels-open #search-suggestions { display:none !important; }
    body.mobile-panels-open #top-center-ui { opacity:.96; }
}

/* Theme-aware FAB */
.btn-fab {
    background: rgba(var(--bs-body-bg-rgb), 0.92);
    border: 1px solid rgba(var(--bs-border-color-rgb), 0.90);
    color: var(--bs-body-color);
}
.btn-fab:hover {
    background: rgba(var(--bs-body-bg-rgb), 1);
    border-color: rgba(var(--bs-border-color-rgb), 1);
}
.btn-fab { min-height: 38px; }

/* Toast-like status */
#status-toast {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1066;
    display: none;
    max-width: min(92vw, 500px);
}
#status-toast.show { display: block; }

@media (max-width:767px) {
    .modal-content { font-size:.85rem; }
    .modal-title   { font-size:.95rem !important; }
    .modal-body .row .col-6, .modal-body .row .col-12 { font-size:.8rem; }
    .modal-body h6 { font-size:.85rem !important; }
    /* Liste modal kart kompakt */
    #list-modal-body .card-header { padding:.5rem .7rem !important; }
    #list-modal-body .card-body   { padding:.5rem .7rem !important; }
    #list-modal-body .card        { margin-bottom:.6rem !important; }
    /* Prevent overlap with bottom action bar */
    #mobile-view-bm-group {
        right: 16px !important;
        bottom: calc(16px + env(safe-area-inset-bottom)) !important;
        margin: 0 !important;
    }
    #coords-pill {
        right: 4px !important;
        bottom: calc(86px + env(safe-area-inset-bottom)) !important;
        display: none !important;
    }
    #brand-pill {
        top: 10px !important;
        left: 10px !important;
        margin: 0 !important;
        z-index: 1063 !important;
    }
    #brand-pill #bp-name { max-width: 170px !important; }
    #fab-container {
        top: 10px !important;
        right: 10px !important;
        margin: 0 !important;
        z-index: 1063 !important;
    }
    #card-layers.floating-card, #card-panel.floating-card {
        top: 64px !important;
        right: 12px !important;
        width: 290px !important;
        max-width: calc(100vw - 24px) !important;

        /* Dış çerçevenin maksimum boyu */
        max-height: calc(100vh - 210px) !important;
        z-index: 1064 !important;
    }

    /* İŞTE EKSİK OLAN KISIM: İçerik alanının da (scroll) uzamasına izin vermeliyiz! */
    #card-layers.floating-card .card-body,
    #card-panel.floating-card .card-body {
        /* Başlık (header) payını düşerek iç kısmı da dibine kadar esnetiyoruz */
        max-height: calc(100vh - 170px) !important;
    }
}

/* Summary panel orange accent */
#card-panel .card-header {
    border-bottom-color: rgba(var(--bs-primary-rgb), .45) !important;
}
#card-panel .summary-card {
    border: 1px solid rgba(var(--bs-border-color-rgb), .7);
    background: rgba(var(--bs-body-bg-rgb), .86);
    box-shadow: inset 0 0 0 1px rgba(var(--bs-primary-rgb), .14);
}
#card-panel .summary-card .summary-value {
    color: var(--bs-body-color);
}
.mosk-footer-badge {
    height: 14px;
    width: auto;
    object-fit: contain;
    opacity: 0.80;
    transition: opacity 0.2s;
}
.mosk-footer-link {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}
.mosk-footer-link:hover .mosk-footer-badge {
    opacity: 1;
}
@media (max-width:767px) {
    .mosk-footer-link {
        left: 8px !important;
        bottom: 8px !important;
        margin: 0 !important;
    }
    .mosk-footer-badge {
        height: 11px;
    }
}
.detail-action-row {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
}
.detail-action-row .btn,
.detail-action-row > a {
    flex: 1 1 0;
    min-height: 38px;
    border-radius: 999px;
    padding-inline: .85rem;
    box-shadow: inset 0 0 0 1px rgba(var(--bs-primary-rgb), .08);
    justify-content: center;
    white-space: nowrap;
    transition: all .2s ease;
}
@media (max-width:767px) {
    .detail-action-row {
        gap: .35rem;
    }
    .detail-action-row .btn,
    .detail-action-row > a {
        min-height: 36px;
        padding-inline: .5rem;
        font-size: 0.75rem;
    }
    .detail-action-row i {
        font-size: 1rem;
    }
}
.detail-action-row .btn:hover,
.detail-action-row > a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .25);
}
.detail-action-row .btn-outline-primary:hover {
    background: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}
.detail-action-row .btn-outline-danger:hover {
    background: var(--bs-danger);
    color: #fff;
    border-color: var(--bs-danger);
}
.detail-section-label {
    font-weight: 700;
    letter-spacing: .02em;
}

/* ── Street View (Google Maps Embed iframe) ── */
#streetViewModal .modal-content { overflow: hidden; }
.street-view-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}
.street-view-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
@media (max-width: 575.98px) {
    .street-view-wrap { aspect-ratio: 3 / 4; }
}
