/* ==========================================================================
   VIP Insider App – style.css (konsolidiert & robuster)
   Stand: Feb 2026

   Wichtige Fixes:
   - Font-Pfade als ABSOLUTE Pfade (robust bei Clean URLs / Unterordnern)
   - Optionaler Safe-Area Support (top + bottom)
   - Fokus-Styles (Accessibility) + iOS Tap-Optimierung
   - Kleine Konsolidierung (Transitions, Defaults), ohne UI/Flow zu verändern
   ========================================================================== */

/* --- 0. LOKALE SCHRIFTARTEN (DSGVO KONFORM) --- */

/* Montserrat Regular */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/montserrat-v25-latin-regular.woff2') format('woff2');
}

/* Montserrat Bold (700) */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/montserrat-v25-latin-700.woff2') format('woff2');
}

/* --- 1. VARIABLEN & BASIS --- */
:root {
    --gold: #d4af37;
    --dark: #121212;
    --glass: rgba(255, 255, 255, 0.05);

    /* Safe Areas (Notch/Dynamic Island / Home Indicator) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Spacing */
    --pad-x: 15px;
    --pad-top: 20px;
    --pad-bottom: 40px;

    /* Radius */
    --radius-lg: 25px;
    --radius-md: 20px;
    --radius-sm: 15px;

    /* Transitions */
    --t-fast: 0.2s;
    --t-med: 0.3s;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--dark);
    color: white;
    font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;

    /* Inhalt startet sicher unter Statusbar + berücksichtigt unten Home-Indicator */
    padding:
        calc(var(--safe-top) + var(--pad-top))
        var(--pad-x)
        calc(var(--safe-bottom) + var(--pad-bottom))
        var(--pad-x);

    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-shell {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

/* --- 1.1 Links / Fokus (Accessibility, ohne Designbruch) --- */
a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 12px;
}

/* FIX: Massiver Zurück-Button */
.back-link,
.back-link-custom,
.back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;

    margin-right: auto !important;
    margin-left: 0 !important;
    margin-top: 10px !important;
    margin-bottom: 30px !important;

    color: var(--gold) !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;

    border: 2px solid var(--gold) !important;
    padding: 12px 22px !important;
    border-radius: var(--radius-sm) !important;

    background: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5) !important;

    transition: transform var(--t-fast), background var(--t-med) !important;
    letter-spacing: 1px !important;

    z-index: 9999 !important;
    position: relative !important;
}

.back-link:active,
.back-link-custom:active,
.back-btn:active {
    transform: scale(0.95);
    background: var(--gold) !important;
    color: black !important;
}

/* --- Cards / Headlines --- */
.card {
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    border-radius: var(--radius-lg);
    padding: 25px;
    text-align: center;

    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 25px;
}

h2 {
    margin: 0 0 5px 0;
    font-size: 1.6rem;
}

/* --- 2. FORMULAR-ELEMENTE --- */
input,
button,
textarea {
    width: 100%;
    padding: 14px;
    margin: 8px 0;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-size: 1rem;
    text-align: center;
}

/* iOS: verhindert ungewollte Zooms bei kleinen Fontgrößen */
input,
textarea,
button {
    font-size: 16px;
}

input,
textarea {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.05);
}

input::placeholder,
textarea::placeholder {
    color: rgba(255,255,255,0.55);
}

button {
    background: var(--gold);
    font-weight: bold;
    color: #000;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform var(--t-fast), filter var(--t-fast);
}

button:hover {
    filter: brightness(1.02);
}

button:active {
    transform: scale(0.96);
}

/* --- 3. DASHBOARD & GRID --- */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.dash-item {
    background: rgba(255,255,255,0.03);
    padding: 18px 10px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);

    text-decoration: none;
    color: white;

    display: flex;
    flex-direction: column;
    align-items: center;

    transition: background var(--t-med);
}

.dash-item:active {
    background: rgba(255,255,255,0.08);
}

.dash-item i {
    color: var(--gold);
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.dash-item small {
    font-size: 0.75rem;
    font-weight: bold;
}

.dash-item.podcast-main {
    grid-column: span 2;
    background: linear-gradient(
        135deg,
        rgba(212, 175, 55, 0.15) 0%,
        rgba(212, 175, 55, 0.05) 100%
    );
    border: 1px solid var(--gold);
    padding: 25px 10px;
}

.dash-item.podcast-main i {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

/* --- 4. KOMPONENTEN --- */
.community-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold);
    padding: 8px 18px;
    border-radius: 50px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.admin-msg {
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--gold);
    padding: 15px;
    border-radius: 18px;
    text-align: left;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.news-box {
    background: var(--gold);
    color: #000;
    padding: 14px;
    border-radius: 18px;
    text-align: left;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    position: relative;
    display: block;
    text-decoration: none;
}

.news-box i {
    position: absolute;
    right: 15px;
    top: 18px;
    opacity: 0.4;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
}

.rank-me {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
}

/* --- 5. ANIMATIONEN & OVERLAYS --- */
.levelup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 20px;
}

.levelup-card {
    background: linear-gradient(145deg, #1a1a1a, #000);
    border: 2px solid var(--gold);
    padding: 40px 25px;
    border-radius: 35px;
    text-align: center;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.3);
    animation: pop-in 0.6s cubic-bezier(0.17, 0.89, 0.32, 1.27);
}

@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- 6. HILFSKLASSEN & BROWSER --- */
.visual-hide {
    position: absolute;
    left: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* =========================================================
   ARTICLE BODY FIX (NUR Paywall-Artikel)
   Problem: Neue Artikel werden in einer .card gerendert,
   aber zusätzlich sind oft Regeln wie ".card p{ text-align:center; }"
   aktiv. Deshalb hier mit höherer Spezifität + !important.
   ========================================================= */

/* Container links */
.card .paywall-before,
.card .paywalled-content,
.paywall-before,
.paywalled-content {
    text-align: left !important;
}

/* Alles darin links (bricht Zentrum auch bei ".card p {text-align:center}") */
.card .paywall-before * ,
.card .paywalled-content * ,
.paywall-before *,
.paywalled-content * {
    text-align: left !important;
}

/* Ausnahmen: Wenn ihr in Zukunft bewusst etwas zentrieren wollt,
   könnt ihr dort inline <div class="center">...</div> nutzen. */
.center { text-align: center !important; }
.center * { text-align: center !important; }

/* Listen sauber */
.card .paywall-before ul,
.card .paywalled-content ul,
.card .paywall-before ol,
.card .paywalled-content ol,
.paywall-before ul,
.paywalled-content ul,
.paywall-before ol,
.paywalled-content ol {
    list-style-position: outside;
    padding-left: 1.2em;
    margin-left: 0;
}

/* Blockquote Abstand (ohne Designwechsel) */
.card .paywall-before blockquote,
.card .paywalled-content blockquote,
.paywall-before blockquote,
.paywalled-content blockquote {
    margin: 16px 0;
}

/* HR im Artikel etwas ruhiger */
.card .paywall-before hr,
.card .paywalled-content hr,
.paywall-before hr,
.paywalled-content hr {
    margin: 22px 0;
    opacity: 0.35;
}

/* Responsive Fixes */
@media (max-width: 340px) {
    h2 { font-size: 1.3rem; }
    .card { padding: 15px; }
    .dash-item small { font-size: 0.65rem; }
}
