/**
 * Navigation — Bottom Nav (Mobile) + Desktop Sidebar Menu
 * 
 * Bottom nav: floating pill, glassmorphism, 5 položek
 * Desktop menu: fixed sidebar vlevo, permanent
 * Kompatibilní se všemi 10 theme variantami
 */

/* ========== BOTTOM NAVIGATION ========== */
.bottom-nav {
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0px);
    left: 16px;
    right: 16px;
    z-index: 190;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 68px;
    background: var(--t-glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 999px;
    border: 1px solid var(--t-glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    padding: 0 8px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Schovat na desktopu */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* PWA standalone — extra offset pro gesture bar */
.pwa-standalone .bottom-nav {
    bottom: 16px;
}

/* Peek mode — scroll down hides navbar partially, tiny edge still visible */
.bottom-nav.is-scrolling {
    transform: translateY(calc(100% - 8px));
}

/* ========== BOTTOM NAV ITEMS ========== */
.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    min-width: 56px;
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--t-text-muted);
    transition: color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.bottom-nav__item:active {
    transform: scale(0.9);
}

.bottom-nav__item.active {
    color: var(--t-accent-solid);
}

.bottom-nav__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.bottom-nav__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
    text-align: center;
    width: 100%;
}

/* Central + button — larger, accent color */
.bottom-nav__item--add {
    position: relative;
    min-width: 64px;
}

.bottom-nav__item--add .bottom-nav__icon--add {
    width: 44px;
    height: 44px;
    color: var(--t-accent-solid);
    filter: drop-shadow(0 2px 8px rgba(239, 68, 68, 0.3));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.bottom-nav__item--add:active .bottom-nav__icon--add {
    transform: scale(0.85);
}

/* ========== DESKTOP SIDEBAR MENU ========== */
.desktop-menu {
    display: none;
}

@media (min-width: 768px) {
    .desktop-menu {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 100;
        width: 260px;
        display: flex;
        flex-direction: column;
        background: var(--t-sidebar-bg);
        border-right: 1px solid var(--t-glass-border);
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: var(--t-text-muted) transparent;
    }

    /* Main content offset */
    .app-layout--with-menu>header,
    .app-layout--with-menu>main,
    .app-layout--with-menu>footer {
        margin-left: 260px;
    }
}

/* ========== DESKTOP MENU — BRAND ========== */
.desktop-menu__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--t-glass-border);
}

.desktop-menu__brand .header__logo-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.desktop-menu__brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.desktop-menu__title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--t-accent-solid);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

.desktop-menu__subtitle {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--t-text-muted);
}

/* ========== DESKTOP MENU — NAV ITEMS ========== */
.desktop-menu__nav {
    display: flex;
    flex-direction: column;
    padding: 12px 12px 8px;
    gap: 2px;
}

.desktop-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--t-text);
    text-align: left;
    width: 100%;
    transition: background-color 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.desktop-menu__item:hover {
    background: var(--t-accent-muted);
}

.desktop-menu__item.active {
    background: var(--t-accent-muted);
    color: var(--t-accent-solid);
    font-weight: 600;
}

.desktop-menu__item.active svg {
    color: var(--t-accent-solid);
}

.desktop-menu__item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--t-text-muted);
    transition: color 0.15s ease;
}

.desktop-menu__item:hover svg {
    color: var(--t-text);
}

/* Add article — inside footer, above controls */
.desktop-menu__item--add {
    margin: 0 0 8px;
    color: var(--t-accent-solid);
    font-weight: 600;
}

.desktop-menu__item--add svg {
    color: var(--t-accent-solid);
}

.desktop-menu__item--add:hover {
    background: var(--t-accent-muted);
}

/* ========== DESKTOP MENU — DIVIDER ========== */
.desktop-menu__divider {
    height: 1px;
    background: var(--t-glass-border);
    margin: 8px 20px;
}

/* ========== DESKTOP MENU — FOOTER ========== */
.desktop-menu__footer {
    margin-top: auto;
    padding: 16px 20px 24px;
    border-top: 1px solid var(--t-glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.desktop-menu__controls {
    display: flex;
    gap: 8px;
}

.desktop-menu__control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--t-glass-bg);
    border: 1px solid var(--t-glass-border);
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.desktop-menu__control-btn:hover {
    background: var(--t-accent-muted);
}

.desktop-menu__control-btn:active {
    transform: scale(0.92);
}

.desktop-menu__date {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--t-text-muted);
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ========== FAB HIDE ON MOBILE (bottom-nav replaces it) ========== */
@media (max-width: 767px) {
    .fab-add {
        display: none !important;
    }
}

/* ========== MAIN PADDING FOR BOTTOM NAV ========== */
@media (max-width: 767px) {
    main {
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    }
}

/* ========== ACTIVE FILTER INDICATOR ========== */
.nav-filter-active {
    position: relative;
}

.nav-filter-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--t-accent-solid);
}

/* ========== THEME TRANSITION SUPPORT ========== */
.theme-transitioning .bottom-nav,
.theme-transitioning .desktop-menu {
    transition: background-color 0.4s, border-color 0.3s !important;
}

/* ========== HEADER SCROLL HIDE (PEEK) ========== */
@media (max-width: 767px) {
    header {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    header.is-scrolling {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }
}