/* ═══════════════════════════════════════════════════
   PWA BAR — Apple iOS floating pill
   Bağımlılık yok. main.css CSS değişkenlerini kullanır.
   NOT: <div id="pwaBar"> kullanılır — header.css nav{} ile çakışmaz.
   ═══════════════════════════════════════════════════ */

#pwaBar {
    display: none;
    position: fixed;
    top: auto;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));

    /* Tam ortalama — left:50% + translateX(-50%) */
    left: 50%;

    width: calc(100vw - 32px);
    max-width: 540px;
    height: 64px;
    padding: 0 4px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1100;

    /* Header ile aynı glass değişkenleri */
    background: var(--nav-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur-webkit);
    border: 0.5px solid var(--nav-border);
    border-radius: 24px;

    /* Header'dan farklı olarak floating pill gölgesi */
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.40),
        0 2px 8px  rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    flex-direction: row;
    align-items: center;
    justify-content: space-around;

    /* Scroll animasyonu: translateX(-50%) ortalama korunur */
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    transition:
        transform 0.46s cubic-bezier(0.16, 1, 0.3, 1),
        opacity   0.32s ease;
}

/* Light mode gölgesi */
@media (prefers-color-scheme: light) {
    #pwaBar {
        box-shadow:
            0 8px 30px rgba(0, 0, 0, 0.08),
            0 2px 8px  rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.90);
    }
}

/* ── Göster: CSS media query (standalone PWA) ── */
@media (display-mode: standalone) {
    #pwaBar { display: flex; }
    body     { padding-bottom: calc(64px + 80px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Göster: iOS navigator.standalone → JS class ── */
#pwaBar.pwa-active { display: flex; }
body.pwa-mode      { padding-bottom: calc(64px + 80px + env(safe-area-inset-bottom, 0px)); }

/* ── Gizle: scroll başladığında JS ekler ── */
#pwaBar.pwa-hidden {
    transform: translateX(-50%) translateY(calc(100% + 100px));
    opacity: 0;
    pointer-events: none;
}

/* ═══════════════════════════
   ÖĞELER
   ═══════════════════════════ */
.pwa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
    padding: 6px 0;
    text-decoration: none;
    color: var(--text-secondary);
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
    cursor: pointer;
}

/* İkon sarmalayıcısı — Apple pill vurgusu */
.pwa-item .pwa-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 32px;
    border-radius: 16px;
    color: inherit;
    flex-shrink: 0;
    transition:
        background 0.18s ease,
        transform  0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-item .pwa-icon-wrap svg {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}

/* Etiket */
.pwa-item .pwa-label {
    font-family: var(--font-main), -apple-system, 'SF Pro Text', sans-serif;
    font-size: 9.5px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    line-height: 1;
    color: inherit;
    transition: color 0.18s ease;
    user-select: none;
}

/* Hover — mouse */
.pwa-item:hover { color: var(--text-primary); }
.pwa-item:hover .pwa-icon-wrap { background: rgba(120, 120, 128, 0.22); }

@media (prefers-color-scheme: light) {
    .pwa-item:hover .pwa-icon-wrap { background: rgba(60, 60, 67, 0.12); }
}

/* Active — dokunma */
.pwa-item:active { color: var(--text-primary); }
.pwa-item:active .pwa-icon-wrap {
    background: rgba(120, 120, 128, 0.30);
    transform: scale(0.88);
}

@media (prefers-color-scheme: light) {
    .pwa-item:active .pwa-icon-wrap { background: rgba(60, 60, 67, 0.18); }
}

/* Aktif sayfa */
.pwa-item.pwa-current              { color: #4285F4; }
.pwa-item.pwa-current .pwa-icon-wrap { background: rgba(66, 133, 244, 0.15); }
.pwa-item.pwa-current:hover        { color: #5a9bf6; }
