
/* =========================================
   ENEO360 APPLICATION SHELL
========================================= */

:root {
    --app-background: #101010;
    --stage-background: #202020;
    --sidebar-background: #090909;
    --surface-background: #171717;
    --text-primary: #ffffff;
    --text-muted: #a3a3a3;
    --accent: #ffffff;

    --mobile-nav-height: 72px;
    --desktop-sidebar-width: 220px;
    --stage-max-width: 460px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    background: var(--app-background);
    color: var(--text-primary);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    overflow: hidden;
}

button {
    font: inherit;
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* =========================================
   APPLICATION LAYOUT
========================================= */

#appShell {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    overflow: hidden;
    background: var(--app-background);
}

.desktop-sidebar {
    width: var(--desktop-sidebar-width);
    flex: 0 0 var(--desktop-sidebar-width);
    background: var(--sidebar-background);
    display: flex;
    flex-direction: column;
    padding: 25px 16px;
    z-index: 100;
}

.sidebar-brand {
    padding: 4px 8px 38px;
}

.brand-name {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.brand-name span,
.about-logo span {
    color: #a3a3a3;
}

.sidebar-navigation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.navigation-item {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 13px 12px;
    background: transparent;
    color: #bdbdbd;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}

.navigation-item:hover,
.navigation-item.active {
    background: #242424;
    color: #ffffff;
}

.nav-icon {
    width: 24px;
    font-size: 23px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    color: #737373;
    font-size: 11px;
    padding: 10px 8px;
}

#appMain {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    background: var(--stage-background);
    overflow: hidden;
}

/* =========================================
   PORTRAIT CONTENT VIEWPORT
========================================= */

#contentStage {
    position: relative;
    width: min(100%, var(--stage-max-width));
    height: 100%;
    background: #000000;
    overflow: hidden;
    isolation: isolate;
}

.app-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.app-screen:not([hidden]) {
    display: block;
}

.placeholder-screen,
.about-screen {
    background: var(--surface-background);
}

/* =========================================
   TOP OVERLAY
========================================= */

.stage-topbar {
    position: absolute;
    z-index: 1000;
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.stage-back-button,
.country-pill {
    pointer-events: auto;
}

.stage-back-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(12px);
    font-size: 23px;
}

.country-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 30px;
    background: rgba(20, 20, 20, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(12px);
    margin-left: auto;
}

.country-pin {
    color: #ffffff;
    font-size: 11px;
}

/* =========================================
   ABOUT SCREEN
========================================= */

.about-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 65px 30px;
}

.about-content {
    width: 100%;
    max-width: 340px;
    text-align: center;
}

.about-logo {
    font-size: 43px;
    font-weight: 800;
    letter-spacing: -2px;
}

.about-tagline {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 3px;
    margin-top: 7px;
}

.about-divider {
    height: 1px;
    width: 55px;
    background: #555555;
    margin: 42px auto;
}

.about-content h1 {
    font-size: clamp(27px, 5vw, 36px);
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 22px;
}

.about-description {
    color: #b6b6b6;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.about-closing {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 35px;
}

/* =========================================
   HOME PLACEHOLDER
========================================= */

.placeholder-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 25px;
}

.placeholder-screen h1 {
    font-size: 30px;
    font-weight: 800;
}

.placeholder-screen p {
    color: var(--text-muted);
    font-size: 13px;
}

/* =========================================
   MOBILE NAVIGATION
========================================= */

.mobile-navigation {
    display: none;
}

/* =========================================
   MAP SCREEN COMPATIBILITY
========================================= */

.map-screen {
    background: #000000;
}

/*
Keep the existing Leaflet map filling the
portrait content stage.
*/
/* .map-screen #map {
    width: 100%;
    height: 100%;
    min-height: 0;
} */

/* =========================================
   MOBILE
========================================= */

@media (max-width: 767px) {

    #appShell {
        flex-direction: column;
    }

    .desktop-sidebar {
        display: none;
    }

    #appMain {
        width: 100%;
        height: calc(100% - var(--mobile-nav-height));
        flex: 1;
    }

    #contentStage {
        width: 100%;
        max-width: none;
        height: 100%;
    }

    .mobile-navigation {
        height: var(--mobile-nav-height);
        flex: 0 0 var(--mobile-nav-height);
        display: flex;
        align-items: center;
        justify-content: space-around;
        gap: 8px;
        padding: 5px 12px max(5px, env(safe-area-inset-bottom));
        background: #090909;
        border-top: 1px solid #262626;
        z-index: 1100;
    }

    .mobile-nav-item {
        flex: 1;
        min-width: 0;
        height: 100%;
        border: 0;
        background: transparent;
        color: #929292;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3px;
        font-size: 10px;
        font-weight: 700;
    }

    .mobile-nav-item.active {
        color: #ffffff;
    }

    .mobile-nav-icon {
        font-size: 22px;
        line-height: 1;
    }

    .mobile-logo-button {
        flex: 1;
        height: 44px;
        max-width: 82px;
        border: 0;
        border-radius: 13px;
        background: #ffffff;
        color: #111111;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 25px;
        font-weight: 900;
    }

    .about-screen {
        padding: 55px 25px;
    }
}

/* Smaller desktop windows */
@media (min-width: 768px) and (max-width: 1050px) {
    :root {
        --desktop-sidebar-width: 175px;
        --stage-max-width: 430px;
    }

    .desktop-sidebar {
        padding-left: 10px;
        padding-right: 10px;
    }
}
