/* =====================================================
   mobile-nav.css — AstroPsycho Pro Mobile Navigation
   Bottom navigation bar + mobile-first enhancements
   ===================================================== */

/* ── Bottom Navigation Bar ───────────────────────────── */
.mob-nav {
    display: none;
    /* hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;

    /* Glassmorphism */
    background: rgba(10, 10, 31, 0.88);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    border-top: 1px solid rgba(100, 255, 218, 0.15);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5), 0 -1px 0 rgba(100, 255, 218, 0.08);

    /* Safe area: for iPhone home bar */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);

    display: none;
    /* overridden below in media query */
}

.mob-nav__inner {
    display: flex;
    align-items: stretch;
    height: 56px;
}

/* ── Each Tab Item ───────────────────────────────────── */
.mob-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: rgba(230, 230, 250, 0.5);
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 4px 2px;
    position: relative;
    transition: color 0.2s ease;
    font-family: 'Inter', sans-serif;
    min-height: 44px;
    /* Apple HIG tap target */
    -webkit-tap-highlight-color: transparent;
}

.mob-nav__item:hover,
.mob-nav__item.active {
    color: var(--accent-cyan, #64ffda);
}

.mob-nav__item.active .mob-nav__icon {
    transform: translateY(-2px) scale(1.15);
}

.mob-nav__item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--accent-cyan, #64ffda);
    border-radius: 0 0 3px 3px;
    box-shadow: 0 0 8px rgba(100, 255, 218, 0.7);
}

.mob-nav__icon {
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mob-nav__label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 1;
}

/* ── Ripple on tap ───────────────────────────────────── */
.mob-nav__item .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.3);
    transform: scale(0);
    animation: nav-ripple 0.5s linear;
    pointer-events: none;
}

@keyframes nav-ripple {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

/* ── "More" Drawer ───────────────────────────────────── */
.mob-more-drawer {
    display: none;
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(10, 10, 31, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(100, 255, 218, 0.2);
    padding: 1rem;
    animation: drawer-up 0.25s ease;
}

.mob-more-drawer.open {
    display: block;
}

@keyframes drawer-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mob-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
}

.mob-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--moon-silver, #e6e6fa);
    padding: 0.7rem 0.25rem;
    border-radius: 12px;
    background: rgba(100, 255, 218, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.1);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    min-height: 72px;
    -webkit-tap-highlight-color: transparent;
}

.mob-more-item:active {
    background: rgba(100, 255, 218, 0.15);
    transform: scale(0.96);
}

.mob-more-item__icon {
    font-size: 1.4rem;
    line-height: 1;
}

.mob-more-item__label {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    color: rgba(230, 230, 250, 0.7);
}

/* Drawer close btn */
.mob-more-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 auto 0.75rem;
    border: 1px solid rgba(100, 255, 218, 0.25);
    border-radius: 50%;
    color: var(--accent-cyan, #64ffda);
    font-size: 1rem;
    background: transparent;
    cursor: pointer;
}

/* ── Backdrop for "More" drawer ──────────────────────── */
.mob-more-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9997;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.mob-more-backdrop.open {
    display: block;
}

/* chart-container and svg rules are in styles.css — no override needed here */

/* ── Body spacing: content not hidden behind bottom nav ─ */

/* Explore Nav Grid — desktop default */
.explore-grid {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

@media (max-width: 768px) {
    .mob-nav {
        display: block;
    }

    body {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 8px));
    }

    /* --- Charts: force single column --- */
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md);
    }

    .chart-container {
        padding: 0;
        /* remove default padding so SVG fills the square */
    }

    /* Compact nav card styles for 3-column layout */
    .explore-grid .nav-card,
    #exploreNavSection .explore-grid .nav-card {
        padding: 0.65rem 0.5rem !important;
        border-radius: 10px !important;
    }

    .explore-grid .nav-card h4 {
        font-size: 0.78rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.3;
    }

    .explore-grid .nav-card p {
        font-size: 0.68rem !important;
        line-height: 1.35;
        margin-bottom: 0 !important;
    }

    /* We originally hid badge lines but now let flex handle it */
    .explore-grid .nav-card p:last-child {
        margin-top: auto !important;
        /* Push badge to bottom if it exists */
    }

    .explore-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }

    /* Prevent bottom nav overlap with fixed Hindi toggle */
    #hindiToggleBtn {
        bottom: calc(64px + env(safe-area-inset-bottom, 0px));
        top: auto !important;
    }
}

@media (max-width: 400px) {
    .explore-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.45rem !important;
    }
}

@media (max-width: 360px) {
    .explore-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.40rem !important;
    }
}

/* ── Hide on print ───────────────────────────────────── */
@media print {

    .mob-nav,
    .mob-more-drawer,
    .mob-more-backdrop {
        display: none !important;
    }
}