/* Capacitor / PWA app-mode layout overrides for Fluent Community portal */

html.lm-capacitor-app,
html.lm-capacitor-app body.lm-capacitor-app,
html.lm-capacitor-app body.lm-mobile-shell {
    background-color: #ffffff;
}

html.lm-capacitor-app.dark,
html.dark.lm-capacitor-app,
html.lm-capacitor-app.dark body.lm-capacitor-app,
html.dark.lm-capacitor-app body.lm-capacitor-app,
html.lm-capacitor-app.dark body.lm-mobile-shell,
html.dark.lm-capacitor-app body.lm-mobile-shell {
    background-color: #0B0D1B;
}

body.lm-capacitor-app,
body.lm-pwa-app,
body.lm-mobile-shell {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

body.lm-capacitor-app .fcom_wrap,
body.lm-pwa-app .fcom_wrap,
body.lm-mobile-shell .fcom_wrap {
    min-height: 100dvh;
}

@media (max-width: 768px) {
    body.lm-capacitor-app .fhr_content,
    body.lm-pwa-app .fhr_content,
    body.lm-mobile-shell .fhr_content {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    body.lm-capacitor-app .loud-portal-app-wrap,
    body.lm-pwa-app .loud-portal-app-wrap,
    body.lm-mobile-shell .loud-portal-app-wrap {
        padding-left: 0;
        padding-right: 0;
    }
}

body.lm-capacitor-app.loud-portal-app-active .feeds_main,
body.lm-pwa-app.loud-portal-app-active .feeds_main,
body.lm-mobile-shell.loud-portal-app-active .feeds_main {
    max-width: 100%;
}

html.lm-capacitor-app,
body.lm-capacitor-app,
html.lm-pwa-app,
body.lm-pwa-app,
html.lm-mobile-shell,
body.lm-mobile-shell {
    overscroll-behavior-y: none;
}

@media screen and (orientation: landscape) {
    html.lm-portrait-locked,
    html.lm-portrait-locked body {
        overflow: hidden !important;
        height: 100%;
        max-height: 100dvh;
    }
}

#lm-portrait-lock {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #0b0d1b;
    color: #ffffff;
    text-align: center;
}

#lm-portrait-lock[hidden] {
    display: none !important;
}

#lm-portrait-lock .lm-portrait-lock__panel {
    max-width: 320px;
}

#lm-portrait-lock .lm-portrait-lock__icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 16px;
    transform: rotate(90deg);
}

#lm-portrait-lock .lm-portrait-lock__text {
    margin: 0;
    font: 600 18px/1.4 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#lm-pwa-install-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 100000;
    padding: 0 12px;
    pointer-events: none;
}

#lm-pwa-install-banner .lm-pwa-install-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(10, 10, 10, 0.94);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    font-size: 14px;
    line-height: 1.35;
}

#lm-pwa-install-banner .lm-pwa-install-btn {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: #fff;
    color: #111;
    font-weight: 600;
    cursor: pointer;
}

#lm-pwa-install-banner .lm-pwa-install-dismiss {
    flex: 0 0 auto;
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #bbb;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

#lm-pwa-install-banner .lm-pwa-install-details {
    pointer-events: auto;
    max-width: 520px;
    margin: 8px auto 0;
    padding: 0 14px 12px;
    color: #ddd;
    font-size: 13px;
}

#lm-pwa-install-banner .lm-pwa-install-steps {
    margin: 8px 0 0 18px;
    padding: 0;
}

#lm-pwa-install-banner .lm-pwa-install-steps li {
    margin-bottom: 4px;
}

#lm-pwa-install-banner .lm-pwa-install-btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

html.lm-pwa-install-gate-open,
html.lm-pwa-install-gate-open body {
    overflow: hidden;
}

#lm-pwa-install-gate {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
}

#lm-pwa-install-gate .lm-pwa-install-gate__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.72);
    backdrop-filter: blur(4px);
}

#lm-pwa-install-gate .lm-pwa-install-gate__panel {
    position: relative;
    width: min(100%, 420px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    overflow: auto;
    padding: 20px 18px 18px;
    border-radius: 20px 20px 16px 16px;
    background: #0b0d1b;
    color: #fff;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

#lm-pwa-install-gate .lm-pwa-install-gate__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e73bd, #3b82f6);
    font-size: 22px;
    margin-bottom: 14px;
}

#lm-pwa-install-gate .lm-pwa-install-gate__title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.2;
}

#lm-pwa-install-gate .lm-pwa-install-gate__lead,
#lm-pwa-install-gate .lm-pwa-install-gate__browser {
    margin: 0 0 12px;
    color: #c7d2e0;
    font-size: 14px;
    line-height: 1.45;
}

#lm-pwa-install-gate .lm-pwa-install-steps {
    margin: 0 0 16px 18px;
    padding: 0;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.4;
}

#lm-pwa-install-gate .lm-pwa-install-steps li {
    margin-bottom: 6px;
}

#lm-pwa-install-gate .lm-pwa-install-gate__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#lm-pwa-install-gate .lm-pwa-install-gate__btn {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

#lm-pwa-install-gate .lm-pwa-install-gate__btn--primary {
    background: #fff;
    color: #111827;
}

#lm-pwa-install-gate .lm-pwa-install-gate__btn--secondary {
    background: transparent;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.22);
}
