/* --- style.css : V15000 (SCROLL FIX FULL SÜRÜM) --- */

/* GENEL AYARLAR */
body {
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding-bottom: 40px; /* Alt bant için boşluk */
}

/* ============================================================
   SIDEBAR (YAN MENÜ) - GÜNCELLENMİŞ KAYDIRMA ÖZELLİĞİ 🔥
   ============================================================ */
#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -16rem; /* Mobilde gizli */
    transition: margin .25s ease-out;
    background-color: #2c3e50; /* Koyu Lacivert */
    color: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed; /* Sabitlendi */
    z-index: 1000;
    width: 16rem;
    top: 0;
    bottom: 0;

    /* 🔥 KAYDIRMA ÖZELLİĞİ (SCROLL) 🔥 */
    overflow-y: auto; /* Dikey kaydırmayı aç */
    overflow-x: hidden; /* Yatay taşmayı engelle */
    
    /* Mobilde kaydırmanın "yağ gibi" olması için (iOS momentum scroll) */
    -webkit-overflow-scrolling: touch; 
    
    /* Alttaki Bloomberg bandının altında menü kalmasın diye alt boşluk */
    padding-bottom: 60px; 
}

/* 🔥 MODERN VE İNCE KAYDIRMA ÇUBUĞU (WEBKIT - CHROME/SAFARI/EDGE) 🔥 */
#sidebar-wrapper::-webkit-scrollbar {
    width: 6px; /* Çok ince bir çubuk */
}

#sidebar-wrapper::-webkit-scrollbar-track {
    background: transparent; /* Arka plan şeffaf olsun */
}

#sidebar-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2); /* Hafif beyaz, şeffaf */
    border-radius: 10px; /* Yuvarlak hatlar */
}

#sidebar-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.4); /* Üstüne gelince parlasın */
}

/* SIDEBAR İÇERİK STİLLERİ */
#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem 1.25rem;
    font-size: 1.4rem;
    font-weight: bold;
    color: #ecf0f1;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#sidebar-wrapper .list-group {
    width: 16rem;
}

.list-group-item {
    background-color: transparent !important;
    color: #bdc3c7 !important;
    border: none !important;
    padding: 12px 20px;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
}

.list-group-item:hover {
    background-color: rgba(255,255,255,0.1) !important;
    color: #fff !important;
    transform: translateX(5px);
}

.list-group-item.active {
    background-color: #34495e !important;
    color: #3498db !important;
    font-weight: bold;
    border-left: 4px solid #3498db !important;
}

/* ANA İÇERİK ALANI */
#page-content-wrapper {
    width: 100%;
    transition: all .25s ease-out;
    padding-top: 20px;
}

/* SIDEBAR AÇIKKEN (Masaüstü Varsayılan) */
#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 16rem; /* İçeriği sağa it */
}

/* LOGIN EKRANI */
#login-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
}

/* TABLO VE KARTLAR */
.card { border-radius: 10px; overflow: hidden; }
.badge { font-weight: 500; }
.btn-primary { background-color: #3498db; border-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; border-color: #2980b9; }

/* ÖZEL ANİMASYONLAR */
.yanip-sonen-kirmizi { animation: blink-red 2s infinite; background-color: #fff0f0; }
@keyframes blink-red { 0% { border-left: 5px solid red; } 50% { border-left: 5px solid transparent; } 100% { border-left: 5px solid red; } }

/* --- BLOOMBERG ALT BANT --- */
.ticker-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #1a252f; /* Daha koyu premium lacivert */
    display: flex;
    align-items: center;
    z-index: 10000;
    border-top: 2px solid #e74c3c;
    overflow: hidden;
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
}

.ticker-clock {
    background: #e74c3c;
    color: #fff;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    z-index: 10001;
    box-shadow: 10px 0 15px rgba(0,0,0,0.3);
}

.ticker-scroll-container {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    padding-right: 100%;
    animation: ticker linear infinite;
    height: 40px; /* Yükseklik hizalama */
    line-height: 40px;
}

.ticker__item {
    display: inline-block;
    padding: 0 25px;
    color: #ecf0f1;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Dinamik hız ayarı için bu sınıfı kullanacağız */
.ticker-content {
    display: flex;
}

.hover-effect:hover {
    background-color: #f1f4f9 !important;
    transform: translateX(5px);
    transition: all 0.2s ease;
}

/* HAYALET KUTUYU GİZLE */
div[style*="background-color: red"], 
div[style*="position: fixed"][style*="z-index: 9999"] {
    display: none !important;
}

/* YENİ BADGE AYARI (Bizim Yaptığımız) */
#cloud-status .badge {
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 20px;
}

/* 🔥 BLOOMBERG BANDI İÇİN GÜVENLİ GÖRÜNÜM 🔥 */
#bloomberg-ticker {
    display: flex !important; /* Flexbox yapısını koru */
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 2147483647 !important;
    background-color: #1a1a1a !important;
    bottom: 0 !important;
    position: fixed !important;
    left: 0 !important;
    width: 100% !important;
}

/* Sadece ana kapsayıcıya görünürlük ver, iç düzeni (display) bozma */
#bloomberg-ticker * {
    visibility: visible !important;
}

/* Kayan yazı animasyonunun çalışması için */
#bloomberg-ticker > div {
    display: flex; /* İç divlerin flex kalmasını sağla */
}

/* --- RESPONSIVE AYARLAR --- */
@media (min-width: 768px) {
    #sidebar-wrapper { margin-left: 0; }
    #page-content-wrapper { margin-left: 16rem; width: calc(100% - 16rem); }
    #wrapper.toggled #sidebar-wrapper { margin-left: -16rem; }
    #wrapper.toggled #page-content-wrapper { margin-left: 0; width: 100%; }
    #menu-toggle { display: none; } 
}

@media (max-width: 768px) {
    #sidebar-wrapper { margin-left: -16rem; }
    #wrapper.toggled #sidebar-wrapper { margin-left: 0; box-shadow: 5px 0 15px rgba(0,0,0,0.5); }
    #page-content-wrapper { margin-left: 0; width: 100%; padding: 0; }
    .container-fluid { padding-left: 10px; padding-right: 10px; }
    #menu-toggle { display: block; margin-bottom: 10px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .modal-dialog { margin: 10px; width: auto !important; }
    #gizlilik-btn { position: absolute; top: 15px; right: 15px; z-index: 90; }
}
/* ============================================================
   🌙 GECE MODU (DARK MODE) - V1.0
   ============================================================ */

/* Body'ye "dark-mode" sınıfı gelince çalışacak kurallar */
body.dark-mode {
    background-color: #121212 !important; /* Simsiyah arka plan */
    color: #e0e0e0 !important; /* Açık gri yazı */
}

/* Kartlar ve Kutular */
body.dark-mode .card, 
body.dark-mode .modal-content,
body.dark-mode .list-group-item {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Bootstrap Arka Planlarını Ezme (Override) */
body.dark-mode .bg-white {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
}

body.dark-mode .bg-light {
    background-color: #2c2c2c !important;
    color: #e0e0e0 !important;
}

/* Yazı Renklerini Tersine Çevirme */
body.dark-mode .text-dark { color: #f8f9fa !important; }
body.dark-mode .text-muted { color: #a0a0a0 !important; }
body.dark-mode .text-secondary { color: #b0b0b0 !important; }

/* Tablolar */
body.dark-mode .table {
    color: #e0e0e0 !important;
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: #252525 !important;
    --bs-table-hover-bg: #333 !important;
    border-color: #333 !important;
}

body.dark-mode .table-light {
    background-color: #2c2c2c !important;
    color: #fff !important;
}

/* Form Elemanları (Inputlar) */
body.dark-mode .form-control, 
body.dark-mode .form-select {
    background-color: #2c2c2c !important;
    border-color: #444 !important;
    color: #fff !important;
}

body.dark-mode .form-control::placeholder {
    color: #888 !important;
}

/* Input Group (Arama kutusu yanındaki ikonlar vb.) */
body.dark-mode .input-group-text {
    background-color: #333 !important;
    border-color: #444 !important;
    color: #ccc !important;
}

/* Dropdown Menüler */
body.dark-mode .dropdown-menu {
    background-color: #1e1e1e !important;
    border-color: #444 !important;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0 !important;
}

body.dark-mode .dropdown-item:hover {
    background-color: #333 !important;
}

/* Sidebar Uyum */
body.dark-mode #sidebar-wrapper {
    background-color: #1a1a1a !important; /* Biraz daha koyu sidebar */
    border-right: 1px solid #333;
}

/* Scrollbar (Kaydırma Çubuğu) Koyu Tema */
body.dark-mode ::-webkit-scrollbar-track {
    background: #121212;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background-color: #444;
}
/* ============================================================
   🔔 BİLDİRİM PENCERESİ DÜZELTMESİ (FIX)
   ============================================================ */
#bildirim-listesi {
    background-color: #ffffff !important; /* Arka planı tam beyaz yap (Şeffaflığı kapat) */
    z-index: 10000 !important; /* Katman sırasını en üste çek (Tablo başlıklarını ezsin) */
    opacity: 1 !important; /* Tam görünür olsun */
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important; /* Altına güçlü gölge ver ki havada dursun */
    border: 1px solid rgba(0,0,0,0.1) !important; /* Hafif bir çerçeve */
}

/* Gece Modu (Dark Mode) İçin Uyum */
body.dark-mode #bildirim-listesi {
    background-color: #1e1e1e !important; /* Koyu gri arka plan */
    border: 1px solid #444 !important; /* Koyu çerçeve */
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important; /* Koyu gölge */
}
/* ============================================================
   🔒 Z-INDEX ÇAKIŞMA DÜZELTMESİ (Ana Ekran Fix)
   ============================================================ */

/* 1. Üst Menü (Navbar) her zaman tablolardan yukarıda olsun */
nav.navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1050 !important; /* Bootstrap standartlarının üzerinde tutuyoruz */
}

/* 2. Bildirim Listesi menüden de yukarıda ve opak olsun */
#bildirim-listesi {
    z-index: 1060 !important; /* Navbar(1050)'dan daha yüksek */
    background-color: #ffffff !important; /* Şeffaflığı kesin kapat */
    box-shadow: 0 10px 40px rgba(0,0,0,0.4) !important; /* Altı görünmesin diye koyu gölge */
    opacity: 1 !important;
    transform: translate3d(0,0,0); /* Tarayıcıya yeni katman açtırır (GPU Render) */
}

/* 3. Ana Ekrandaki Tablo Başlıklarını Aşırı Yükselmesin Diye Baskıla */
#ana-ekran thead th {
    z-index: 1 !important; /* Tablo başlığı haddini bilsin :) */
}

/* Gece Modu için Bildirim Kutusu Zemini */
body.dark-mode #bildirim-listesi {
    background-color: #1e1e1e !important;
    border: 1px solid #444 !important;
}