/*
Theme Name: DM Fullscreen App
Theme URI: https://example.com/
Author: DM
Description: Full-screen WordPress app wrapper. Displays the configured external app across the entire public-facing site.
Version: 1.0.0
License: GPL-2.0-or-later
Text Domain: dm-fullscreen-app
*/

:root {
    --dm-primary: #e21b2d;
    --dm-background: #000000;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    background: var(--dm-background);
    overflow: hidden !important;
}

body {
    font-family: Arial, Helvetica, sans-serif;
}

.dm-fullscreen-app,
.dm-fullscreen-app * {
    box-sizing: border-box;
}

.dm-app-root {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    z-index: 2147483000;
}

.dm-app-frame {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: #fff;
}

.dm-app-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #fff;
    transition: opacity .25s ease, visibility .25s ease;
}

.dm-app-loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dm-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
}

.dm-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255,255,255,.18);
    border-top-color: var(--dm-primary);
    border-radius: 50%;
    animation: dm-spin .8s linear infinite;
}

.dm-loading-text {
    font-size: 14px;
    color: #ddd;
}

.dm-app-fallback {
    position: absolute;
    left: 50%;
    bottom: 22px;
    z-index: 10;
    width: min(92vw, 440px);
    transform: translateX(-50%) translateY(20px);
    padding: 16px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 16px;
    background: rgba(15,15,18,.96);
    box-shadow: 0 16px 50px rgba(0,0,0,.55);
    color: #fff;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
}

.dm-app-fallback.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dm-fallback-title {
    margin: 0 0 7px;
    font-size: 16px;
    font-weight: 700;
}

.dm-fallback-text {
    margin: 0 0 14px;
    color: #bdbdbd;
    font-size: 13px;
    line-height: 1.45;
}

.dm-open-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 10px;
    background: var(--dm-primary);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 700;
}

.dm-open-app:hover {
    filter: brightness(1.08);
}

.dm-fallback-close {
    display: inline-flex;
    margin-left: 8px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: #2a2a2d;
    color: #fff;
    cursor: pointer;
}

@keyframes dm-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .dm-app-fallback {
        bottom: max(12px, env(safe-area-inset-bottom));
        width: calc(100vw - 24px);
        padding: 14px;
    }

    .dm-open-app,
    .dm-fallback-close {
        min-height: 42px;
    }
}

@media (display-mode: standalone) {
    .dm-app-root {
        height: 100dvh;
    }
}

/* Clean footer edition: no loading/fallback overlay and no overlap. */
.dm-app-loading,.dm-app-fallback{display:none!important}

.dm-app-loading,.dm-app-fallback,.dm-bottom-bar{display:none!important}
