﻿/* Tabs: shared layout */
.tabs {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.tabs-nav {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tabs-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tab-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: none;
    color: var(--sc-text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
}

.tab-button:active {
    transform: scale(0.94);
}

.tab-button.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tab-icon {
    position: relative;
    display: inline-flex;
}

.tab-subtext {
    margin-top: 2px;
    color: var(--sc-text-faint);
    font-size: 10px;
    font-weight: 700;
}

.tabs-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.tabs-panel-inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Segmented: text tabs in a pill track */
.tabs-segmented > .tabs-nav {
    flex-shrink: 0;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border-radius: var(--sc-radius-pill);
    background: var(--sc-bg-elevated);
    box-shadow: inset 0 0 0 1px var(--sc-line);
}

.tabs-segmented > .tabs-nav > .tabs-item {
    flex: 1;
}

.tabs-segmented > .tabs-nav .tab-button {
    width: 100%;
    min-height: 40px;
    padding: 6px 10px;
    border-radius: var(--sc-radius-pill);
    font-family: var(--sc-font-display);
    font-size: 15px;
    font-weight: 600;
}

.tabs-segmented > .tabs-nav .tab-button ion-icon {
    font-size: 18px;
}

.tabs-segmented > .tabs-nav .tab-button.active {
    background: var(--sc-surface-3);
    color: var(--sc-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--sc-line-strong);
}

.tabs-segmented > .tabs-nav .notification-dot {
    top: -3px;
    right: -7px;
    width: 8px;
    height: 8px;
}

/* Icons: compact filter chips for sections nested inside a screen */
.tabs-icons > .tabs-nav {
    flex-shrink: 0;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 2px;
    overflow-x: auto;
    /* Still swipeable, but without a scrollbar sitting on top of the chips */
    scrollbar-width: none;
}

.tabs-icons > .tabs-nav::-webkit-scrollbar {
    display: none;
}

.tabs-icons > .tabs-nav .tab-button {
    min-width: 48px;
    min-height: 38px;
    padding: 6px 12px;
    white-space: nowrap;
    border-radius: var(--sc-radius-pill);
    background: var(--sc-surface);
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--sc-line);
}

.tabs-icons > .tabs-nav .tab-button ion-icon {
    font-size: 18px;
}

.tabs-icons > .tabs-nav .tab-button.active {
    background: var(--sc-primary-soft);
    color: var(--sc-primary);
    box-shadow: inset 0 0 0 1px rgba(var(--sc-primary-rgb), 0.45);
}

/* Bottom: the app's main tab bar */
.tabs-bottom > .tabs-panel {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Screens keep their natural height and scroll; letting them shrink would crush overflow-hidden children */
.tabs-bottom > .tabs-panel > .tabs-panel-inner {
    flex: 1 0 auto;
    padding: 16px 16px calc(var(--sc-tabbar-height) + var(--sc-safe-bottom) + 24px);
}

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 0 8px var(--sc-safe-bottom);
    border-top: 1px solid var(--sc-line);
    background: rgba(var(--sc-bg-rgb), 0.88);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    backdrop-filter: blur(18px) saturate(1.4);
}

.tabbar .tabs-nav {
    justify-content: space-around;
    max-width: 560px;
    height: var(--sc-tabbar-height);
    margin: 0 auto;
}

.tabbar .tabs-item {
    flex: 1;
    justify-content: center;
}

.tabbar .tab-button {
    flex-direction: column;
    gap: 2px;
    width: 100%;
    height: 100%;
    padding: 6px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tabbar .tab-button ion-icon,
.tabbar .tab-button .sk-nav-icon {
    font-size: 24px;
    transition: transform 0.25s var(--sc-ease-spring);
}

.tabbar .tab-button.active {
    color: var(--sc-primary);
}

.tabbar .tab-button.active ion-icon,
.tabbar .tab-button.active .sk-nav-icon {
    transform: translateY(-2px) scale(1.1);
    filter: drop-shadow(0 0 8px rgba(var(--sc-primary-rgb), 0.6));
}

/* Active indicator bar */
.tabbar .tab-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--sc-primary);
    box-shadow: 0 0 10px var(--sc-primary);
    transform: translateX(-50%);
    transition: width 0.3s var(--sc-ease-spring);
}

.tabbar .tab-button.active::after {
    width: 28px;
}

/* The Scan tab is the game's main action, so it gets a raised button */
.tabbar .tabs-item.is-primary .tab-button {
    color: var(--sc-text-muted);
}

.tabbar .tabs-item.is-primary .tab-icon {
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-top: -26px;
    border-radius: 50%;
    background: var(--sc-gradient-primary);
    color: #071022;
    box-shadow: 0 0 0 5px var(--sc-bg), 0 8px 24px rgba(var(--sc-primary-rgb), 0.45);
    transition: transform 0.25s var(--sc-ease-spring), box-shadow 0.25s ease;
}

.tabbar .tabs-item.is-primary .tab-icon .sk-scan-icon {
    --sk-scan-glint: #7ff8db;
}

.tabbar .tabs-item.is-primary .tab-icon ion-icon {
    font-size: 28px;
    transform: none;
    filter: none;
}

.tabbar .tabs-item.is-primary .tab-button::after {
    display: none;
}

.tabbar .tabs-item.is-primary .tab-button.active {
    color: var(--sc-primary);
}

.tabbar .tabs-item.is-primary .tab-button.active .tab-icon {
    transform: scale(1.06);
    box-shadow: 0 0 0 5px var(--sc-bg), 0 0 28px rgba(var(--sc-primary-rgb), 0.75);
}

.tabbar .tabs-item.is-primary .tab-button:not(.active) .tab-icon {
    animation: tabbar-scan-pulse 2.6s ease-in-out infinite;
}

.tabbar .notification-dot {
    top: -2px;
    right: -6px;
}

@keyframes tabbar-scan-pulse {
    0%, 100% { box-shadow: 0 0 0 5px var(--sc-bg), 0 8px 24px rgba(var(--sc-primary-rgb), 0.45); }
    50% { box-shadow: 0 0 0 5px var(--sc-bg), 0 8px 32px rgba(var(--sc-primary-rgb), 0.8); }
}
