/* ═══════════════════════════════════════════════════
   ExoMiner — Consolidated Stylesheet
   Sections: Variables, Base, Layout, Sidebar,
             Game, Animations
═══════════════════════════════════════════════════ */

/* ── VARIABLES & BASE ────────────────────────────── */
/**
 * main.css - ExoMiner Void Purple Theme
 */

:root {
    --primary:       #6c1aff;
    --primary-soft:  #8b3fff;
    --secondary:     #00ffcc;
    --accent:        #ff6bff;
    --bg:            #050208;
    --bg2:           #0d0820;
    --card-bg:       #100c1e;
    --card-border:   #1e1640;
    --text:          #ede8ff;
    --text-muted:    #8b7ab8;   /* War #3a3060 — viel heller */
    --text-dim:      #6a5a94;   /* Für dezentere Texte */
    --danger:        #ff3366;
    --warning:       #ff9800;
    --header-height: 58px;
    --nav-height:    68px;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 15%, rgba(108,26,255,.14) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 85%, rgba(0,255,204,.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 5%,  rgba(255,107,255,.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* TOP BAR - Freischwebend */
.top-bar {
    background: rgba(22,12,48,.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(108,26,255,.5);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 12px;
    left: 232px;
    right: 12px;
    height: var(--header-height);
    z-index: 9999;
    padding: 0 22px;
    box-shadow:
        0 8px 32px rgba(0,0,0,.6),
        0 0 0 1px rgba(108,26,255,.2),
        inset 0 1px 0 rgba(255,255,255,.07);
}

.balance {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--secondary);
    letter-spacing: .5px;
}

/* CONTENT */
.container {
    position: relative;
    z-index: 1;
    margin-left: 232px;
    margin-top: calc(var(--header-height) + 48px);
    padding: 20px;
    max-width: 900px;
    min-height: 100vh;
}

.site-footer {
    margin-top: 50px;
    padding: 20px;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: .8em;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* MOBILE */
@media (max-width: 768px) {
    .top-bar {
        top: 10px;
        left: 12px;
        right: 12px;
        border-radius: 16px;
        padding: 0 16px;
        height: 52px;
    }

    .container {
        margin-left: 0 !important;
        margin-top: calc(52px + 24px);
        padding: 12px;
        padding-bottom: calc(var(--nav-height) + 30px);
    }

    .balance { font-size: 1.1em !important; }
}

.text-secondary { color: var(--secondary); }
.text-primary   { color: var(--primary);   }
.text-danger    { color: var(--danger);    }

.fade-in { animation: fadeIn .4s ease-out; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SIDEBAR & NAV ───────────────────────────────── */
/* sidebar.css - Freischwebende Navigation, Void Purple */

/* ── DESKTOP SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 12px;
    top: 12px;
    bottom: 12px;
    width: 200px;
    background: rgba(22,12,48,.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108,26,255,.45);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    z-index: 9998;
    box-shadow:
        0 8px 32px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.06);
}

.sidebar-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: 12px;
    overflow-y: auto;
}

/* Logo oben in der Sidebar */
.sidebar-logo {
    text-align: center;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(108,26,255,.3);
    margin-bottom: 6px;
}

.sidebar-logo-text {
    font-size: .9em;
    font-weight: bold;
    color: var(--secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.sidebar-logo-sub {
    font-size: .65em;
    color: #5a4880;
    margin-top: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #9b8ec4;
    text-decoration: none;
    font-size: .95em;
    font-weight: 600;
    border-left: 3px solid transparent;
    margin-bottom: 3px;
    transition: all .2s ease;
    gap: 14px;
    border-radius: 0 10px 10px 0;
}

.nav-item i,
.nav-item svg {
    width: 1.4em;
    height: 1.4em;
    flex-shrink: 0;
    display: inline-block;
}

.nav-item:hover {
    background: rgba(108,26,255,.15);
    color: #ede8ff;
}

.nav-item.active {
    background: rgba(0,255,204,.08);
    color: var(--secondary);
    border-left: 3px solid var(--secondary);
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(108,26,255,.3);
}

.logout-link {
    color: var(--danger) !important;
    opacity: .6;
}
.logout-link:hover { opacity: 1; }


/* Mehr-Button nur auf Mobile sichtbar */
.more-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
@media (max-width: 768px) {

    .sidebar {
        position: fixed !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        width: auto !important;
        height: 64px !important;
        border-radius: 20px !important;
        border: 1px solid rgba(108,26,255,.5) !important;
        background: rgba(22,12,48,.97) !important;
        backdrop-filter: blur(24px) !important;
        -webkit-backdrop-filter: blur(24px) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06) !important;
        z-index: 99999 !important;
        flex-direction: row !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* Logo + User-Block auf Mobile ausblenden */
    .sidebar-logo { display: none !important; }
    .sidebar-footer > div:first-child { display: none !important; }

    /* Mehr-Button nur auf Mobile */
    .more-btn { display: flex !important; }

    /* Alle Nav-Items außer Mining, Planeten, Forschung auf Mobile verstecken */
    .sidebar-content .nav-item:not(:nth-child(-n+3)):not(.more-btn) {
        display: none !important;
    }

    .sidebar-content {
        flex-direction: row !important;
        flex-grow: 1 !important;
        height: 100% !important;
        align-items: center !important;
        padding: 0 6px !important;
        overflow: hidden !important;
        justify-content: space-around !important;
        gap: 0 !important;
    }

    .nav-item {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 4px 8px !important;
        font-size: .68em !important;
        border-left: none !important;
        border-bottom: none !important;
        border-radius: 12px !important;
        gap: 3px !important;
        height: 56px !important;
        color: #9b8ec4 !important;
        margin: 0 1px !important;
        min-width: 46px !important;
        white-space: nowrap !important;
    }

    .nav-item span {
        font-size: .9em !important;
        display: block !important;
        text-align: center !important;
        line-height: 1 !important;
    }

    .nav-item i,
    .nav-item svg {
        font-size: 1.5em !important;
        width: 1.5em !important;
        height: 1.5em !important;
        margin: 0 !important;
        display: inline-block !important;
    }

    .nav-item:hover {
        background: rgba(108,26,255,.15) !important;
        color: #ede8ff !important;
    }

    .nav-item.active {
        color: var(--secondary) !important;
        background: rgba(0,255,204,.1) !important;
        border-left: none !important;
        border-bottom: none !important;
        border-top: none !important;
        box-shadow: inset 0 -3px 0 var(--secondary),
                    inset 0 0 12px rgba(0,255,204,.08) !important;
        border-radius: 14px !important;
    }

    /* Sidebar-Footer auf Mobile */
    .sidebar-footer {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 4px !important;
        border: none !important;
        height: 100% !important;
        flex-shrink: 0;
        border-left: 1px solid rgba(108,26,255,.2) !important;
    }

    .sidebar-footer .nav-item {
        min-width: 44px !important;
    }

    .logout-link { opacity: .7 !important; }
    .logout-link:hover { opacity: 1 !important; }
    #desktop-lang-switcher { display: none !important; }
    .sidebar-lang-switcher { display: none !important; }
}

/* ── GAME COMPONENTS ─────────────────────────────── */
/* game.css - Spielelemente Void Purple */

/* ── MINE CARD ───────────────────────────────────────────────────────── */
.mine-card {
    background: #130e24;
    border: 1px solid #2e1f55;
    border-radius: 18px;
    padding: 0;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.04);
    transition: border-color .3s, box-shadow .3s;
}

.mine-card:hover {
    border-color: rgba(108,26,255,.6);
    box-shadow:
        0 8px 32px rgba(108,26,255,.2),
        inset 0 1px 0 rgba(255,255,255,.06);
}

/* Canvas-Bereich für Mine-Grafik */
.mine-visual {
    position: relative;
    height: 160px;
    overflow: hidden;
    background: linear-gradient(180deg, #030108 0%, #080418 60%, #0e0828 100%);
}

.mine-visual canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Inhalt unter der Grafik */
.mine-body {
    padding: 16px 18px 18px;
    background: linear-gradient(180deg, #130e24 0%, #0f0b1e 100%);
}

.mine-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.mine-title {
    font-weight: bold;
    font-size: 1.08em;
    letter-spacing: .3px;
}

.mine-subtitle {
    font-size: .76em;
    color: #8b7ab8;
    margin-top: 4px;
}

.mine-level {
    font-size: .7em;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── BALKEN ──────────────────────────────────────────────────────────── */
.production-container {
    background: #08031a;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #3d2a6a;
}

.production-bar {
    background: var(--secondary);
    height: 100%;
    width: 0%;
    border-radius: 4px;
    box-shadow: 0 0 10px var(--secondary);
    will-change: width;
}

.progress-container {
    background: #08031a;
    height: 14px;
    border-radius: 7px;
    margin-bottom: 8px;
    overflow: hidden;
    border: 1px solid #3d2a6a;
}

.progress-bar {
    background: linear-gradient(90deg, #6c1aff, #ff6bff);
    height: 100%;
    border-radius: 7px;
    transition: width .4s ease;
    box-shadow: 0 0 8px rgba(108,26,255,.5);
}

.upgrade-count {
    text-align: center;
    font-size: .76em;
    color: #8b7ab8;
    margin-bottom: 14px;
    letter-spacing: .3px;
}

/* ── BUTTONS ─────────────────────────────────────────────────────────── */
.upgrade-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-soft));
    color: white;
    border: none;
    padding: 13px;
    width: 100%;
    border-radius: 12px;
    font-weight: bold;
    font-size: .95em;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .8px;
    transition: all .2s ease;
    position: relative;
    overflow: hidden;
}

.upgrade-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.1), transparent);
    pointer-events: none;
}

.upgrade-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108,26,255,.4);
}

.upgrade-btn:active {
    transform: scale(.97) translateY(0);
}

.upgrade-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ── STATS ROW ───────────────────────────────────────────────────────── */
.stats-row {
    display: flex;
    justify-content: space-between;
    font-size: .82em;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ── STATS ROW ───────────────────────────────────────────────────────── */
.stats-row {
    display: flex;
    justify-content: space-between;
    font-size: .83em;
    color: #8b7ab8;
    margin-top: 10px;
}
.particle {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    will-change: transform, opacity;
}

/* ── OFFLINE POPUP ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(108,26,255,.4);
    padding: 32px 28px;
    border-radius: 22px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow:
        0 24px 60px rgba(0,0,0,.7),
        0 0 0 1px rgba(108,26,255,.2),
        inset 0 1px 0 rgba(255,255,255,.05);
}

/* ── MINE STATES ─────────────────────────────────────────────────────── */
.mine-card.locked-gray {
    filter: grayscale(1) brightness(.35);
    opacity: .5;
    pointer-events: none;
    border: 1px dashed #5a4a80;
}

.mine-card.locked-visible {
    border: 1px solid rgba(0,255,204,.3);
    background: rgba(0,255,204,.02);
}

.lock-hint {
    font-size: .7em;
    background: rgba(255,255,255,.06);
    padding: 3px 10px;
    border-radius: 10px;
    color: var(--text-muted);
}

/* ── SECTION HEADERS ─────────────────────────────────────────────────── */
.section-header {
    font-size: .72em;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}

/* ── ANIMATIONS ──────────────────────────────────── */
/* animations.css - ExoMiner Void Purple */

/* Geld-Pulsieren */
.pulse-money {
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%,100% { text-shadow: 0 0 8px rgba(0,255,204,.4), 0 0 16px rgba(0,255,204,.2); }
    50%      { text-shadow: 0 0 16px rgba(0,255,204,.8), 0 0 32px rgba(0,255,204,.4), 0 0 48px rgba(0,255,204,.15); }
}

/* Produktionsbalken */
@keyframes produce {
    from { width: 0%; }
    to   { width: 100%; }
}

/* Einblenden */
.fade-in { animation: fadeIn .4s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Button */
.upgrade-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 6px 20px rgba(108,26,255,.4);
    transform: translateY(-1px);
}
.upgrade-btn:active { transform: scale(.97); }

/* Level-Up Flash */
@keyframes levelUpFlash {
    0%   { box-shadow: 0 0 0 0 rgba(0,255,204,.8); }
    50%  { box-shadow: 0 0 40px 12px rgba(0,255,204,.3); }
    100% { box-shadow: 0 0 0 0 rgba(0,255,204,0); }
}
.level-up { animation: levelUpFlash .7s ease-out; }

/* Sterne im Hintergrund */
@keyframes twinkle {
    0%,100% { opacity: .15; }
    50%      { opacity: .8; }
}

/* Canvas Mine Float */
@keyframes mineFloat {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}
