﻿/* ════════════════════════════════════════════════════════════════════════
   LAF_Popup stilleri — MudBlazor bağımsız.
   Menü LAF_Popup_Provider'da (MainLayout kökü) render edilir; transform/overflow
   container'ı yoktur, position:fixed gerçekten viewport'a göre çalışır.
   index.html / host'ta <link rel="stylesheet" href="laf_popup_styles.css"> ekleyin.
   ════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════
   Masaüstü — cursor pozisyonunda context menu
   ════════════════════════════════════════════════════════════════════════ */

.laf-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: transparent;
}

.laf-popup-menu {
    position: fixed;
    z-index: 9999;
    min-width: 200px;
    /* DİKKAT: overflow YOK. overflow-y:auto verilirse spec gereği overflow-x de
       auto'ya döner ve left:100% ile açılan flyout submenu kutu dışına taşıp
       yatay scroll yaratır + kırpılır. Dikey sığmayı JS (LAF_Popup_ClampMenu)
       flip + viewport'a oturtma ile zaten hallediyor. */
    overflow: visible;
    padding: 4px 0;
    background: var(--mud-palette-surface, #fff);
    border: 1px solid var(--mud-palette-divider, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .20);
    font-size: var(--LAF-base-font-size);
    font-weight: 600;
    font-family: inherit;
    color: var(--mud-palette-text-primary, #222);
    -webkit-user-select: none;
    user-select: none;
    outline: none;
    /* Başlangıç: görünmez + hafif yukarı/küçük (flicker engelleme + slide). */
    opacity: 0;
    transform: translateY(-6px) scale(.97);
    transform-origin: top left;
    transition: opacity .13s ease, transform .13s cubic-bezier(.34, 1.36, .64, 1);
    pointer-events: none;
}

.laf-popup-menu--shown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Yukarı flip edildiyse animasyon alt köşeden büyüsün. */
.laf-popup-menu--up {
    transform-origin: bottom left;
}

.laf-popup-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    font-size: var(--LAF-base-font-size);
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    color: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .1s;
}

    .laf-popup-item:hover {
        background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .06));
    }

    .laf-popup-item--disabled,
    .laf-popup-item:disabled {
        opacity: .4;
        cursor: default;
        pointer-events: none;
    }

.laf-popup-separator {
    height: 0;
    border-top: 1px solid var(--mud-palette-divider, #e0e0e0);
    margin: 4px 0;
}

.laf-popup-sub-arrow {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--mud-palette-text-secondary, #888);
}

.laf-popup-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -5px;
    min-width: 180px;
    padding: 4px 0;
    background: var(--mud-palette-surface, #fff);
    border: 1px solid var(--mud-palette-divider, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
    /* Flyout'un kendisi de uzun olabilir; o da kırpılmasın. */
    overflow: visible;
}

.laf-popup-item--has-sub:hover > .laf-popup-submenu {
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════
   Mobil — orta ekran panel
   ════════════════════════════════════════════════════════════════════════ */

.laf-popup-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: laf-popup-overlay-in .15s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

@keyframes laf-popup-overlay-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.laf-popup-mobile-panel {
    background: var(--mud-palette-surface, #fff);
    border-radius: 16px;
    min-width: 260px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 8px 0 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .28);
    display: flex;
    flex-direction: column;
    animation: laf-popup-panel-in .18s cubic-bezier(.34, 1.36, .64, 1);
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

@keyframes laf-popup-panel-in {
    from {
        transform: scale(.92);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.laf-popup-mobile-handle-inline {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--mud-palette-divider, #ddd);
    margin: 0 auto;
}

.laf-popup-mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-bottom: 1px solid var(--mud-palette-divider, #eee);
    margin-bottom: 4px;
}

    .laf-popup-mobile-header:has(.laf-popup-mobile-back) {
        justify-content: flex-start;
    }

.laf-popup-mobile-back {
    display: flex;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
    color: var(--mud-palette-primary, #1976d2);
    padding: 8px 12px;
    border-radius: 8px;
}

    .laf-popup-mobile-back:active {
        background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .06));
    }

.laf-popup-mobile-back-arrow {
    font-size: 1.5rem;
    line-height: 1;
    margin-top: -2px;
}

.laf-popup-mobile-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    text-align: left;
    font-size: var(--LAF-base-font-size);
    font-weight: 600;
    font-family: inherit;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--mud-palette-text-primary, #222);
    transition: background .1s;
}

    .laf-popup-mobile-item:active {
        background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .06));
    }

.laf-popup-mobile-item--disabled {
    opacity: .4;
    cursor: default;
}

.laf-popup-mobile-sub-arrow {
    font-size: 1.3rem;
    color: var(--mud-palette-text-secondary, #aaa);
}

.laf-popup-mobile-separator {
    height: 0;
    border-top: 1px solid var(--mud-palette-divider, #bbb);
    margin: 4px 0;
}
