/* EnergieOase App — Glass-Skin (R8.2)
 * Greift NUR im installierten App-Modus: alles ist unter `html.eo-app` gescoped
 * (pwa.js setzt die Klasse bei display-mode: standalone / ?source=pwa).
 * Die normale Website bleibt davon unberührt (Decision D1).
 *
 * Optik: Apple-„Liquid Glass" — adaptiert aus der Zuruf-Familienapp, umgefärbt
 * auf EnergieOase-Magenta/Beige/Orange. Tokens stammen aus frontend.css.
 */

/* ── Marken-Verlauf als Glass-Hintergrund ──────────────────────────────────── */
html.eo-app body:has(.eo-member-area) {
    background:
        radial-gradient(ellipse at 8% 0%,   rgba(175, 60, 121, .16) 0%, transparent 42%),
        radial-gradient(ellipse at 92% 6%,  rgba(255, 164, 81, .15) 0%, transparent 40%),
        radial-gradient(ellipse at 18% 78%, rgba(175, 60, 121, .11) 0%, transparent 44%),
        radial-gradient(ellipse at 84% 94%, rgba(255, 164, 81, .12) 0%, transparent 40%),
        linear-gradient(160deg, #fff7ec 0%, #fdeede 100%) !important;
    background-attachment: fixed !important;
}

html.eo-app .eo-member-area,
html.eo-app .eo-member-area.alignfull {
    background: transparent !important;
}

/* ── Glass-Top-Header (sticky, durchscheinend) ─────────────────────────────── */
html.eo-app body .eo-member-area .eo-site-header {
    position: sticky;
    top: 0;
    z-index: 950;
    background: rgba(255, 255, 255, .60) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.8) brightness(1.04);
    backdrop-filter:         blur(30px) saturate(1.8) brightness(1.04);
    border-bottom: 1px solid rgba(255, 255, 255, .65);
    box-shadow: 0 2px 18px rgba(175, 60, 121, .08);
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
}

/* Top-Navigationsleiste verschwindet — sie wird durch die Bottom-Tab-Bar ersetzt. */
html.eo-app body .eo-member-area .eo-main-nav {
    display: none !important;
}

/* Hero pro Sektion bekommt App-Card-Anmutung (Titel liegt im Bild, R9). */
html.eo-app body .eo-member-area .eo-member-hero {
    margin: 12px 12px 0 !important;
    height: 150px !important;
    border-radius: 18px !important;
    box-shadow: 0 6px 24px rgba(175, 60, 121, .14);
    overflow: hidden;
}
html.eo-app .eo-hero-caption { padding: 0 1rem .8rem; }
html.eo-app .eo-hero-caption h1 { font-size: 1.45rem; letter-spacing: 1px; }
html.eo-app .eo-hero-caption .eo-page-sub { font-size: .78rem; }

/* Kopfzeile entrümpelt: Name-/Abmelden-Pills weg (stecken im „Mehr"-Sheet),
 * stattdessen Avatar-Kreis → Profil. */
html.eo-app body .eo-member-area .eo-site-header-actions .eo-header-btn {
    display: none !important;
}
html.eo-app .eo-header-avatar {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .92);
    box-shadow: 0 2px 10px rgba(175, 60, 121, .25);
    flex: 0 0 auto;
}
html.eo-app .eo-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Sub-Tab-Bar als Glass-Pills (horizontale zweite Ebene). */
html.eo-app body .eo-member-area .eo-subnav {
    background: transparent !important;
    border-bottom: 0 !important;
    padding: 10px 12px 0 !important;
}
html.eo-app body .eo-member-area .eo-subnav-inner {
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
html.eo-app body .eo-member-area .eo-subnav-inner::-webkit-scrollbar { display: none; }
html.eo-app .eo-subnav a {
    flex: 0 0 auto;
    padding: .5rem 1rem;
    border-radius: 999px;
    border-bottom: 0;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .82);
    color: var(--eo-text, #333);
    font-size: .85rem;
    white-space: nowrap;
}
html.eo-app .eo-subnav a.is-active {
    background: var(--eo-magenta);
    border-color: var(--eo-magenta);
    color: #fff;
}

/* Hub-Zeilen als Glass-Cards. */
html.eo-app .eo-hub-item {
    background: rgba(255, 255, 255, .55);
    -webkit-backdrop-filter: blur(28px) saturate(1.6) brightness(1.03);
    backdrop-filter:         blur(28px) saturate(1.6) brightness(1.03);
    border: 1px solid rgba(255, 255, 255, .82);
    box-shadow: 0 6px 26px rgba(175, 60, 121, .12), inset 0 1.5px 0 rgba(255, 255, 255, .9);
}

/* Footer minimal: Spalten + Bottom-Zeile weg, nur die Mini-Zeile bleibt.
 * Kontakt & Rechtliches sind über Impressum/Datenschutz weiter erreichbar. */
html.eo-app .eo-site-footer .eo-site-footer-inner,
html.eo-app .eo-site-footer .eo-site-footer-bottom { display: none !important; }
html.eo-app .eo-footer-app-mini {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    padding: 6px 16px 0;
    color: var(--eo-muted, #7a7077);
    font-size: .8rem;
}
html.eo-app .eo-footer-app-mini a {
    color: var(--eo-muted, #7a7077);
    text-decoration: underline;
}

/* Content transparent + Platz für die schwebende Tab-Bar. */
html.eo-app body .eo-member-area .eo-content {
    background: transparent !important;
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)) !important;
}

html.eo-app body .eo-member-area .eo-site-footer {
    background: transparent !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Kacheln als Glass-Cards. */
html.eo-app .eo-tile {
    background: rgba(255, 255, 255, .55) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.6) brightness(1.03);
    backdrop-filter:         blur(28px) saturate(1.6) brightness(1.03);
    border: 1px solid rgba(255, 255, 255, .82) !important;
    box-shadow: 0 6px 26px rgba(175, 60, 121, .12), inset 0 1.5px 0 rgba(255, 255, 255, .9) !important;
}

/* ── Start-Dashboard (App-Modus): Glass-Section-Cards mit Live-Vorschau ─────── */
.eo-dashboard { display: none; }
html.eo-app .eo-welcome .eo-tile-grid,
html.eo-app .eo-welcome .eo-welcome-events { display: none !important; }
html.eo-app .eo-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 14px;
}
@media (min-width: 720px) {
    html.eo-app .eo-dashboard { grid-template-columns: 1fr 1fr; }
}
html.eo-app .eo-dash-card {
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, .55);
    -webkit-backdrop-filter: blur(28px) saturate(1.6) brightness(1.03);
    backdrop-filter:         blur(28px) saturate(1.6) brightness(1.03);
    border: 1px solid rgba(255, 255, 255, .82);
    box-shadow: 0 6px 26px rgba(175, 60, 121, .12), inset 0 1.5px 0 rgba(255, 255, 255, .9);
}
.eo-dash-card-hero {
    display: flex;
    align-items: flex-end;
    height: 118px;
    padding: 12px 16px;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    position: relative;
}
.eo-dash-card-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(142, 44, 97, 0) 30%, rgba(142, 44, 97, .78) 100%);
}
.eo-dash-card-title {
    position: relative;
    z-index: 1;
    color: #fff;
    font-family: var(--eo-font-display);
    font-size: 1.35rem;
    font-weight: 700;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}
.eo-dash-card-body { padding: 12px 16px 14px; }
.eo-dash-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid rgba(175, 60, 121, .10);
}
.eo-dash-row:last-of-type { border-bottom: 0; }
.eo-dash-row-meta {
    flex: 0 0 auto;
    color: var(--eo-muted, #7a7077);
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}
.eo-dash-row-main {
    flex: 1;
    min-width: 0;
    color: var(--eo-text, #333);
    font-size: .92rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.eo-dash-empty,
.eo-dash-text {
    color: var(--eo-muted, #7a7077);
    font-size: .9rem;
    margin: .2rem 0 .5rem;
}
.eo-dash-audio-label { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.eo-dash-audio { width: 100%; margin-top: 4px; height: 38px; }
.eo-dash-more {
    display: inline-block;
    margin-top: 12px;
    color: var(--eo-magenta);
    font-weight: 800;
    font-size: .9rem;
    text-decoration: none;
}
.eo-dash-more::after { content: ' →'; }

/* ── App-Modus Gast: Login-Bereich im App-Look (gesperrte Cards) ────────────── */
.eo-app-guest-header { display: none; }
html.eo-app .eo-member-area.is-guest .eo-site-header-main,
html.eo-app .eo-member-area.is-guest .eo-header-cta,
html.eo-app .eo-member-area.is-guest .eo-member-benefits { display: none !important; }

html.eo-app .eo-app-guest-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 950;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
    background: rgba(255, 255, 255, .60);
    -webkit-backdrop-filter: blur(30px) saturate(1.8) brightness(1.04);
    backdrop-filter:         blur(30px) saturate(1.8) brightness(1.04);
    border-bottom: 1px solid rgba(255, 255, 255, .65);
}
html.eo-app .eo-app-guest-logo { justify-self: center; }
html.eo-app .eo-app-guest-logo img {
    height: 56px;
    width: auto;
    display: block;
    /* gleiche Magenta-Einfärbung wie die Kopfzeile nach dem Login */
    filter: brightness(0) saturate(100%) invert(27%) sepia(60%) saturate(700%) hue-rotate(285deg);
}
html.eo-app .eo-app-guest-actions { justify-self: end; display: flex; gap: 8px; }

.eo-dash-lock {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: var(--eo-magenta);
    box-shadow: 0 2px 10px rgba(175, 60, 121, .25);
}
html.eo-app .eo-dashboard.is-locked .eo-dash-card { cursor: pointer; text-decoration: none; }
html.eo-app .eo-dashboard.is-locked .eo-dash-card-hero { filter: saturate(.9); }

/* ── Schwebende Bottom-Tab-Bar (Pill) ──────────────────────────────────────── */
.eo-bottom-nav { display: none; }
.eo-bottom-nav-source { display: none !important; }

html.eo-app .eo-bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    width: calc(100% - 24px);
    max-width: 460px;
    height: 66px;
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 7px 8px;
    border-radius: 26px;
    background: rgba(255, 255, 255, .52);
    -webkit-backdrop-filter: blur(44px) saturate(2) brightness(1.05);
    backdrop-filter:         blur(44px) saturate(2) brightness(1.05);
    border: 1px solid rgba(255, 255, 255, .84);
    box-shadow: 0 10px 38px rgba(175, 60, 121, .20), inset 0 1.5px 0 rgba(255, 255, 255, .96);
    z-index: 1000;
}

.eo-bottom-nav-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: var(--eo-muted, #7a7077);
    border-radius: 16px;
    font-family: var(--eo-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s ease, background .18s ease, color .18s ease;
}

.eo-bottom-nav-btn .eo-bottom-nav-ico { width: 22px; height: 22px; display: block; }
.eo-bottom-nav-btn .eo-bottom-nav-ico svg { width: 22px; height: 22px; display: block; }
.eo-bottom-nav-btn .eo-bottom-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eo-bottom-nav-btn.is-active {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--eo-magenta) 68%, #fff) 0%,
        var(--eo-magenta) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(175, 60, 121, .40), inset 0 1.5px 0 rgba(255, 255, 255, .5);
}

.eo-bottom-nav-btn:active { transform: scale(.90); }

/* ── „Mehr"-Bottom-Sheet ───────────────────────────────────────────────────── */
.eo-bottom-more[hidden] { display: none; }
.eo-bottom-more {
    position: fixed;
    inset: 0;
    z-index: 1100;
}
.eo-bottom-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(40, 18, 38, .30);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.eo-bottom-more-sheet {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
    width: calc(100% - 24px);
    max-width: 460px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
    border-radius: 24px;
    background: rgba(255, 247, 236, .96);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    backdrop-filter:         blur(24px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: 0 18px 48px rgba(175, 60, 121, .22);
}

.eo-bottom-more-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 6px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .55);
    color: var(--eo-text, #333);
    font-family: var(--eo-font-body);
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.eo-bottom-more-item:last-child { margin-bottom: 0; }
.eo-bottom-more-item .eo-bottom-nav-ico,
.eo-bottom-more-item .eo-bottom-nav-ico svg { width: 22px; height: 22px; flex: 0 0 auto; }
.eo-bottom-more-item.is-active {
    background: var(--eo-magenta);
    color: #fff;
}
.eo-bottom-more-item.eo-bottom-more-customize { color: var(--eo-magenta); font-weight: 700; }

/* ── Tab-Anpassen-Ansicht ──────────────────────────────────────────────────── */
.eo-customize-title {
    padding: 8px 8px 12px;
    font-weight: 800;
    font-size: 14px;
    color: var(--eo-text-soft, #555);
}
.eo-customize-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .55);
}
.eo-customize-row.is-pinned { background: rgba(175, 60, 121, .10); }
.eo-customize-row .eo-bottom-nav-ico,
.eo-customize-row .eo-bottom-nav-ico svg { width: 20px; height: 20px; flex: 0 0 auto; }
.eo-customize-label { flex: 1; font-weight: 600; }
.eo-customize-ctrl { display: flex; gap: 6px; }
.eo-customize-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--eo-border, #ebe1d6);
    border-radius: 10px;
    background: #fff;
    color: var(--eo-text-soft, #555);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}
.eo-customize-btn.is-on { color: var(--eo-magenta); border-color: var(--eo-magenta); }
.eo-customize-btn:disabled { opacity: .4; cursor: not-allowed; }
.eo-customize-done { width: 100%; margin-top: 8px; }

/* ── Desktop: Pill bleibt zentriert, etwas schmaler ────────────────────────── */
@media (min-width: 768px) {
    html.eo-app .eo-bottom-nav { max-width: 420px; }
}

/* ── Fallback ohne backdrop-filter → blickdichte Flächen ───────────────────── */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html.eo-app body .eo-member-area .eo-site-header,
    html.eo-app .eo-app-guest-header,
    html.eo-app .eo-tile,
    html.eo-app .eo-dash-card,
    html.eo-app .eo-hub-item,
    html.eo-app .eo-bottom-nav,
    html.eo-app .eo-bottom-more-sheet { background: #fff7ec !important; }
}

/* ── PWA-UI: Update-Toast · Install-Button · iOS-Hinweis (auch im Web) ──────── */
.eo-pwa-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--eo-magenta, #af3c79);
    color: #fff;
    font-family: var(--eo-font-body);
    font-size: .9rem;
    box-shadow: 0 8px 28px rgba(175, 60, 121, .35);
}
.eo-pwa-toast-btn {
    border: 0;
    border-radius: 999px;
    padding: 6px 14px;
    background: #fff;
    color: var(--eo-magenta, #af3c79);
    font-weight: 700;
    cursor: pointer;
}

.eo-pwa-install {
    position: fixed;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 1990;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--eo-magenta, #af3c79);
    color: #fff;
    font-family: var(--eo-font-body);
    font-size: .9rem;
    font-weight: 700;
    box-shadow: 0 8px 28px rgba(175, 60, 121, .35);
    cursor: pointer;
}

.eo-pwa-ios-hint {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 1990;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--eo-border, #ebe1d6);
    color: var(--eo-text, #333);
    font-family: var(--eo-font-body);
    font-size: .85rem;
    box-shadow: 0 8px 28px rgba(175, 60, 121, .20);
}
.eo-pwa-ios-hint strong { color: var(--eo-magenta, #af3c79); }
.eo-pwa-ios-x {
    margin-left: auto;
    border: 0;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--eo-muted, #7a7077);
    cursor: pointer;
}

/* Im App-Modus über der schwebenden Tab-Bar platzieren. */
html.eo-app .eo-pwa-toast,
html.eo-app .eo-pwa-install { bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); }
