/* SIDEBAR CSS 
    Tasarım: Modern, Belirgin Menü Elemanları, Kare Logo
*/

:root {
    --sidebar-bg: #0f172a;       /* Koyu Lacivert Arkaplan */
    --sidebar-width: 260px;      /* Sidebar Genişliği */
    --sidebar-collapsed-width: 70px; /* Daraltılmış Sidebar Genişliği */
    --menu-text-color: #94a3b8;  /* Pasif Menü Yazı Rengi */
    --menu-hover-bg: rgba(255, 255, 255, 0.08); /* Hover Arkaplanı */
    --menu-active-bg: #3b82f6;   /* Aktif Menü Rengi (Mavi) */
    --menu-active-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Sidebar Genel Konteyner */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    transition: width 0.3s ease, left 0.3s ease; /* Width ve Left için geçiş efekti */
    overflow: hidden;
}

/* DARALTILMIŞ (COLLAPSED) MOD - MASAÜSTÜ İÇİN */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Daraltılmış modda logoyu gizle veya küçült */
.sidebar.collapsed .sidebar-logo-container {
    padding: 10px 5px;
    display: none; /* Şimdilik gizleyelim, istenirse küçük ikon konabilir */
}

/* Daraltılmış modda menü yazıları ve başlıkları gizle */
.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu li a {
    font-size: 0; /* Yazıyı gizlemenin en temiz yolu */
    padding: 15px 0; /* Ortalamak için */
    justify-content: center;
}

.sidebar.collapsed .menu li a i {
    margin-right: 0; /* İkonun sağındaki boşluğu al */
    font-size: 1.2rem; /* İkonu biraz büyüt */
}

/* Daraltılmış modda hover efekti */
.sidebar.collapsed .menu li a:hover {
    padding-left: 0; /* Kayma efektini iptal et */
    background: var(--menu-hover-bg);
}

/* Logo Alanı (Kare ve Beyaz Çerçeve) */
.sidebar-logo-container {
    padding: 25px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2); /* Logo alanı altı hafif koyu */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.logo-frame {
    width: 140px;  /* Kare Genişlik */
    height: 140px; /* Kare Yükseklik */
    background: #ffffff;
    border-radius: 12px; /* Köşeleri hafif yumuşatılmış */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3); /* Derinlik hissi veren gölge */
    border: 3px solid rgba(255,255,255,0.1); /* Dışına ince bir çerçeve efekti */
}

.logo-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Resmi bozmadan sığdır */
}

/* Menü Listesi */
.menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    margin: 0;
    list-style: none;
}

/* Scrollbar Özelleştirme */
.menu::-webkit-scrollbar { width: 5px; }
.menu::-webkit-scrollbar-track { background: transparent; }
.menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
.menu::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Menü Başlıkları (LABEL) */
.menu-label {
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-top: 25px;
    margin-bottom: 10px;
    padding-left: 15px;
    opacity: 0.9;
    border-left: 0;
    white-space: nowrap; /* Yazı kaymasını engelle */
    transition: all 0.2s ease;
}

/* Menü Linkleri */
.menu li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--menu-text-color);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-bottom: 6px;
    position: relative;
    border-left: 3px solid transparent;
    white-space: nowrap; /* Yazıların alt satıra inmesini engelle */
}

/* İkonlar */
.menu li a i {
    width: 28px;
    font-size: 1.1rem;
    text-align: center;
    margin-right: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease, margin 0.3s ease;
}

/* Hover Efekti */
.menu li a:hover {
    background: var(--menu-hover-bg);
    color: #ffffff;
    padding-left: 20px;
    border-left-color: rgba(255,255,255,0.3);
}

.menu li a:hover i {
    opacity: 1;
    transform: scale(1.1);
    color: #60a5fa;
}

/* Aktif Sayfa */
.menu li.active a {
    background: var(--menu-active-bg);
    color: #ffffff;
    box-shadow: var(--menu-active-shadow);
    font-weight: 600;
    border-left: 0;
}

.menu li.active a i {
    opacity: 1;
    color: #ffffff;
}

/* Çıkış Butonu */
.logout {
    margin-top: 20px;
    padding-top: 15px;
    padding-bottom: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout a {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05);
    justify-content: center;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.logout a:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    border-color: #ef4444;
    padding-left: 16px !important;
}

/* Mobil Uyumluluk */
@media (max-width: 992px) {
    .sidebar {
        left: calc(var(--sidebar-width) * -1); /* Varsayılan gizli */
        width: var(--sidebar-width); /* Mobilde daraltma olmaz, tam genişlik */
    }
    .sidebar.active {
        left: 0; /* Açılınca görünür */
    }
    /* Mobilde daraltılmış mod sınıfları çalışmasın */
    .sidebar.collapsed {
        width: var(--sidebar-width);
    }
    .sidebar.collapsed .menu li a {
        font-size: 0.95rem;
        padding: 12px 16px;
        justify-content: flex-start;
    }
    .sidebar.collapsed .sidebar-logo-container {
        display: flex;
    }
}