/* Bottom Navigation Bar - Mobile App Style */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    padding: 0 8px;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.2s, transform 0.15s;
    min-height: 60px;
    position: relative;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

.bottom-nav-item i {
    font-size: 22px;
    transition: transform 0.2s;
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item .count-badge,
.bottom-nav-item .badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(12px);
    background: #ef4444;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    padding: 0 4px;
    border: 2px solid var(--bg-color);
}

/* More sheet (bottom sheet) */
.more-sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.more-sheet-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.more-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1101;
    max-height: min(70vh, 420px);
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.16);
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.more-sheet.is-open {
    transform: translateY(0);
}

.more-sheet__handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #dbe3ef;
    margin: 4px auto 12px;
    flex-shrink: 0;
}

.more-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.more-sheet__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-color);
}

.more-sheet__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f4f6f9;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.more-sheet__close:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.more-sheet__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.more-sheet__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e8eef5;
    background: #f8fbff;
    text-decoration: none;
    color: var(--text-color);
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.more-sheet__item:active {
    transform: scale(0.985);
}

.more-sheet__item.is-active,
.more-sheet__item:hover {
    border-color: #cfe0f5;
    background: var(--primary-light);
}

.more-sheet__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.more-sheet__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.more-sheet__text strong {
    font-size: 0.925rem;
    font-weight: 700;
}

.more-sheet__text small {
    font-size: 0.75rem;
    color: var(--text-light);
}

.more-sheet__chevron {
    color: #94a3b8;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Show bottom nav only on mobile */
@media (max-width: 768px) {
    .bottom-nav {
        display: block;
    }

    body.more-sheet-open {
        overflow: hidden;
        touch-action: none;
    }

    /* Footer provides clearance for fixed bottom nav */
    body {
        padding-bottom: 0;
    }
}

@media (min-width: 769px) {
    .more-sheet,
    .more-sheet-overlay {
        display: none !important;
    }
}

/* Hide bottom nav on dashboard pages */
.dashboard .bottom-nav,
body:has(.dashboard) .bottom-nav {
    display: none;
}

body:has(.dashboard) {
    padding-bottom: 0;
}
