/* Egypt Stack PWA - Mobile App Mode */
.mobile-menu-overlay {
    display: none; /* Hidden by default on all screens */
}

@media screen and (max-width: 1024px) {
    :root {
        --safe-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.app-mode {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.app-mode main.container {
        flex: 1;
        overflow-y: auto;
        padding-bottom: calc(80px + var(--safe-bottom));
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    /* Hide desktop elements on mobile */
    body.app-mode header, 
    body.app-mode .site-nav,
    body.app-mode .site-footer,
    body.app-mode .desktop-only {
        display: none !important;
    }

    /* Prevent floating buttons from covering the bottom nav */
    body.app-mode .floating-buttons {
        bottom: calc(85px + var(--safe-bottom)) !important;
        z-index: 9000 !important;
    }

    /* Bottom Navigation Bar */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(65px + var(--safe-bottom));
        background: var(--fx-glass-strong);
        backdrop-filter: blur(20px);
        border-top: 1px solid var(--fx-line);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding-bottom: var(--safe-bottom);
        z-index: 99998;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
    }

    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--fx-muted);
        font-size: 10px;
        font-weight: 500;
        transition: all 0.3s ease;
        position: relative;
    }

    .nav-item i {
        font-size: 24px;
        margin-bottom: 4px;
        transition: transform 0.3s ease;
    }

    .nav-item.active {
        color: var(--fx-brand);
    }

    .nav-item.active i {
        transform: translateY(-4px);
    }

    /* Notification Badge */
    .notif-badge {
        position: absolute;
        top: -4px;
        right: 4px;
        background: #ef4444;
        color: white;
        font-size: 8px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid white;
        font-weight: 700;
    }

    /* Slide Transitions */
    .page-exit {
        opacity: 0;
        transform: translateX(-20px);
        transition: all 0.3s ease;
    }

    .page-enter {
        opacity: 0;
        transform: translateX(20px);
        animation: slideIn 0.4s forwards;
    }

    @keyframes slideIn {
        to { opacity: 1; transform: translateX(0); }
    }

    /* Skeleton Loader */
    .skeleton {
        background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
        border-radius: 8px;
    }

    @keyframes loading {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }

    /* Mobile Menu Overlay */
    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(10, 14, 26, 0.95);
        backdrop-filter: blur(15px);
        z-index: 99999;
        display: none;
        flex-direction: column;
        padding: 40px 20px;
        animation: fadeIn 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: flex !important;
    }

    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 40px;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        color: white;
        font-size: 32px;
        cursor: pointer;
    }

    .mobile-menu-links {
        display: flex;
        flex-direction: column;
        gap: 20px;
        overflow-y: auto;
    }

    .mobile-menu-link {
        color: white;
        text-decoration: none;
        font-size: 20px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 12px;
        border-radius: 12px;
        transition: background 0.2s;
    }

    .mobile-menu-link:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-menu-link i {
        font-size: 24px;
        color: var(--fx-brand);
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}
