:root {
    --bg-color: #000000;
    --panel-bg: rgba(15, 23, 42, 0.85);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.15);
    --panel-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    --btn-bg: #334155;
    --btn-hover: #475569;
}

body.light-mode {
    --bg-color: #e2e8f0;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1e293b;
    --text-muted: #475569;
    --border-color: rgba(0, 0, 0, 0.15);
    --panel-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --btn-bg: #e2e8f0;
    --btn-hover: #cbd5e1;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, sans-serif; }
body, html { width: 100%; height: 100%; overflow: hidden; background-color: var(--bg-color); transition: background-color 0.3s; }

.view-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; visibility: hidden; opacity: 0; transition: opacity 0.5s ease; }
.view-container.active { visibility: visible; opacity: 1; z-index: 1; }

/* Hamburger Menü Butonu */
#hamburger-menu {
    position: absolute; top: 15px; right: 15px;
    width: 45px; height: 45px;
    background: var(--panel-bg); color: #38bdf8;
    border-radius: 8px; border: 1px solid var(--border-color);
    display: none; 
    align-items: center; justify-content: center;
    font-size: 24px; cursor: pointer; z-index: 1001;
    box-shadow: var(--panel-shadow); backdrop-filter: blur(8px);
}

/* Ana Panel */
#ui-panel { 
    position: absolute; top: 15px; right: 15px; 
    background: var(--panel-bg); color: var(--text-main); 
    border-radius: 12px; width: 340px; z-index: 1000; 
    box-shadow: var(--panel-shadow); backdrop-filter: blur(8px); 
    border: 1px solid var(--border-color); 
    max-height: 90vh; overflow-y: auto;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

#ui-panel.collapsed {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

#panel-content { padding: 20px; position: relative; }

/* Panel Başlığı ve MUTLAK Konumlu Çarpı Butonu */
.panel-header { 
    margin-bottom: 15px; border-bottom: 1px solid var(--border-color); 
    padding-bottom: 15px; padding-right: 50px; /* Çarpı butonuna yer açar */
}
.panel-header h2 { font-size: 1.2rem; color: #38bdf8; margin: 0; line-height: 1.2;}

/* Asla Kaymayan, Rahat Tıklanan Çarpı Butonu */
#close-panel { 
    display: none; /* Masaüstünde gizli */
    position: absolute; 
    top: 15px; right: 15px; /* Sağ üst köşeye çivili */
    width: 36px; height: 36px; 
    background: var(--btn-bg); border-radius: 8px;
    font-size: 1.2rem; color: var(--text-main); 
    align-items: center; justify-content: center;
    cursor: pointer; font-weight: bold; transition: 0.2s;
    border: 1px solid var(--border-color);
}
#close-panel:hover { background: #ef4444; color: white; border-color: #ef4444; }

/* Mobil & Tablet Ekran Düzenlemesi (992px'e çıkarıldı) */
@media (max-width: 992px) {
    #hamburger-menu { display: flex; }
    #ui-panel { width: calc(100% - 30px); left: 15px; }
    #close-panel { display: flex; } /* Flex kullanarak "X" işaretini tam ortalar */
}

.top-controls { display: flex; justify-content: space-between; margin-bottom: 15px; }
.lang-toggle { display: flex; background: var(--btn-bg); border-radius: 6px; overflow: hidden; }
.lang-btn { background: transparent; border: none; padding: 5px 10px; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; font-weight: bold; transition: 0.2s; }
.lang-btn.active { background: #38bdf8; color: #fff; }
.theme-btn { background: var(--btn-bg); border: none; padding: 5px 10px; border-radius: 6px; color: var(--text-main); cursor: pointer; font-size: 0.8rem; font-weight: bold; transition: 0.2s; }
.theme-btn:hover { background: var(--btn-hover); }

.coords { font-size: 0.85rem; margin-bottom: 10px; background: var(--btn-bg); padding: 8px; border-radius: 6px; }
.coords span { color: #38bdf8; display: block; margin-top: 4px; font-family: monospace; font-weight: bold; }
.coords span.not-selected { color: var(--text-muted); font-weight: normal; }

.legend { margin: 15px 0; padding: 10px; background: var(--btn-bg); border-radius: 6px; }
.legend-item { display: flex; align-items: center; margin-bottom: 8px; font-size: 0.80rem; }
.legend-item:last-child { margin-bottom: 0; }
.line { width: 20px; height: 4px; margin-right: 10px; border-radius: 2px; }
.gc-line { background-color: #ef4444; }
.rl-line { background-color: #38bdf8; }

.main-btn, .clear-btn { width: 100%; padding: 10px; margin-top: 5px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.main-btn { background-color: #22c55e; color: #fff; }
.main-btn:hover { background-color: #16a34a; }
.clear-btn { background: rgba(0,0,0,0.2); color: var(--text-main); border: 1px solid var(--border-color); }
.clear-btn:hover { background: var(--btn-hover); }

.hint { font-size: 0.75rem; color: var(--text-muted); text-align: center; margin-top: 15px; }

.switches-wrapper { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.toggle-container { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.2); padding: 8px 10px; border-radius: 6px; }
.toggle-label { font-size: 0.75rem; font-weight: bold; color: var(--text-main); }
.switch { position: relative; display: inline-block; width: 32px; height: 18px; margin-left: 10px; flex-shrink: 0;}
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #94a3b8; transition: .3s; border-radius: 20px; }
.slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: #22c55e; }
input:checked + .slider:before { transform: translateX(14px); }

.leaflet-div-icon { background: transparent !important; border: none !important; }