/* Prime LMS — installed-app (PWA/TWA) styles.
 * EVERYTHING here is scoped to .app-mode, which is only added when the site is
 * launched from the installed app. Normal browser visitors are unaffected. */

/* Bottom nav stays hidden for normal browser visitors */
.plms-appnav { display: none; }

html.app-mode, html.app-mode body { background: #f6f3fc; }

/* Hide the WordPress / theme / cookie chrome so only the portal shows.
 * Buyers on other themes can add more selectors in Settings → Mobile App. */
html.app-mode #wpadminbar,
html.app-mode .site-header,
html.app-mode #masthead,
html.app-mode header.site-header,
html.app-mode .ast-above-header-wrap,
html.app-mode .ast-below-header-wrap,
html.app-mode .ast-primary-header-bar,
html.app-mode .main-header-bar,
html.app-mode .elementor-location-header,
html.app-mode .ehf-header,
html.app-mode #colophon,
html.app-mode .site-footer,
html.app-mode .ast-small-footer,
html.app-mode .site-primary-footer-wrap,
html.app-mode .site-below-footer-wrap,
html.app-mode .ast-footer-overlay,
html.app-mode .elementor-location-footer,
html.app-mode .ehf-footer,
html.app-mode footer[data-elementor-type="footer"],
html.app-mode #cookie-law-info-bar,
html.app-mode .cli-modal,
html.app-mode .cli-bar-container,
html.app-mode .wpautoterms-footer {
    display: none !important;
}

html.app-mode { margin-top: 0 !important; }

/* Leave room for the fixed top bar + bottom navigation */
html.app-mode body {
    padding-top: calc(52px + env(safe-area-inset-top)) !important;
    padding-bottom: calc(66px + env(safe-area-inset-bottom)) !important;
}

/* ── Branded top bar (app only) ────────────────────────────────────────── */
.plms-apptop { display: none; }
html.app-mode .plms-apptop {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 99998;
    height: 52px;
    background: #ffffff;
    border-bottom: 1px solid #ececf1;
    box-shadow: 0 1px 10px rgba(40, 30, 80, .05);
    padding: env(safe-area-inset-top) 16px 0;
}
html.app-mode .plms-apptop-logo { height: 30px; width: auto; max-width: 150px; object-fit: contain; display: block; }
html.app-mode .plms-apptop-name { font-size: 16px; font-weight: 700; color: #1a1a2e; letter-spacing: -.01em; }

/* Keep the course player's own "Back" bar below the app top bar */
html.app-mode .plms-player-crumb {
    top: calc(52px + env(safe-area-inset-top)) !important;
}

/* ── Smooth native-style page entrance (kills the white flash) ─────────── */
@keyframes plmsAppIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: none; }
}
html.app-mode .site-content,
html.app-mode #content,
html.app-mode #primary {
    animation: plmsAppIn .26s ease both;
}
html.app-mode.plms-leaving .site-content,
html.app-mode.plms-leaving #content {
    opacity: .35;
    transition: opacity .14s ease;
}

/* ── Bottom navigation bar ─────────────────────────────────────────────── */
html.app-mode .plms-appnav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999;
    height: 66px;
    background: #ffffff;
    border-top: 1px solid #ececf1;
    box-shadow: 0 -2px 14px rgba(40, 30, 80, .07);
    padding-bottom: env(safe-area-inset-bottom);
}
.plms-appnav a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    color: #9a9aa6; text-decoration: none;
    font-size: 11px; font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}
.plms-appnav a svg { width: 23px; height: 23px; display: block; }
.plms-appnav a.active { color: #7c3aed; }
.plms-appnav a:active { background: #f6f3fc; }
