/* ==========================================================================
   BEKCAN INSTITUTE - MERKEZİ DASHBOARD STİL DOSYASI (style.css)
   ========================================================================== */

/* 1. GENEL SIFIRLAMA VE YAPI */
* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

/* Masaüstü için sayfa kaydırmasını kapatıp tam ekran yapıyoruz */
body { 
    margin: 0; 
    padding: 0; 
    background-color: #f4f6f9; 
    color: #333; 
    height: 100vh; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
}

/* 2. ÜST MENÜ (NAVBAR) TASARIMI */
.top-navbar {
    background-color: #1e293b;
    color: white;
    padding: 0 25px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    z-index: 100;
}
.top-navbar .logo { display: flex; align-items: center; font-weight: 800; font-size: 16px; letter-spacing: 1px; color: #60a5fa; }
.top-navbar .logo img { width: 120px; display: block; }
.top-navbar .menu-items { display: flex; gap: 5px; height: 100%; align-items: stretch; justify-content: flex-end; flex-grow: 1; }
.top-navbar a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0 15px;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}
.top-navbar a:hover { color: white; background-color: rgba(255,255,255,0.05); }
.top-navbar a.active { color: white; border-bottom: 3px solid #3b82f6; background-color: rgba(59, 130, 246, 0.1); }

/* 3. AÇILIR MENÜ (DROPDOWN) YAPISI */
.dropdown { position: relative; display: flex; height: 100%; }
.dropdown .dropbtn { display: flex; align-items: center; height: 100%; cursor: pointer; padding: 0 15px; color: #cbd5e1; font-size: 14px; font-weight: 600; text-transform: uppercase; transition: all 0.2s; border-bottom: 3px solid transparent; }
.dropdown:hover .dropbtn { color: white; background-color: rgba(255,255,255,0.05); }
.dropdown .dropbtn.active-parent { color: white; border-bottom: 3px solid #3b82f6; background-color: rgba(59, 130, 246, 0.1); }

.dropdown-content { display: none; position: absolute; background-color: #1e293b; min-width: 220px; box-shadow: 0px 8px 20px 0px rgba(0,0,0,0.3); z-index: 1000; top: 100%; left: 0; border-radius: 0 0 6px 6px; overflow: hidden; }
.dropdown-content a { color: #cbd5e1; padding: 14px 20px; text-decoration: none; display: block; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 13px; border-left: 3px solid transparent; }
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background-color: rgba(255,255,255,0.08); color: white; }
.dropdown-content a.active { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; border-left: 3px solid #3b82f6; border-bottom: none; }
.dropdown:hover .dropdown-content { display: block; animation: fadeIn 0.2s ease-in-out; }

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* 4. ANA TAŞIYICI VE PANELLER */
.dashboard { display: flex; gap: 20px; max-width: 1800px; width: 100%; margin: 0 auto; padding: 15px; height: calc(100vh - 60px); }

.sidebar { width: 380px; flex-shrink: 0; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; flex-direction: column; overflow-y: auto; height: 100%; }
.main { flex-grow: 1; min-width: 0; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); display: flex; flex-direction: column; height: 100%; position: relative; }

/* 5. TİPOGRAFİ VE FİLTRE GRUPLARI */
h3 { margin-top: 0; color: #2c3e50; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
label.section-title { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13px; color: #34495e; }

.filter-group { margin-bottom: 18px; padding-bottom: 15px; border-bottom: 1px solid #eee; }
.filter-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.row-flex { display: flex; gap: 10px; }
.row-flex > div { flex: 1; }

/* 6. FORM VE SEÇİM ELEMANLARI */
select { width: 100%; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; background-color: #fafafa; }
.search-box { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #2196f3; border-radius: 4px; font-size: 12px; transition: all 0.2s; }
.search-box:focus { outline: none; box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1); }

.radio-box, .check-box { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; cursor: pointer; }
.radio-box input, .check-box input, .cat-option input { cursor: pointer; }

/* 7. LİSTELER VE BUTONLAR */
.scroll-box { border: 1px solid #cfd8dc; border-radius: 4px; padding: 10px; overflow-y: auto; background: #fafafa; margin-top: 8px; max-height: 200px; }
.cat-option { display: flex; align-items: center; font-size: 12px; margin-bottom: 6px; cursor: pointer; }
.scroll-box label { font-weight: normal; font-size: 12px; }

.btn-controls { display: flex; gap: 5px; margin-top: 5px; margin-bottom: 8px; }
.btn-controls button { flex: 1; padding: 6px; border: none; border-radius: 3px; font-size: 11px; cursor: pointer; font-weight: bold; transition: background 0.2s ease-in-out; }
.btn-all { background: #2e7d32; color: white; }
.btn-all:hover { background: #1b5e20; }
.btn-clear { background: #d32f2f; color: white; }
.btn-clear:hover { background: #c62828; }

/* 8. GRAFİK ALANI VE YÜKLENİYOR EFEKTİ */
.chart-container { position: relative; flex-grow: 1; min-height: 400px; }
.stats-note { margin-top: 15px; padding: 10px; background: #e8f4fd; border-left: 4px solid #2196f3; font-size: 12px; color: #0d47a1; line-height: 1.4; }
.loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.85); display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 16px; color: #546e7a; z-index: 10; border-radius: 8px; backdrop-filter: blur(2px); }


/* ==========================================================================
   MOBİL VE TABLET UYUMU (RESPONSIVE TASARIM)
   ========================================================================== */
@media screen and (max-width: 992px) {
    /* Gövdeyi serbest bırak, mobil kaydırmaya izin ver */
    body { 
        height: auto; 
        overflow-y: auto; 
        display: block;
    }

    /* Navbar'ı alta doğru esnet ve elemanları ortala */
    .top-navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        align-items: center;
        height: auto;
    }
    .top-navbar .menu-items {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .top-navbar a, .dropdown .dropbtn {
        padding: 10px;
        font-size: 13px;
    }

    /* Açılır Menüyü mobil ekranda ortala */
    .dropdown-content {
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        border-radius: 6px;
        min-width: 180px;
    }

    /* Ana Alanlar: Yan yana durmak yerine alt alta dizilsin */
    .dashboard {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 100px);
        padding: 10px;
    }
    
    /* Sol filtre paneli ekranı tam kaplasın */
    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    
    /* Grafiğin mobilde ezilmemesi ve Chart.js'in düzgün çalışması için sabit yükseklik */
    .main {
        width: 100%;
        height: 600px; 
        overflow: visible;
    }
}

/* Çok küçük ekranlar (Dar Telefonlar) */
@media screen and (max-width: 480px) {
    .row-flex {
        flex-direction: column; /* Yan yana duran tarih filtrelerini alt alta al */
        gap: 10px;
    }
    .main {
        height: 500px;
    }
    .chart-container {
        min-height: 300px;
    }
    .top-navbar .logo img {
        width: 100px;
    }
}