/* ========================================
   MOBILE BOTTOM NAVIGATION
   Modern, Accessible, Touch-Optimized
   ======================================== */

/* Variables */
:root {
    --mobile-nav-height: 64px;
    --mobile-nav-bg: #ffffff;
    --mobile-nav-border: #e9e7e1;
    --mobile-nav-item-color: #5e5e5e;
    --mobile-nav-item-active: #1a3a5c;
    --mobile-nav-fab-bg: linear-gradient(135deg, #1a3a5c 0%, #0d1f35 100%);
    --mobile-nav-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}

/* Only show on mobile */
.mobile-nav {
    display: none;
}

@media (max-width: 900px) {
    .mobile-nav {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--mobile-nav-height);
        background: var(--mobile-nav-bg);
        border-top: 1px solid var(--mobile-nav-border);
        box-shadow: var(--mobile-nav-shadow);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
    }

    /* Grid layout */
    .mobile-nav__list {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    /* Nav items */
    .mobile-nav__item {
        position: relative;
    }

    .mobile-nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        height: 100%;
        padding: 6px 8px;
        color: var(--mobile-nav-item-color);
        text-decoration: none;
        font-size: 11px;
        font-weight: 600;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    /* Icon container */
    .mobile-nav__icon {
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav__icon svg {
        width: 22px;
        height: 22px;
        stroke-width: 2;
        transition: all 0.2s ease;
    }

    /* Active state */
    .mobile-nav__link.is-active {
        color: var(--mobile-nav-item-active);
    }

    .mobile-nav__link.is-active .mobile-nav__icon svg {
        stroke-width: 2.5;
        transform: scale(1.1);
    }

    /* Focus state (accessibility) */
    .mobile-nav__link:focus-visible {
        outline: 2px solid var(--mobile-nav-item-active);
        outline-offset: -2px;
        border-radius: 8px;
    }

    /* Touch feedback */
    .mobile-nav__link:active {
        transform: scale(0.95);
    }

    /* FAB (Floating Action Button) - Center item */
    .mobile-nav__item--fab {
        position: relative;
    }

    .mobile-nav__item--fab .mobile-nav__link {
        position: absolute;
        top: -20px;
        left: 50%;
        transform: translateX(-50%);
        width: 56px;
        height: 56px;
        background: var(--mobile-nav-fab-bg);
        border-radius: 50%;
        box-shadow: 0 4px 16px rgba(26, 58, 92, 0.25);
        padding: 0;
    }

    .mobile-nav__item--fab .mobile-nav__icon {
        width: 28px;
        height: 28px;
    }

    .mobile-nav__item--fab .mobile-nav__icon svg {
        width: 26px;
        height: 26px;
        stroke: #ffffff;
        stroke-width: 2.5;
    }

    .mobile-nav__item--fab .mobile-nav__text {
        position: absolute;
        bottom: -18px;
        font-size: 10px;
        color: var(--mobile-nav-item-active);
    }

    /* Add body padding for fixed nav */
    body {
        padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    }

    /* Smooth scroll behavior */
    html {
        scroll-padding-bottom: calc(var(--mobile-nav-height) + 20px);
    }
}

/* ========================================
   MOBILE MENU MODAL
   Full-screen overlay with slide-up animation
   ======================================== */

.mobile-menu-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-modal__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-menu-modal.is-open .mobile-menu-modal__content {
    transform: translateY(0);
}

/* Header */
.mobile-menu-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 2px solid #e9e7e1;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
}

.mobile-menu-modal__title {
    font-size: 20px;
    font-weight: 800;
    color: #0a1628;
}

.mobile-menu-modal__close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f7f5;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-modal__close:active {
    transform: scale(0.9);
}

.mobile-menu-modal__close svg {
    width: 20px;
    height: 20px;
    color: #0a1628;
}

/* Body */
.mobile-menu-modal__body {
    padding: 16px;
}

/* Category Groups */
.category-group {
    margin-bottom: 20px;
}

.category-group__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 0 8px;
}

.category-group__badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 6px;
    color: #fff;
}

.category-group__badge--purple {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.category-group__badge--pink {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.category-group__title {
    font-size: 14px;
    font-weight: 700;
    color: #0a1628;
}

/* Category Items - Minimal List */
.category-group__items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.category-item {
    display: block;
    padding: 10px 12px;
    background: #f8f7f5;
    border-radius: 8px;
    color: #5e5e5e;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.category-item:active {
    transform: scale(0.96);
    background: #1a3a5c;
    color: #fff;
}

/* Show modal only on mobile */
@media (max-width: 900px) {
    .mobile-menu-modal {
        display: block;
    }
}

/* Prevent body scroll when modal open */
body.menu-open {
    overflow: hidden;
}
