/*
    FILE: mobile-app.css
    PURPOSE: Mobile app shell — bottom nav, install banner, safe areas
*/

:root {
    --mobile-nav-height: 4.25rem;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.has-mobile-nav {
    padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 0.5rem);
}

body.service-page.has-mobile-nav {
    padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 1rem);
}

.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    background: rgba(2, 6, 23, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-bottom: var(--safe-bottom);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

@media (max-width: 900px) {
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: var(--mobile-nav-height);
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-bottom-nav a i { font-size: 1.15rem; }
.mobile-bottom-nav a.active { color: #4ade80; }
.mobile-bottom-nav a.active i { color: #10b981; }

#pwaInstallBanner {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 0.75rem);
    z-index: 9998;
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.95), rgba(16, 185, 129, 0.9));
    color: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    font-size: 0.85rem;
}

#pwaInstallBanner.show { display: flex; }

#pwaInstallBanner .pwa-install-btn {
    border: none;
    border-radius: 0.65rem;
    padding: 0.5rem 0.85rem;
    font-weight: 700;
    background: #fff;
    color: #4c1d95;
    cursor: pointer;
}

#pwaInstallBanner .pwa-dismiss-btn {
    border: none;
    border-radius: 0.65rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
}

@media (display-mode: standalone) {
    .mobile-open-app-banner { display: none !important; }
    #pwaInstallBanner { display: none !important; }
}

.nexura-app {
    min-height: 100dvh;
    background: #020617;
    color: #f8fafc;
    font-family: Inter, system-ui, sans-serif;
}

.nexura-app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: calc(env(safe-area-inset-top, 0px) + 0.85rem) 1rem 0.85rem;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nexura-app-logo {
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(90deg, #4ade80, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nexura-app-main {
    padding: 1rem 1rem calc(var(--mobile-nav-height) + var(--safe-bottom) + 1.5rem);
    max-width: 32rem;
    margin: 0 auto;
}

.app-hero-card {
    border-radius: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.18), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(74, 222, 128, 0.25);
    margin-bottom: 1rem;
}

.app-hero-card h1 { font-size: 1.5rem; margin: 0.35rem 0 0.5rem; }
.app-hero-card p { color: #94a3b8; font-size: 0.9rem; margin: 0; }

.app-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.app-stat {
    text-align: center;
    padding: 0.65rem 0.25rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.app-stat strong { display: block; font-size: 1.1rem; color: #34d399; }
.app-stat span { font-size: 0.62rem; color: #94a3b8; }

.app-section-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
    margin: 1.25rem 0 0.65rem;
}

.app-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.app-quick-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: inherit;
    text-decoration: none;
    min-height: 4.5rem;
    touch-action: manipulation;
}

.app-quick-card i {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-quick-card strong { display: block; font-size: 0.88rem; }
.app-quick-card small { color: #64748b; font-size: 0.72rem; }

.app-service-list { display: flex; flex-direction: column; gap: 0.5rem; }

.app-service-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: inherit;
    text-decoration: none;
}

.app-service-item i { color: #4ade80; width: 1.25rem; text-align: center; }

.app-status {
    font-size: 0.8rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
}

.app-status.ok { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.25); }
.app-status.err { background: rgba(239, 68, 68, 0.1); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.25); }

.app-install-header-btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(74, 222, 128, 0.4);
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
    font-weight: 600;
    cursor: pointer;
}

.mobile-open-app-banner {
    display: none;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(90deg, rgba(74,222,128,0.2), rgba(16,185,129,0.15));
    border: 1px solid rgba(74, 222, 128, 0.3);
    font-size: 0.85rem;
}

.mobile-open-app-banner a { color: #4ade80; font-weight: 700; }

@media (max-width: 900px) {
    .mobile-open-app-banner.show-mobile-banner { display: block; }
}

.end-to-end-business-section {
    margin: 10px 0;
}

.end-to-end-business {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin: 10px 0;
    gap: 1rem;
    justify-content: center;
    align-items: stretch;
}

.end-to-end-business .svc-vertical-item {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.end-to-end-business .svc-vertical-item__icon {
    max-height: 180px;
}

@media (max-width: 768px) {
    .end-to-end-business {
        gap: 0.85rem;
        margin: 0;
    }

    .end-to-end-business-section {
        margin: 0;
    }

    .end-to-end-business .svc-vertical-item__icon {
        max-height: 160px;
    }

    .end-to-end-business .svc-vertical-item > div:not(.svc-vertical-item__icon) {
        padding: 0.85rem 0.9rem 0.9rem;
    }
}

@media (max-width: 520px) {
    .end-to-end-business {
        grid-template-columns: 1fr;
    }

    .end-to-end-business .svc-vertical-item__icon {
        max-height: 140px;
    }
}
