/* * HUD.CSS
 * Oyun içi arayüz, minimap ve araçlar.
 * TEMA: Minimal Tech / Wireframe (Kompakt & Benzersiz)
 */

/* HUD Elements */
.hud-container { pointer-events: none; position: absolute; inset: 0; z-index: 50; }
.pointer-events-auto { pointer-events: auto; }

/* --- HUD GİZLEME ÖZELLİĞİ --- */
.hidden-ui {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* * BAŞLANGIÇ DURUMU (Game Start öncesi) */
#ui-hud, #ui-panels {
    transition: opacity 1.5s ease; 
    opacity: 0; 
    pointer-events: none; 
}

#ui-hud.active, #ui-panels.active {
    opacity: 1;
    pointer-events: auto; /* DÜZELTME: Aktif olduğunda tıklamalara izin ver */
}

/* Aktif olsa bile içindeki her şeyin tıklanabilir olmasını istemeyiz (boşluklar vs.)
   Bu yüzden child selector ile kontrolü sıkı tutuyoruz, ancak ana container eventleri geçirmeli */
#ui-hud:not(.active) *, #ui-panels:not(.active) * {
    pointer-events: none !important;
}

.hud-icon-group { 
    position: absolute; top: 20px; left: 20px; 
    display: flex; gap: 8px; 
    pointer-events: auto; align-items: flex-start; 
}

/* Minimal Rozet */
.hud-badge {
    position: absolute; 
    top: -6px; 
    right: -6px;
    
    /* Tema rengini varsayılan yapıyoruz ve JS müdahalelerini eziyoruz */
    background-color: var(--hud-color) !important; 
    color: #000 !important; /* Tema rengi genelde açık olduğu için koyu metin */
    
    font-weight: 800;
    font-family: 'Outfit', sans-serif; /* Daha modern ve okunaklı font */
    font-size: 0.65rem;
    line-height: 1;
    
    min-width: 18px; /* Sabit genişlik yerine minimum genişlik */
    height: 18px;
    padding: 0 4px; /* Çift basamaklı sayılar için iç boşluk */
    
    display: flex; 
    justify-content: center; 
    align-items: center;
    
    /* Gölgeyi tema rengiyle hafifçe renklendiriyoruz */
    box-shadow: 0 3px 6px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,0,0,0.3); 
    border: none;
    border-radius: 0;
    
    z-index: 10;
    pointer-events: none;
    
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s, color 0.2s; /* Renk geçişi eklendi */
}

/* AI Mode Toggle */
.ai-controls { display: flex; flex-direction: column; gap: 4px; }
.ai-mode-switch {
    font-size: 0.55rem; background: rgba(10, 12, 14, 0.8); padding: 2px 0; 
    border: 1px solid var(--hud-color-dim);
    color: var(--hud-text-dim);
    font-family: monospace; letter-spacing: 1px;
    cursor: pointer; pointer-events: auto; display: none; text-align: center;
    transition: 0.2s;
    width: 38px;
}
.ai-mode-switch.visible { display: block; }
.ai-mode-switch:hover { border-color: var(--hud-color); color: var(--hud-color); background: rgba(0,0,0,0.9); }

/* Echo Menu */
.echo-wrapper { position: relative; display: none; flex-direction: column; }
.echo-wrapper:hover .echo-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.echo-dropdown {
    position: absolute; top: 45px; left: 0;
    background-color: #050505; 
    border: 1px solid var(--hud-color-dim);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 0; 
    width: 210px;
    display: flex; flex-direction: column; gap: 1px;
    opacity: 0; visibility: hidden; transform: translateY(-5px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
    z-index: 60;
}

.echo-profile {
    padding: 10px 12px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; align-items: center; gap: 12px;
    background: rgba(30, 30, 30, 0.5); 
}
.echo-p-icon { 
    width: 32px; height: 32px; 
    border: 1px solid var(--echo-color);
    display: flex; justify-content: center; align-items: center; 
    font-size: 0.9rem; color: var(--echo-color);
    background: rgba(0,0,0,0.5);
}
.echo-p-stats { display: flex; flex-direction: column; gap: 2px; }
.echo-p-name { font-size: 0.75rem; color: #fff; font-weight: bold; font-family: monospace; letter-spacing: 1px; }
.echo-p-rate { font-size: 0.6rem; color: #888; font-family: monospace; }

.echo-menu-item {
    padding: 10px 12px; cursor: pointer;
    font-size: 0.7rem; letter-spacing: 1px; color: #aaa;
    transition: all 0.2s; 
    border-left: 2px solid transparent; 
    display: flex; justify-content: space-between; align-items: center;
    font-family: monospace;
    background: rgba(20, 20, 20, 0.8);
}

.echo-menu-item:hover { 
    background: rgba(40, 40, 40, 0.9); 
    color: #fff; 
    border-left-color: rgba(255, 255, 255, 0.3);
    padding-left: 15px;
}

.echo-menu-item.active-mode { 
    color: var(--echo-color);
    background: rgba(20, 20, 20, 1);
    font-weight: bold; 
    border-left: 3px solid var(--echo-color);
    box-shadow: inset 10px 0 20px -10px rgba(103, 232, 249, 0.1);
}

/* --- REHBER / TUTORIAL KUTUSU --- */
#tutorial-box {
    position: absolute;
    top: 30px; left: 50%; transform: translateX(-50%) translateY(-20px);
    
    background: var(--hud-bg);
    border: 1px solid var(--hud-color-dim);
    
    background-image: var(--wireframe-gradient);
    background-size: 10px 10px;
    background-position: top left, top left, bottom right, bottom right;
    background-repeat: no-repeat;

    padding: 12px 20px;
    display: flex; align-items: center; gap: 15px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    
    opacity: 0; pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 320px;
    max-width: 450px;
    border-radius: 0;
}

#tutorial-box.visible {
    opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto;
}

#tutorial-box.success {
    /* GÜNCELLEME: Sabit yeşil yerine tema rengi kullanıldı */
    border-color: var(--hud-color);
    box-shadow: 0 0 20px var(--hud-color-dim);
    background-image: 
        linear-gradient(to right, var(--hud-color) 2px, transparent 2px),
        linear-gradient(to bottom, var(--hud-color) 2px, transparent 2px),
        linear-gradient(to left, var(--hud-color) 2px, transparent 2px),
        linear-gradient(to top, var(--hud-color) 2px, transparent 2px);
}

#tutorial-icon {
    width: 28px; height: 28px;
    border: 1px solid var(--hud-color);
    display: flex; justify-content: center; align-items: center;
    background: var(--hud-color-dim); /* GÜNCELLEME: Dinamik arka plan */
    font-weight: bold; font-family: monospace; font-size: 1.1rem;
    color: var(--hud-color);
    flex-shrink: 0;
}

#tutorial-box.success #tutorial-icon {
    /* GÜNCELLEME: Başarı ikonunda da tema rengi */
    color: var(--hud-color); 
    border-color: var(--hud-color); 
    background: var(--hud-color-dim);
}

#tutorial-content { display: flex; flex-direction: column; flex: 1; justify-content: center; }

.tut-label { 
    font-size: 0.6rem; letter-spacing: 2px; color: var(--hud-text-dim); 
    font-weight: bold; margin-bottom: 4px; text-transform: uppercase; 
    font-family: monospace; border-bottom: 1px dashed var(--hud-color-dim);
    padding-bottom: 2px; display: inline-block; align-self: flex-start;
}

#tutorial-text { 
    font-size: 0.75rem; color: var(--hud-text); line-height: 1.4; 
    font-family: monospace; text-shadow: 0 0 5px rgba(0,0,0,0.5); 
}

/* --- ACHIEVEMENT POPUP (BAŞARIM BİLDİRİMİ) --- */
.achievement-popup {
    position: absolute; top: 80px; right: -250px;
    width: 240px;
    
    background: var(--hud-bg);
    border: 1px solid var(--color-gold); 
    
    /* Wireframe Deseni */
    background-image: var(--wireframe-gradient);
    background-size: 10px 10px;
    background-position: top left, top left, bottom right, bottom right;
    background-repeat: no-repeat;

    padding: 10px;
    display: flex; gap: 10px; align-items: center;
    z-index: 200;
    
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.15); 
    transition: right 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    border-radius: 0;
}

.achievement-popup.visible {
    right: 20px;
}

.ach-icon {
    width: 32px; height: 32px;
    border: 1px solid var(--color-gold);
    color: var(--color-gold);
    display: flex; justify-content: center; align-items: center;
    font-size: 1.1rem;
    background: rgba(251, 191, 36, 0.1);
    flex-shrink: 0;
    text-shadow: 0 0 10px var(--color-gold);
}

.ach-content {
    display: flex; flex-direction: column; justify-content: center; flex: 1;
}

.ach-title {
    font-size: 0.55rem;
    letter-spacing: 1px; color: var(--hud-text-dim);
    font-weight: bold; margin-bottom: 2px;
    text-transform: uppercase;
    font-family: monospace;
    align-self: flex-start;
}

.ach-name {
    font-size: 0.8rem;
    color: var(--color-gold); font-weight: bold;
    font-family: monospace; letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.5);
    margin-bottom: 1px;
    line-height: 1.1;
}

.ach-desc {
    font-size: 0.65rem;
    color: var(--hud-text);
    line-height: 1.1; font-family: monospace;
    opacity: 0.8;
}

/* --- ECHO VISION INDICATOR (GÜNCELLENDİ) --- */
/* Sabit renkler yerine CSS değişkenleri kullanıldı */
#echo-vision-indicator {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100px;
    /* Eski: linear-gradient(to top, rgba(103, 232, 249, 0.1) 0%, transparent 100%) */
    background: linear-gradient(to top, rgba(var(--echo-rgb), 0.1) 0%, transparent 100%);
    
    /* Eski: border-top: 1px solid rgba(103, 232, 249, 0.3) */
    border-top: 1px solid rgba(var(--echo-rgb), 0.3);
    
    pointer-events: none; z-index: 40;
    display: none; flex-direction: column; justify-content: flex-end; align-items: center;
    padding-bottom: 20px;
}
#echo-vision-indicator.active { display: flex; animation: hudFadeIn 0.5s ease; }

.vision-text {
    font-size: 1rem; font-weight: bold; letter-spacing: 4px; color: var(--echo-color);
    text-shadow: 0 0 10px var(--echo-color);
    animation: blinkText 2s infinite;
    font-family: monospace;
}
.vision-sub {
    font-size: 0.7rem; letter-spacing: 2px; 
    /* Eski: rgba(103, 232, 249, 0.7) */
    color: rgba(var(--echo-rgb), 0.7);
    font-family: monospace; margin-top: 5px;
}
.scan-line {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    /* Eski: rgba(103, 232, 249, 0.5) */
    background: rgba(var(--echo-rgb), 0.5);
    box-shadow: 0 0 10px var(--echo-color);
    animation: scanDown 3s linear infinite;
}

@keyframes scanDown { 0% { top: 0; opacity: 0; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes blinkText { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* --- SPEEDOMETER --- */
#speedometer {
    position: absolute; bottom: 20px; right: 215px; 
    left: auto; 
    background: transparent; border: none;
    padding: 0; border-radius: 0;
    display: flex; flex-direction: column; gap: 0px;
    opacity: 0.8; text-align: right; pointer-events: none; z-index: 55;
}
.speed-label { font-size: 0.55rem; color: var(--color-text-dark); letter-spacing: 2px; text-transform: uppercase; font-family: monospace; }
.speed-val { font-size: 1.8rem; color: var(--hud-text); font-weight: 300; font-family: monospace; line-height: 1; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.speed-unit { font-size: 0.7rem; color: var(--hud-text-dim); margin-left: 5px; font-weight: 300; }

/* --- MİNİMAL AYARLAR BUTONU --- */
#btn-settings { 
    position: absolute; top: 20px; right: 20px; 
    width: 38px; height: 38px; 
    border-radius: 0;
    background: rgba(10, 12, 14, 0.4);
    border: 1px solid rgba(148, 216, 195, 0.1);
    display: flex; justify-content: center; align-items: center; 
    cursor: pointer; z-index: 90; 
    color: var(--hud-text-dim); 
    font-size: 1.2rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    pointer-events: auto; 
}

#btn-settings::before { 
    content: ''; position: absolute; top: -1px; left: -1px; 
    width: 6px; height: 6px; 
    border-top: 2px solid var(--hud-color-dim); 
    border-left: 2px solid var(--hud-color-dim); 
    transition: all 0.2s;
}
#btn-settings::after { 
    content: ''; position: absolute; bottom: -1px; right: -1px; 
    width: 6px; height: 6px; 
    border-bottom: 2px solid var(--hud-color-dim); 
    border-right: 2px solid var(--hud-color-dim); 
    transition: all 0.2s;
}

#btn-settings:hover { 
    border-color: var(--hud-color-dim); 
    color: var(--hud-color); 
    background: rgba(10, 12, 14, 0.9);
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
#btn-settings:hover::before, #btn-settings:hover::after {
    border-color: var(--hud-color); opacity: 0.8;
}

#btn-settings.active {
    border-color: var(--hud-color); 
    color: var(--hud-color); 
    background: rgba(148, 216, 195, 0.1);
    transform: rotate(90deg);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
#btn-settings.active::before, #btn-settings.active::after {
    border-color: var(--hud-color); opacity: 0.8;
}

/* Ayarlar Paneli */
#settings-panel { 
    position: absolute; top: 70px; right: 20px; width: 280px; 
    background-color: #0b0d10;
    border: 1px solid var(--hud-color-dim);
    background-image: 
        linear-gradient(rgba(148, 216, 195, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 216, 195, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    padding: 15px; 
    pointer-events: none; opacity: 0; 
    transition: all 0.3s; transform: translateY(-10px); 
    z-index: 89; 
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    font-family: 'Courier New', Courier, monospace;
}
#settings-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* .settings-tabs ve .settings-tab -> css/tabs.css dosyasına taşındı */

.settings-content { display: none; animation: fadeInMsg 0.2s ease; }
.settings-content.active { display: block; }

input[type=range] { width: 100%; -webkit-appearance: none; height: 2px; background: rgba(255,255,255,0.1); outline: none; margin-top: 10px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 8px; background: var(--hud-color); cursor: pointer; border-radius: 0; border: 1px solid #000; }

/* --- TOGGLE SWITCH --- */
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.65rem; color: var(--hud-text-dim); letter-spacing: 1px; font-family: monospace; }
.toggle-switch { position: relative; display: inline-block; width: 30px; height: 14px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .2s; border: 1px solid var(--hud-color-dim); }
.slider:before { position: absolute; content: ""; height: 8px; width: 8px; left: 2px; bottom: 2px; background-color: var(--hud-text-dim); transition: .2s; border-radius: 0; }
input:checked + .slider { background-color: rgba(148, 216, 195, 0.2); border-color: var(--hud-color); }
input:checked + .slider:before { transform: translateX(16px); background-color: var(--hud-color); }

/* Prompt */
#merge-prompt { 
    position: absolute; bottom: 240px; left: 50%; transform: translateX(-50%); 
    background: rgba(10, 12, 14, 0.85); 
    padding: 8px 25px; 
    border: 1px solid var(--hud-color);
    border-left-width: 4px; border-right-width: 4px; /* Yan vurgular */
    
    color: var(--hud-color); 
    font-size: 0.8rem; letter-spacing: 2px; font-family: monospace; font-weight: bold;
    backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.2s; pointer-events: none; text-align: center; 
    box-shadow: 0 0 20px rgba(148, 216, 195, 0.15);
}
#merge-prompt.visible { opacity: 1; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.02); } 100% { transform: translateX(-50%) scale(1); } }

/* --- MINIMAP --- */
#minimap-wrapper {
    position: absolute; bottom: 20px; right: 20px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    z-index: 60; pointer-events: auto;
}
#minimap-container {
    width: 170px; height: 170px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    border-radius: 50%; 
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}
/* Minimap etrafına teknik halka eklentisi */
#minimap-container::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.1); pointer-events: none;
}

#energy-bar-container, #health-bar-container {
    width: 100%; height: 2px;
    background: rgba(255,255,255,0.1);
    margin-top: 0px; 
    border-radius: 0;
    overflow: hidden;
}
#energy-bar-fill {
    height: 100%; background: var(--ray-color); width: 100%;
    box-shadow: 0 0 5px var(--ray-color);
    transition: width 0.2s linear, background 0.3s;
}
#health-bar-fill {
    height: 100%; background: var(--color-success); width: 100%;
    box-shadow: 0 0 5px var(--color-success);
    transition: width 0.2s linear, background 0.3s;
}
.coords { font-family: monospace; font-size: 0.65rem; color: var(--hud-text-dim); letter-spacing: 1px; margin-top: 2px; }

/* ... existing code ... */

/* --- GLOBAL TOOLTIP --- */
#global-tooltip {
    position: fixed; 
    background: rgba(10, 12, 14, 0.95);
    border: 1px solid var(--hud-color);
    color: var(--hud-text);
    padding: 6px 10px;
    border-radius: 0;
    font-size: 0.7rem;
    z-index: 9999; 
    pointer-events: none; 
    display: none; 
    box-shadow: 0 0 15px rgba(0,0,0,0.8);
    white-space: nowrap;
    backdrop-filter: blur(5px);
    font-family: monospace;
    transform: translate(15px, 15px); 
}
.tooltip-title { font-weight: bold; color: var(--hud-color); display: block; margin-bottom: 2px; letter-spacing: 1px; }
.tooltip-desc { font-size: 0.65rem; color: var(--hud-text-dim); }
.tooltip-xp { color: var(--ray-color); font-family: monospace; }

/* --- DEBUG FPS PANELİ --- */
#debug-fps-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    
    /* Arka plan: Biraz daha koyu ve bulanık */
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(4px);
    
    /* Sınırlar ve Şekil */
    border: 1px solid var(--hud-color-dim);
    border-radius: 2px; /* Keskin köşeler (Wireframe teması) */
    padding: 6px 12px;
    
    /* Tipografi */
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: var(--hud-text-dim); /* Etiket rengi (Sönük) */
    line-height: 1.4;
    white-space: nowrap;
    
    /* Etkileşim */
    pointer-events: auto;
    cursor: move;
    user-select: none;
    
    /* Görünürlük ve Katman */
    display: none;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Değerler için tek tip stil (Tema Rengi) */
.dbg-val { 
    font-weight: bold; 
    color: var(--hud-color); /* Temaya uyumlu renk */
    margin-right: 10px;      /* Değerler arası boşluk */
}

/* Son elemanın sağ boşluğunu sıfırla */
.dbg-val:last-child {
    margin-right: 0;
}