/* ========================================
   Mobile Navigation Slide-in Menu
   Consolidated sidebar with all nav items
   ======================================== */

/* Mobile Upgrade Bar */
#mobileUpgradeBar {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Mobile Navigation Menu - Hidden by default */
.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(160deg, #1e3a8a 0%, #1e1b4b 60%, #0f172a 100%);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.mobile-nav-menu.active {
    transform: translateX(0);
}

/* Mobile Navigation Backdrop */
.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Menu Content */
.mobile-nav-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 1rem 1rem;
    padding-top: max(1rem, env(safe-area-inset-top, 1rem));
}

/* Mobile Navigation Menu Header - User profile area */
.mobile-nav-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.75rem;
}

.mobile-nav-menu-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.mobile-nav-menu-header p {
    font-size: 0.75rem;
    margin-top: 1px;
}

.mobile-nav-menu-header button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.mobile-nav-menu-header button:hover,
.mobile-nav-menu-header button:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Navigation Menu Items */
.mobile-nav-menu-items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Divider between sections */
.mobile-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 6px 0;
}

/* Nav item base style */
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    color: white;
    text-decoration: none;
    transition: all 0.15s ease;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-size: 0.9375rem;
    min-height: 52px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-nav-item.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.15);
}

.mobile-nav-item i:first-child {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.mobile-nav-item span {
    flex: 1;
    font-weight: 500;
}

.mobile-nav-item i.fa-chevron-right {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* Badge inside menu items */
.mobile-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #EF4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

/* Upgrade button - special styling */
.mobile-nav-upgrade {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-color: rgba(245, 158, 11, 0.25);
}

.mobile-nav-upgrade:active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(16, 185, 129, 0.2) 100%);
}

.mobile-nav-upgrade i:first-child {
    color: #fbbf24;
}

.mobile-nav-pro-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: #EF4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Logout button */
.mobile-nav-logout {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

.mobile-nav-logout:active {
    background: rgba(239, 68, 68, 0.15);
}

.mobile-nav-logout i:first-child {
    color: #f87171;
}

/* Sign-in button */
.mobile-nav-signin {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.mobile-nav-signin i:first-child {
    color: #60a5fa;
}

/* Footer section - pushed to bottom */
.mobile-nav-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Hide on desktop */
@media (min-width: 768px) {
    .mobile-nav-menu,
    .mobile-nav-backdrop {
        display: none !important;
    }
}

/* Ensure navigation tabs are hidden on mobile */
@media (max-width: 767px) {
    nav .hidden.md\:flex {
        display: none !important;
    }
    
    /* Force hide all desktop navigation links on mobile */
    nav .nav-link[data-page] {
        display: none !important;
    }
    
    /* Force hide sticky upgrade button on mobile */
    #stickyUpgradeButton {
        display: none !important;
    }
}

/* Smooth animations */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.mobile-nav-menu.active {
    animation: slideInFromRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
