﻿/* ============================================================
   LAFNavMenu + LAFNavMenuItem — birleşik stil dosyası
   Kullanım: index.html içinde referans verin:
     <link rel="stylesheet" href="laf_navmenu_styles.css" />
   ============================================================ */

/* ===========================================================
   SIDEBAR (LAFNavMenu)
   =========================================================== */

.laf-sidebar {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--mud-palette-background);
    border-right: 1px solid var(--mud-palette-lines-default);
}

/* ───── MOBİL LOGO BANDI (yalnızca Lg altında) ───── */
.laf-sidebar-logo {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    height: 49px;
    padding: 6px 12px;
    background: linear-gradient(to right, var(--mud-palette-surface), var(--mud-palette-background));
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

@media (max-width: 1279.95px) {
    .laf-sidebar-logo {
        display: flex;
    }
}

.laf-sidebar-logo-custom {
    height: 36px;
    object-fit: scale-down;
    border-radius: 8px;
    background: white;
    box-shadow: var(--LAF-base-box-shadow);
    cursor: pointer;
}

.laf-sidebar-logo-default {
    height: 24px;
    object-fit: scale-down;
}

/* ───── SABİT ARAMA ───── */
.laf-sidebar-search {
    flex-shrink: 0;
    padding: 4px 8px 0;
    height: 52px;
    background: linear-gradient(to right, var(--mud-palette-surface), var(--mud-palette-background));
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* ───── SCROLLABLE GÖVDE ───── */
.laf-sidebar-body {
    flex: 1 1 0;
    overflow-y: auto;
    min-height: 0;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-lines-default) transparent;
}

    .laf-sidebar-body::-webkit-scrollbar {
        width: 4px;
    }

    .laf-sidebar-body::-webkit-scrollbar-thumb {
        background: var(--mud-palette-lines-default);
        border-radius: 4px;
    }

.laf-group-wrapper {
    margin-bottom: 10px;
}

.laf-nav-inner {
    display: flex;
    flex-direction: column;
    padding: 2px 0 4px;
}

/* ───── YAPRAK KÖK ÖĞE (alt öğesi olmayan root) ───── */
.laf-leaf-root {
    display: flex;
    align-items: center;
    padding: 9px 10px; /* 6px → 9px */
    margin: 2px 4px; /* 1px → 2px */
    border-radius: 6px;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    transition: background 0.15s ease, color 0.15s ease;
}

    .laf-leaf-root:hover {
        background: var(--mud-palette-primary-hover);
        color: var(--mud-palette-primary);
    }

/* ───── FOOTER ───── */
.laf-sidebar-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px !important;
    background: linear-gradient(to right, var(--mud-palette-surface), var(--mud-palette-background)) !important;
    border-top: 1px solid var(--mud-palette-lines-default);
    border-radius: 0 !important;
}

.laf-footer-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.laf-footer-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

.laf-footer-userinfo {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.laf-footer-username {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.laf-footer-userrole {
    font-size: 0.6875rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.laf-footer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.laf-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--mud-palette-text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
}

    .laf-footer-btn:hover {
        background: var(--mud-palette-action-hover);
        color: var(--mud-palette-primary);
    }

/* ===========================================================
   AĞAÇ ÖĞESİ (LAFNavMenuItem)
   =========================================================== */

/* ───── DAL DÜĞÜMÜ ───── */
.laf-navitem-group {
    display: flex;
    flex-direction: column;
}

/* Dal başlığı (aç/kapa satırı) — alt öğesi olduğu için altı çizili */
.laf-navitem-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 10px; /* 8px → 11px */
    margin: 3px 4px; /* 2px → 3px */
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    color: var(--mud-palette-text-primary);
    user-select: none;
    transition: background 0.15s ease;
}

    .laf-navitem-header:hover {
        background: var(--mud-palette-action-hover);
    }

.laf-navitem-chevron {
    flex-shrink: 0;
    color: var(--mud-palette-text-secondary);
    transition: transform 0.22s ease;
}

.laf-navitem-group.expanded > .laf-navitem-header .laf-navitem-chevron {
    transform: rotate(90deg);
}

/* ───── SAF CSS COLLAPSE (grid-template-rows) ───── */
.laf-navitem-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
}

.laf-navitem-group.expanded > .laf-navitem-collapse {
    grid-template-rows: 1fr;
}

.laf-navitem-collapse-inner {
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    border-left: 2px solid var(--mud-palette-primary-lighten);
    margin-left: 14px;
}

/* ───── YAPRAK ÖĞE ───── */
.laf-navitem-leaf {
    display: flex;
    align-items: center;
    padding: 11px 10px; /* 8px → 11px */
    margin: 3px 4px; /* 2px → 3px */
    border-radius: 6px;
    cursor: pointer;
    color: var(--mud-palette-text-primary);
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

    .laf-navitem-leaf:hover {
        background: var(--mud-palette-primary-hover);
        color: var(--mud-palette-primary-lighten);
    }

    .laf-navitem-leaf.laf-navitem-selected,
    .laf-navitem-leaf.laf-navitem-selected:hover {
        background: var(--mud-palette-primary);
        color: var(--mud-palette-primary-text);
    }

.laf-navitem-caption {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
