/* ========================================================================== */
/* YALIN HARİTA SİSTEMİ - TAM VE GÜNCEL STİL DOSYASI (STYLE.CSS)              */
/* ========================================================================== */

body, html { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: #111; 
    overflow: hidden; 
}

#map { width: 100%; height: 100%; z-index: 1; }

/* Harita opaklığı düşürüldüğünde alttan gri değil, bembeyaz bir fon görünmesi için */
.leaflet-container { background: #ffffff !important; }

/* ========================================= */
/* HARİTA ARAYÜZ (HUD) ELEMANLARI            */
/* ========================================= */

#crosshair { 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    font-size: 40px; 
    font-weight: bold; 
    color: rgba(220, 53, 69, 0.8); 
    pointer-events: none; 
    z-index: 998; 
}

#adminGearBtn { 
    position: absolute; 
    bottom: 30px; 
    left: 15px; 
    z-index: 1000; 
    background: #fff; 
    border: 1px solid #ddd; 
    border-radius: 6px; 
    width: 40px; 
    height: 40px; 
    font-size: 20px; 
    cursor: pointer; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2); 
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden { display: none !important; }

#overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.6); 
    z-index: 999; 
}

/* ========================================= */
/* MODAL & YÖNETİM PANELLERİ (PROFESYONEL UI)*/
/* ========================================= */

.modal { 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: #fff; 
    padding: 15px 20px; 
    border-radius: 8px; 
    z-index: 1000; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); 
}

.modal-header { 
    margin: 0 0 15px 0; 
    font-size: 15px; 
    color: #222; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 8px; 
}

.admin-section { 
    background: #f8f9fa; 
    border: 1px solid #e9ecef; 
    padding: 10px; 
    border-radius: 6px; 
    margin-bottom: 10px; 
}

.section-title { margin: 0 0 8px 0; font-size: 12px; color: #555; text-transform: uppercase; letter-spacing: 0.5px; }

.form-input { 
    width: 100%; padding: 6px 8px; border: 1px solid #ccc; 
    border-radius: 4px; font-size: 12px; font-family: inherit; 
    box-sizing: border-box; margin-bottom: 8px; outline: none; 
}
.form-input:focus { border-color: #007bff; }

.modal label { display: block; font-size: 11px; color: #666; margin-bottom: 3px; font-weight: 600; }

.drop-zone { 
    border: 2px dashed #007bff; padding: 12px; text-align: center; 
    color: #555; background: #f8f9fa; border-radius: 6px; 
    cursor: pointer; font-size: 11px; margin-bottom: 10px; 
}
.drop-zone:hover, .drop-zone.dragover { background: #e2e6ea; border-color: #28a745; }

.media-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }

.modal-buttons { display: flex; justify-content: flex-end; gap: 6px; }

.btn-sm { 
    padding: 5px 10px; font-size: 11px; border: none; 
    border-radius: 4px; cursor: pointer; font-weight: 600; 
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-success { background: #28a745; color: white; } .btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; color: white; } .btn-danger:hover { background: #c82333; }
.btn-warning { background: #ffc107; color: #212529; } .btn-warning:hover { background: #e0a800; }
.btn-info { background: #17a2b8; color: white; } .btn-info:hover { background: #138496; }
.btn-secondary { background: #6c757d; color: white; } .btn-secondary:hover { background: #5a6268; }

.backup-container { 
    max-height: 130px; overflow-y: auto; font-size: 11px; 
    border: 1px solid #e9ecef; background: #fff; 
    border-radius: 4px; padding: 4px; 
}
.backup-item { display: flex; flex-direction: column; padding: 6px; border-bottom: 1px solid #eee; }
.backup-item:last-child { border-bottom: none; }
.backup-row-1 { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 600; color: #333; }
.backup-row-2 { display: flex; justify-content: space-between; align-items: center; }

.icon-option { 
    width: 26px; height: 26px; display: flex; align-items: center; 
    justify-content: center; border-radius: 4px; cursor: pointer; 
    border: 1px solid transparent; color: #555; font-size: 14px; transition: 0.2s; 
}
.icon-option:hover { background: #eee; }
.icon-option.selected { background: #007bff; color: #fff; border-color: #0056b3; }

/* ========================================= */
/* HARİTA ÜZERİNDEKİ ÖZEL PİN TASARIMLARI    */
/* ========================================= */

.custom-div-icon { background: transparent; border: none; }

.custom-map-pin {
    display: flex; justify-content: center; align-items: center; 
    color: #fff; font-size: 14px; box-shadow: 0 3px 6px rgba(0,0,0,0.4);
    transition: transform 0.2s;
}

.pin-style-marker { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); width: 32px; height: 32px; border: 2px solid #fff; }
.pin-style-marker i { transform: rotate(45deg); } 
.pin-style-circle { border-radius: 50%; width: 30px; height: 30px; border: 2px solid #fff; }
.pin-style-square { border-radius: 6px; width: 30px; height: 30px; border: 2px solid #fff; position: relative; }

.pin-pointer {
    position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
    border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 8px solid; width: 0; height: 0;
}

/* ========================================= */
/* MERKEZ LAZER ÇİZGİSİ VE HEDEF (TARGET)    */
/* ========================================= */

.distance-line {
    stroke-dasharray: 12, 12;
    animation: laser-dash 1s linear infinite;
    filter: drop-shadow(0 0 4px #00e676);
}
@keyframes laser-dash { to { stroke-dashoffset: -24; } }

.center-target-icon { background: transparent; border: none; }
.center-target-dot {
    background: #00e676; width: 12px; height: 12px; border-radius: 50%; 
    border: 3px solid #fff; box-shadow: 0 0 12px #00e676, inset 0 0 4px rgba(0,0,0,0.5);
    position: relative;
}
.center-target-dot::after {
    content: ''; position: absolute; top: -6px; left: -6px; right: -6px; bottom: -6px;
    border-radius: 50%; border: 2px solid #00e676; animation: pulse-target 1.5s infinite;
}
@keyframes pulse-target { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* ========================================= */
/* YELKOVAN MANTIĞI: MESAFE YAZISI (TOOLTIP) */
/* ========================================= */

.distance-tooltip {
    background: rgba(15, 20, 25, 0.85); border: 1px solid #00e676; color: #00e676;
    font-family: monospace; font-size: 12px; font-weight: bold; padding: 4px 8px;
    border-radius: 4px; box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
    backdrop-filter: blur(2px); white-space: nowrap;
}
.distance-tooltip::before, .distance-tooltip::after { display: none !important; }

.clock-q-tr { margin-top: -25px; margin-left: -40px; } 
.clock-q-tl { margin-top: -25px; margin-left: 40px; }  
.clock-q-bl { margin-top: 25px; margin-left: 40px; }   
.clock-q-br { margin-top: 25px; margin-left: -40px; }  

/* ========================================= */
/* 3 SÜTUNLU KUSURSUZ TASARIM POPUP          */
/* ========================================= */

.custom-photoshop-popup .leaflet-popup-tip-container { display: none !important; }

.leaflet-popup.q-tr { margin-left: 140px; margin-bottom: 20px; }
.leaflet-popup.q-tl { margin-left: -140px; margin-bottom: 20px; }
.leaflet-popup.q-bl { bottom: auto !important; top: 20px !important; margin-left: -140px; }
.leaflet-popup.q-br { bottom: auto !important; top: 20px !important; margin-left: 140px; }

.custom-photoshop-popup .leaflet-popup-content-wrapper { 
    padding: 0; overflow: hidden; border-radius: 8px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); background: #fff; 
}
.custom-photoshop-popup .leaflet-popup-content { margin: 0; width: 600px !important; max-width: 90vw; }

.custom-photoshop-popup .leaflet-popup-close-button { 
    color: #fff !important; background: rgba(0,0,0,0.5) !important; border-radius: 50%; 
    width: 24px !important; height: 24px !important; top: 10px !important; right: 10px !important; 
    display: flex; justify-content: center; align-items: center; font-size: 16px !important; 
    font-weight: normal; z-index: 10; text-decoration: none; 
}
.custom-photoshop-popup .leaflet-popup-close-button:hover { background: rgba(0,0,0,0.8) !important; }

.custom-popup { display: flex; flex-direction: column; }
.custom-popup-img { width: 100%; height: 280px; object-fit: cover; display: block; background: #222; }

.custom-popup-body { display: flex; padding: 15px 20px; gap: 15px; background: #fff; align-items: center; }
.custom-popup-left { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 60px !important; }
.custom-popup-cat { background: #cc2424; color: #fff; padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: bold; letter-spacing: 0.5px; text-transform: uppercase; white-space: nowrap; }
.custom-popup-date { color: #555; font-size: 11px; font-weight: bold; padding-left: 2px; }

.custom-popup-center { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: left; }
.custom-popup-title { font-size: 16px; font-weight: 800; color: #111; margin: 0 0 3px 0; line-height: 1.1; }
.custom-popup-desc { font-size: 11px; color: #444; line-height: 1.4; margin: 0; max-height: 90px; overflow-y: auto; padding-right: 5px; }

.custom-popup-right { width: 170px; min-width: 170px; display: flex; align-items: center; justify-content: flex-end; }
.custom-popup-logo { max-width: 170px; max-height: 100px; object-fit: contain; }

.admin-action-bar { border-top: 1px solid #eee; margin-top: 6px; padding-top: 6px; display: flex; gap: 6px; }
.admin-action-bar button, .admin-action-bar a { font-size: 10px; padding: 4px 8px; border-radius: 4px; border: none; cursor: pointer; text-decoration: none; font-weight: bold; }

/* ========================================= */
/* TABİAT AĞI ŞOV EFEKTLERİ VE KUSURSUZ LAZER*/
/* ========================================= */

.network-btn-container { margin: 20px !important; pointer-events: auto; }
.network-btn {
    background: rgba(15, 20, 25, 0.9); color: #00e676; border: 1px solid #00e676;
    padding: 10px 15px; font-weight: bold; border-radius: 8px; cursor: pointer; 
    box-shadow: 0 0 15px rgba(0,230,118,0.3); transition: all 0.3s ease; 
    font-size: 13px; font-family: monospace; backdrop-filter: blur(4px); 
    text-transform: uppercase; letter-spacing: 1px;
}
.network-btn:hover { background: #00e676; color: #111; box-shadow: 0 0 25px rgba(0,230,118,0.6); }

/* Ağın İlk Açılışındaki Düz (Kesiksiz ve Sabit) Hali */
.network-line-initial { opacity: 0.6; filter: drop-shadow(0 0 2px #00e676); }

/* Ağın 1. Saniyeden Sonraki Akan Hali (Matematiksel Olarak Kusursuzlaştırıldı) */
.network-line {
    stroke-dasharray: 8, 12 !important; /* Toplam 20px desen */
    animation: network-laser-dash 0.8s linear infinite !important; 
    opacity: 0.6; 
    filter: drop-shadow(0 0 2px #00e676);
}

/* 8+12=20px olduğu için offset tam -20 olmalı ki takılmadan yağ gibi aksın */
@keyframes network-laser-dash { to { stroke-dashoffset: -20; } }

.network-radar-dot {
    background: #00e676; width: 16px; height: 16px; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 0 15px #00e676; position: relative;
}
.network-radar-dot::before, .network-radar-dot::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    border-radius: 50%; border: 2px solid #00e676; animation: radar-pulse-wave 3s infinite linear;
    box-shadow: inset 0 0 15px rgba(0,230,118,0.5);
}
.network-radar-dot::after { animation-delay: 1.5s; }
@keyframes radar-pulse-wave { 0% { width: 16px; height: 16px; opacity: 1; } 100% { width: 93px; height: 93px; opacity: 0; } }

.network-label-wrapper { background: transparent; border: none; overflow: visible; pointer-events: none; }

.mini-network-box.glass-effect {
    position: absolute; width: 140px;
    background: rgba(10, 20, 15, 0.45); /* SİYAH ARKA PLAN TRANSPARANLAŞTIRILDI */
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 230, 118, 0.3); 
    border-radius: 30px; 
    padding: 5px 12px; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 6px rgba(0, 230, 118, 0.1);
    font-family: sans-serif; text-align: center;
    animation: pop-in-network 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.mini-network-title { 
    font-size: 11px; font-weight: 800; color: #00e676; margin: 0; line-height: 1.2; 
    text-transform: uppercase; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9); 
    width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.mini-network-desc { 
    font-size: 9px; color: #ccc; line-height: 1.2; margin-top: 2px; 
    width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}

/* ========================================================================== */
/* TABİAT AĞI: DİNAMİK 4 YÖNLÜ AKILLI ÇARPIŞMA HİZALAMALARI                   */
/* ========================================================================== */

/* Kapsül Üstte Görüntülensin */
.mini-network-box.network-box-top { bottom: 25px; left: -70px; top: auto; transform-origin: bottom center; }

/* Kapsül Altta Görüntülensin */
.mini-network-box.network-box-bottom { top: 25px; left: -70px; bottom: auto; transform-origin: top center; }

/* Kapsül Sağda Görüntülensin */
.mini-network-box.network-box-right { left: 20px; top: -15px; bottom: auto; transform-origin: left center; }

/* Kapsül Solda Görüntülensin */
.mini-network-box.network-box-left { left: -160px; top: -15px; bottom: auto; transform-origin: right center; }

/* Yazı kutularının harita üzerinde tıklamaları tamamen yakalayabilmesi için kilit açıldı */
.mini-network-box { pointer-events: auto !important; cursor: pointer; }

@keyframes pop-in-network { 0% { opacity: 0; transform: scale(0.1) translateY(20px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

@media (max-width: 600px) {
    .leaflet-popup.q-tr, .leaflet-popup.q-br { margin-left: 0; }
    .leaflet-popup.q-tl, .leaflet-popup.q-bl { margin-left: 0; }
    .custom-popup-img { height: 200px; }
    .custom-popup-body { flex-direction: column; padding: 15px; gap: 10px; align-items: flex-start; }
    .custom-popup-left { flex-direction: row; align-items: center; width: 100%; gap: 10px; }
    .custom-popup-right { width: 100%; min-width: auto; justify-content: flex-start; }
    .custom-popup-logo { max-height: 60px; width: auto; }
}

/* ========================================= */
/* TABİAT AĞI: YAKIN MESAFE KOMPAKT MODU     */
/* ========================================= */

.mini-network-box.compact-glass-effect {
    position: absolute; bottom: 12px; left: -50px; width: 100px;
    background: rgba(10, 20, 15, 0.8); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 230, 118, 0.2); border-radius: 4px; padding: 4px 6px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    font-family: sans-serif; text-align: center; 
    animation: pop-in-network 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom center; z-index: 50;
}

.compact-title { 
    font-size: 10px; font-weight: normal; color: #80ffb2; 
    margin-bottom: 0; text-shadow: none; white-space: nowrap; 
    overflow: hidden; text-overflow: ellipsis; letter-spacing: 0;
}

/* ========================================================================== */
/* TABİAT AĞI: DİNAMİK SAĞ VE SOL POPUP HİZALAMA ELEMANLARI                   */
/* ========================================================================== */

/* Sağda Kalanlar İçin: Pin Görselinin Sağında Görüntülensin */
.mini-network-box.network-box-east {
    left: 20px;
    bottom: -15px;
    top: auto;
    transform-origin: left center;
}

/* Solda Kalanlar İçin: Pin Görselinin Solunda Görüntülensin */
.mini-network-box.network-box-west {
    left: -160px; /* Kapsül Genişliği (140px) + Güvenlik boşluğu (20px) */
    bottom: -15px;
    top: auto;
    transform-origin: right center;
}

/* Yazı kutularının harita üzerinde tıklamaları tamamen yakalayabilmesi için kilit açıldı */
.mini-network-box {
    pointer-events: auto !important;
    cursor: pointer;
}

/* ========================================================================== */
/* HARİTA OPAKLIK (TRANSPARANLIK) KONTROL ÇUBUĞU                              */
/* ========================================================================== */
#opacityControlPanel {
    position: absolute; bottom: 20px; right: 55px; z-index: 998;
    background: rgba(15, 20, 25, 0.85); backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 230, 118, 0.4); border-radius: 8px;
    padding: 6px 12px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); pointer-events: auto;
}
#opacityControlPanel input[type=range] { 
    width: 90px; accent-color: #00e676; cursor: pointer; margin: 0; padding: 0;
}
#opacityVal { 
    color: #00e676; font-family: monospace; font-size: 11px; 
    font-weight: bold; width: 35px; text-align: right; 
}


/* ========================================================================== */
/* YENİ NESİL GEÇİŞLER VE AÇILIŞ UYARILARI                                    */
/* ========================================================================== */

/* Leaflet motorunu yavaş geçişe zorlayan kalkan (Kesin 3 Saniye) */
.leaflet-layer { transition: opacity 3s ease-in-out !important; }

/* Harita Katmanları Bilgi Baloncuğu (Tooltip) */
.layer-tutorial-tooltip {
    position: absolute; top: 15px; right: 55px; z-index: 9999;
    background: #00e676; color: #111; padding: 8px 12px;
    border-radius: 8px; font-weight: bold; font-size: 11px;
    box-shadow: 0 4px 15px rgba(0,230,118,0.4);
    animation: bounce-left 2s infinite; pointer-events: none;
}
.layer-tutorial-tooltip::after {
    content: ''; position: absolute; top: 50%; right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px; border-style: solid;
    border-color: transparent transparent transparent #00e676;
}
@keyframes bounce-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}



/* Harita Katmanları Bilgi Baloncuğu (Tooltip) */
.layer-tutorial-tooltip {
    position: absolute; top: 15px; right: 55px; z-index: 9999;
    background: #00e676; color: #111; padding: 10px 24px 10px 12px; /* Sağdan X butonu için ekstra boşluk bırakıldı */
    border-radius: 8px; font-weight: bold; font-size: 11px;
    box-shadow: 0 4px 15px rgba(0,230,118,0.4);
    animation: bounce-left 2s infinite; 
    pointer-events: auto; /* Tıklama kilidi açıldı */
    cursor: pointer;
}
.layer-tutorial-tooltip::after {
    content: ''; position: absolute; top: 50%; right: -6px;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px; border-style: solid;
    border-color: transparent transparent transparent #00e676;
}
/* Baloncuğun Kapatma (✖) Butonu */
.layer-tooltip-close {
    position: absolute; top: 4px; right: 6px; 
    font-size: 9px; font-weight: bold; color: #111; 
    background: rgba(0,0,0,0.1); border-radius: 50%; 
    width: 14px; height: 14px; display: flex; 
    align-items: center; justify-content: center;
    transition: background 0.2s;
}
.layer-tutorial-tooltip:hover .layer-tooltip-close {
    background: rgba(0,0,0,0.3); color: #fff;
}
@keyframes bounce-left {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}