/**
 * @package     LoginSecure
 * @subpackage  App Menu
 * @copyright   Copyright (C) 2009 - 2026 LoginSecure. All rights reserved.
 */

/* === OVERLAY === */

.lsam-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc(var(--lsam-z-index) - 1);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lsam-overlay.lsam-visible {
    display: block;
    opacity: 1;
}

/* === WRAPPER === */

.lsam-app-menu-wrapper {
    --lsam-z-index: 1000000;
    --lsam-width: 435px;
    --lsam-grid-cols: 3;
    position: fixed;
    bottom: var(--ls-tabbar-total, 60px);
    right: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - var(--ls-tabbar-total, 60px));
    z-index: var(--lsam-z-index);
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0.35s;
    overflow: hidden;
}

@media (min-width: 435px) {
    .lsam-app-menu-wrapper {
        width: var(--lsam-width);
        max-width: var(--lsam-width);
    }
}

.lsam-app-menu-wrapper.lsam-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0s linear 0s;
}

/* === PANEL === */

.lsam-panel {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.lsam-panel.lsam-mode-dark {
    background: #1c1c1e;
}

/* === HEADER === */

.lsam-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    min-height: 52px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.lsam-mode-dark .lsam-header {
    border-bottom-color: #2c2c2e;
}

.lsam-btn-back,
.lsam-btn-reset,
.lsam-btn-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    color: #1c1c1e;
    font-size: 20px;
    padding: 0;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.lsam-mode-dark .lsam-btn-back,
.lsam-mode-dark .lsam-btn-reset,
.lsam-mode-dark .lsam-btn-close {
    color: #f5f5f7;
}

.lsam-btn-back:active,
.lsam-btn-reset:active,
.lsam-btn-close:active {
    background: rgba(0, 0, 0, 0.06);
}

.lsam-mode-dark .lsam-btn-back:active,
.lsam-mode-dark .lsam-btn-reset:active,
.lsam-mode-dark .lsam-btn-close:active {
    background: rgba(255, 255, 255, 0.08);
}

.lsam-btn-back[hidden] {
    visibility: hidden;
    pointer-events: none;
}

.lsam-btn-reset[hidden] {
    display: none;
}

.lsam-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #1c1c1e;
    flex: 1;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

.lsam-mode-dark .lsam-header-title {
    color: #f5f5f7;
}

/* === SCROLL AREA === */

.lsam-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* === VIEW SYSTEM === */

.lsam-view {
    display: none;
    width: 100%;
    padding: 8px 0 24px;
}

.lsam-view.lsam-view-active {
    display: block;
}

.lsam-view {
    animation: none;
}

.lsam-view.lsam-slide-in {
    animation: lsam-slide-in-right 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.lsam-view.lsam-slide-out {
    animation: lsam-slide-out-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.lsam-view.lsam-slide-back-in {
    animation: lsam-slide-back-in-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.lsam-view.lsam-slide-back-out {
    animation: lsam-slide-back-out-right 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes lsam-slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes lsam-slide-out-left {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(-30%); opacity: 0; }
}

@keyframes lsam-slide-back-in-left {
    from { transform: translateX(-30%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes lsam-slide-back-out-right {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* === LIST ITEMS (shared across all subtemplates) === */

.lsam-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    min-height: 48px;
    text-decoration: none;
    color: #1c1c1e;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.2;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.lsam-mode-dark .lsam-list-item {
    color: #f5f5f7;
}

.lsam-list-item:active {
    background: rgba(0, 0, 0, 0.05);
}

.lsam-mode-dark .lsam-list-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.lsam-list-item.lsam-item-active {
    color: #007aff;
}

.lsam-mode-dark .lsam-list-item.lsam-item-active {
    color: #0a84ff;
}

button.lsam-list-item .lsam-list-icon {
    display: flex !important;
}

.lsam-list-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: inherit;
    font-size: 18px;
}

.lsam-list-icon img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.lsam-list-label {
    flex: 1;
    font-size: 15px;
    line-height: 1.2;
}

.lsam-list-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #aaaaaa;
    font-size: 14px;
}