/* Android uygulaması (TWA) ve ana ekrana eklenmiş site için alt sekme menüsü.
   Yalnız html.mig-app sınıfı varken görünür; normal web sitesi etkilenmez. */
.mig-app-tabbar { display: none; }

html.mig-app { --mig-tabbar-h: 58px; }

html.mig-app body {
    padding-bottom: calc(var(--mig-tabbar-h) + env(safe-area-inset-bottom, 0px));
}

html.mig-app .mig-app-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(var(--mig-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: #fff;
    border-top: 1px solid #e4e7eb;
    box-shadow: 0 -4px 18px rgba(29, 41, 59, .08);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mig-app-tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 6px 2px 4px;
    border: 0;
    background: transparent;
    color: #6b7686;
    font: 600 10.5px/1.1 "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
    letter-spacing: .1px;
    text-decoration: none;
    cursor: pointer;
}

.mig-app-tab svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .15s ease;
}

.mig-app-tab span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mig-app-tab.is-active,
.mig-app-tab[aria-expanded="true"] { color: #d04400; }

.mig-app-tab.is-active svg { stroke-width: 2.3; }

.mig-app-tab:active svg { transform: scale(.9); }

.mig-app-tab-live { position: relative; }

.mig-app-tab-live::after {
    content: "";
    position: absolute;
    top: 7px;
    left: calc(50% + 8px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef3340;
    box-shadow: 0 0 0 2px #fff;
}

/* Sabit konumlu öğeler sekme çubuğunun üstünde kalsın. */
html.mig-app .back-to-top {
    bottom: calc(var(--mig-tabbar-h) + 14px + env(safe-area-inset-bottom, 0px)) !important;
}

html.mig-app .mig-notification-optin {
    bottom: calc(var(--mig-tabbar-h) + 62px + env(safe-area-inset-bottom, 0px)) !important;
}

html.mig-app .mig-cookie-banner {
    bottom: calc(var(--mig-tabbar-h) + 8px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Sayfa geçişi ilerleme çubuğu (yalnız uygulamada eklenir). */
.mig-app-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100001;
    width: 0;
    height: 3px;
    background: #d04400;
    box-shadow: 0 0 6px rgba(208, 68, 0, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.mig-app-progress.is-loading {
    opacity: 1;
    animation: mig-app-progress 8s cubic-bezier(.1, .7, .2, 1) forwards;
}

@keyframes mig-app-progress {
    0% { width: 0; }
    20% { width: 45%; }
    100% { width: 92%; }
}

/* Bağlantı durumu uyarısı */
.mig-app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--mig-tabbar-h, 0px) + 14px + env(safe-area-inset-bottom, 0px));
    z-index: 100001;
    max-width: calc(100% - 32px);
    padding: 10px 16px;
    border-radius: 999px;
    background: #1d293b;
    color: #fff;
    font: 600 13px/1.3 "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translate(-50%, 12px);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.mig-app-toast.is-offline { background: #b3261e; }

.mig-app-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .mig-app-progress.is-loading { animation: none; width: 70%; }
    .mig-app-toast { transition: none; }
}

@media print {
    html.mig-app .mig-app-tabbar { display: none; }
    html.mig-app body { padding-bottom: 0; }
}
