/* Harita sayfasına özel stiller: yüzen katman paneli, araç çubuğu, toast'lar. */

.harita-wrap {
    position: relative;
}

#harita-map {
    height: calc(100vh - 170px);
    min-height: 480px;
    width: 100%;
    border-radius: .5rem;
    background: #dde3e8;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}

/* ---- Araç çubuğu (üst) ---- */
.harita-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: .75rem;
}

.harita-toolbar .form-select {
    min-width: 200px;
}

/* ---- Ortak "yüzen panel" kartı (katman paneli + sağdaki sorgu paneli bunu paylaşıyor) ---- */
.harita-panel {
    width: 270px;
    background: rgba(255,255,255,.97);
    border-radius: .5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    font-size: .875rem;
}

/* ---- Sol üstteki yüzen paneller (Katmanlar + POI Katmanları) — elle konumlandırılıyor
       (Leaflet kontrolü değil), tek bir dikey yığın (stack) içinde alt alta diziliyor, böylece
       Katmanlar panelinin yüksekliği değiştikçe (katman sayısına/açık-kapalı durumuna göre)
       altındaki POI Katmanları paneli otomatik kayar — piksel hesabı elle yapılmıyor. ---- */
.harita-panel-stack {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100% - 24px);
}

.harita-panel-stack .harita-panel-body {
    max-height: 38vh;
    overflow-y: auto;
}

/* ---- POI Katmanları paneli — kategori rozeti (renkli daire + kısaltma harfi) ---- */
.harita-poi-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .65rem;
    flex-shrink: 0;
}

/* "+" (kategoriye yeni nokta ekle) o an aktifken vurgulanır */
.harita-layer-actions button.active {
    color: #0d6efd;
}

/* Aktif çizim hedefi olarak seçili POI satırı */
.harita-poi-row-active {
    background: #e7f1ff;
    border-radius: .35rem;
}

/* Haritadaki POI noktası ikonu (kategori rengi + kısaltma harfi, div ikon olarak) */
.harita-poi-marker-icon {
    background: transparent;
    border: none;
}

.harita-poi-marker-icon span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: .7rem;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.45);
}

/* ---- Sağdaki Sorgu paneli — bir Leaflet kontrolü olarak eklendi, konumu Leaflet'in
       topright köşe kapsayıcısı tarafından (diğer kontrollerin altına) otomatik veriliyor ---- */
.harita-query-panel-control {
    max-height: min(70vh, 520px);
    overflow-y: auto;
}

/* ---- Sağ alttaki Hava Durumu paneli — bir Leaflet kontrolü, Silvan/Diyarbakır için anlık/dinamik ---- */
.harita-weather-panel {
    width: 240px;
}

/* Başlıkta ikon + sıcaklık da göründüğü için (kapalıyken bile görünür kalsın diye)
   diğer panel başlıklarına göre biraz daha küçük yazı tipi kullanılıyor. */
.harita-weather-panel .harita-panel-header {
    font-size: .8rem;
    gap: .4rem;
}

.harita-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .75rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.harita-panel-body {
    padding: .5rem .75rem .75rem;
}

.harita-panel.collapsed .harita-panel-body {
    display: none;
}

.harita-layer-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
    border-bottom: 1px dashed #eee;
}

.harita-layer-row:last-child {
    border-bottom: none;
}

.harita-layer-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.15);
}

.harita-layer-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.harita-layer-count {
    font-size: .75rem;
    color: #6c757d;
}

.harita-layer-actions button {
    border: none;
    background: transparent;
    color: #6c757d;
    padding: 0 .2rem;
    font-size: .95rem;
    line-height: 1;
}

.harita-layer-actions button:hover {
    color: #0d6efd;
}

.harita-panel-footer {
    padding: .5rem .75rem;
    border-top: 1px solid #e9ecef;
}

/* ---- Fare koordinatı kontrolü ---- */
.harita-coords {
    background: rgba(255,255,255,.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ---- Ölçüm sonucu balonu ---- */
.harita-olcum-sonuc {
    background: #212529;
    color: #fff;
    padding: .35rem .6rem;
    border-radius: .35rem;
    font-size: .8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* ---- Toast konteyneri ---- */
.harita-toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 2000;
}

/* ---- Leaflet popup içindeki aksiyon butonları ---- */
.harita-popup-actions {
    margin-top: .4rem;
    display: flex;
    gap: .4rem;
}

.harita-popup-actions button {
    font-size: .75rem;
    padding: .15rem .5rem;
}

/* ---- İçe aktarılan geçici katman bildirimi ---- */
.harita-import-banner {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    max-width: 280px;
}

/* ---- Alt öznitelik tablosu (haritanın altına yüzen çekmece) ---- */
.harita-attr-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    height: 280px;
    max-height: 60%;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -4px 16px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
}

.harita-attr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.harita-attr-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: .5rem .75rem;
}

.harita-attr-body table.dataTable tbody tr {
    cursor: pointer;
}

.harita-attr-body table.dataTable tbody tr:hover {
    background-color: rgba(13, 110, 253, .06);
}

/* ---- Nesne düzenleme penceresindeki görsel küçük resimleri ---- */
.harita-image-thumb {
    position: relative;
    width: 90px;
}

.harita-image-thumb img {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: .3rem;
    border: 1px solid #dee2e6;
    display: block;
}

.harita-image-thumb .harita-image-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    line-height: 1;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: #fff;
    font-size: .7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.harita-image-thumb .harita-image-remove:hover {
    background: #bb2d3b;
}

/* ---- Tam ekran modu ---- */
.harita-wrap:fullscreen,
.harita-wrap:-webkit-full-screen {
    background: #fff;
    padding: 10px;
}

.harita-wrap:fullscreen #harita-map,
.harita-wrap:-webkit-full-screen #harita-map {
    height: 100vh;
}
