/* Mobile Bottom Navigation Bar */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    /* Minimum height for 24px icon + text */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    display: none;
    /* Hidden by default */
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.04);
    z-index: 9999;
    /* Ensure it stays on top of everything */
    padding: 0;
    /* Eliminate all "air" */
}

/* Bottom Nav Language Dropdown Tweak (From Study Page) */
.bottom-nav #languageSelectWrapperBottom {
    width: auto !important;
    flex: 1 1 0px;
    /* Force equal width */
    min-width: 0;
    /* Allow shrinking */
    margin: 0;
    display: block !important;
}

.bottom-nav #languageSelectWrapperBottom .custom-select {
    width: 100% !important;
    height: 100%;
}

.bottom-nav #languageSelectWrapperBottom .custom-select-trigger {
    height: 100% !important;
    /* Fill container */
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 14px !important;
    /* Increased from 10px */
    color: #64748b !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    gap: 1px !important;
}

.bottom-nav #languageSelectWrapperBottom .custom-select-trigger svg {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    margin-bottom: 0;
    stroke: currentColor;
    stroke-width: 2;
    display: block !important;
    /* Ensure no inline baseline offset */
    pointer-events: none;
    /* Ensure clicks pass through to trigger */
}

.bottom-nav #languageSelectWrapperBottom .custom-select-trigger span {
    font-weight: 600 !important;
    line-height: 1.2;
    margin: 0 !important;
    /* Reset generic dropdown margins */
    text-align: center !important;
    flex-grow: 0 !important;
}

.bottom-nav #languageSelectWrapperBottom .custom-options {
    bottom: 50px !important;
    /* Push up above the bar explicitly */
    top: auto !important;
    max-height: 50vh;
    /* Limit height to prevent going off top */
    overflow-y: auto;
    margin-bottom: 5px;
    border-radius: 12px 12px 0 0 !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2) !important;
    z-index: 10000 !important;
    /* Super high z-index */
    position: fixed !important;
    /* Fixed relative to viewport to avoid parent overflow clipping */
    width: auto !important;
    min-width: 120px;
    max-width: 90vw;
    right: 10px;
    left: auto;
    margin-left: 0;
    /* Center it */
}

.bottom-nav #languageSelectWrapperBottom .arrow {
    display: none !important;
    /* Hide arrow to match simple icon look of others */
}

/* Only show on mobile screens */
body.is-mobile .bottom-nav {
    display: flex;
}

/* Compensate bottom padding for main content when nav is visible */
body.is-mobile .container,
body.is-mobile .landing-sections,
body.is-mobile .content-area {
    padding-bottom: 59px !important;
    /* Reduced from 70px to match slimer nav */
    /* Reduced from 80px */
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    /* Restored from 9px */
    font-weight: 600;
    gap: 1px;
    /* Minimal gap */
    /* Minimal gap */
    flex: 1 1 0px;
    /* Force equal width */
    width: 0;
    /* Fallback for older browsers */
    height: 100%;
    margin: 0;
    padding: 0;
    transition: all 0.2s ease;
}

.bottom-nav-item svg {
    width: 24px;
    /* Restored from 20px */
    height: 24px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #2563eb;
}

.bottom-nav-item.active svg {
    opacity: 1;
    transform: translateY(-2px);
    stroke: #2563eb;
}

.bottom-nav-item.active span {
    font-weight: 600;
}


/* iOS-specific tweaks */
body.os-ios.is-mobile .bottom-nav {
    box-sizing: border-box !important;
    height: calc(44px + env(safe-area-inset-bottom, 0px)) !important;
    /* Content + Safe Area (Default 0 if not env) */
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    /* Dynamic Home indicator space */
}