﻿/* ============================================================
   LAFNavMenu + LAFNavMenuItem — birleşik stil dosyası
   Kullanım: index.html içinde referans verin:
     <link rel="stylesheet" href="laf_navmenu_styles.css" />

   NOT: Tıklanabilir menü satırları <div> değil <button>'dır.
   Sebep: @onclick'li bir <div>, Android Chrome açısından interaktif
   DEĞİLDİR → dokununca "Touch to Search" (alt arama çubuğu) ve uzun
   basışta metin seçim toolbar'ı tetiklenir. Gerçek buton bunları hiç
   denemez. Bu yüzden ilgili kurallarda buton reset'i + dokunma
   engelleri (user-select/touch-callout/tap-highlight) yer alır.
   ============================================================ */

/* ===========================================================
   SIDEBAR (LAFNavMenu)
   =========================================================== */

.laf-sidebar {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--LAF-palette-lines-divider);
}

/* ───── 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;
    border-bottom: 1px solid var(--LAF-palette-lines);
}

@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-default-paper-shadow);
    cursor: pointer;
}

.laf-sidebar-logo-default {
    height: 24px;
    object-fit: scale-down;
}

/* ───── SABİT ARAMA ───── */
.laf-sidebar-search {
    flex-shrink: 0;
    padding: 5px 10px 0;
    height: 52px;
    border-bottom: 1px solid var(--LAF-palette-lines-divider);
}

/* ───── SCROLLABLE GÖVDE ───── */
.laf-sidebar-body {
    flex: 1 1 0;
    overflow-y: auto;
    min-height: 0;
    padding: 10px;
}

.laf-group-wrapper {
    margin-bottom: 12px;
}

.laf-nav-inner {
    display: flex;
    flex-direction: column;
    padding: 2px 0 4px;
}

/* ───── YAPRAK KÖK ÖĞE (alt öğesi olmayan root) ─────
   <button> — LAFNavMenu.razor içinde de <button type="button"> olmalı. */
.laf-leaf-root {
    /* buton reset — görünüm eski <div> ile birebir aynı kalır */
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    line-height: inherit;
    text-align: left;
    box-sizing: border-box;
    /* LAFLayoutGridItem içinde: buton shrink-to-fit olur → tam genişlik ver.
       box-sizing:border-box + margin ile taşma olmaz. */
    width: calc(100% - 8px);
    display: flex;
    align-items: center;
    padding: 9px 10px;
    margin: 2px 4px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--LAF-palette-text-onprimary);
    transition: background 0.15s ease, color 0.15s ease;
    /* Android Touch to Search + seçim toolbar'ı engeli */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .laf-leaf-root:hover {
        background: var(--LAF-palette-primary-hover);
        color: var(--LAF-palette-primary);
    }

    .laf-leaf-root:focus {
        outline: none;
    }

    .laf-leaf-root:focus-visible {
        outline: 2px solid var(--LAF-palette-primary);
        outline-offset: -2px;
    }

/* ───── FOOTER ───── */
.laf-sidebar-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px !important;
    border-top: 1px solid var(--LAF-palette-lines-divider) !important;
    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(--LAF-palette-primary);
    color: var(--LAF-palette-text-onprimary);
}

.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(--LAF-palette-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.laf-footer-userrole {
    font-size: 0.6875rem;
    color: var(--LAF-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(--LAF-palette-text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .laf-footer-btn:hover {
        background: var(--LAF-palette-hover);
        color: var(--LAF-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.
   <button> — buton reset'i dahil.
   DİKKAT: `font: inherit` shorthand'i font-weight'i sıfırlar,
   bu yüzden `font-weight: 600` ondan SONRA gelmeli. */
.laf-navitem-header {
    /* buton reset */
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    line-height: inherit;
    text-align: left;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 10px;
    margin: 3px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    color: var(--LAF-palette-text);
    transition: background 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .laf-navitem-header:hover {
        background: var(--LAF-palette-hover);
    }

    .laf-navitem-header:focus {
        outline: none;
    }

    .laf-navitem-header:focus-visible {
        outline: 2px solid var(--LAF-palette-primary);
        outline-offset: -2px;
    }

.laf-navitem-chevron {
    flex-shrink: 0;
    color: var(--LAF-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;
}

/* flex column ZORUNLU: <button> çocuklar block konteynerde shrink-to-fit
   olur ve daralır; flex konteynerde align-items:stretch ile tam genişliğe
   yayılır. (width:100% yazmıyoruz — margin: 3px 4px ile taşma olurdu.) */
.laf-navitem-collapse-inner {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    border-left: 2px solid var(--LAF-palette-primary-lighten);
    margin-left: 14px;
}

/* ───── YAPRAK ÖĞE ───── */
.laf-navitem-leaf {
    /* buton reset */
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    line-height: inherit;
    text-align: left;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 11px 10px;
    margin: 3px 4px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--LAF-palette-text);
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

    .laf-navitem-leaf:hover {
        background: var(--LAF-palette-hover);
        color: var(--LAF-palette-text);
    }

    .laf-navitem-leaf.laf-navitem-selected,
    .laf-navitem-leaf.laf-navitem-selected:hover {
        background: var(--LAF-palette-primary);
        color: var(--LAF-palette-text-onprimary);
    }

    .laf-navitem-leaf:focus {
        outline: none;
    }

    .laf-navitem-leaf:focus-visible {
        outline: 2px solid var(--LAF-palette-primary);
        outline-offset: -2px;
    }

.laf-navitem-caption {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
