
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
html {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #000c1e;
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* OBERER BEREICH: SOLARSYSTEM */
#solarSystemView {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 300px;
    overflow: hidden;

    background-image:
        linear-gradient(rgba(2, 5, 14, 0.35), rgba(2, 5, 14, 0.68)),
        radial-gradient(circle at 45% 40%, rgba(90, 120, 255, 0.12), transparent 42%),
        url("bilder/space-hero.jpg");

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    cursor: default;
    flex-shrink: 0;
    border-bottom: 2px solid rgba(100, 140, 255, 0.18);
    touch-action: none;
    z-index: 1;
    isolation: isolate;
}

/* Sterne-Hintergrund */
#solarSystemView::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.45) 0%, transparent 100%),
        radial-gradient(1px 1px at 25% 60%, rgba(255,255,255,0.32) 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 10%, rgba(255,255,255,0.42) 0%, transparent 100%),
        radial-gradient(1px 1px at 55% 75%, rgba(255,255,255,0.25) 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 35%, rgba(255,255,255,0.35) 0%, transparent 100%),
        radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.38) 0%, transparent 100%),
        radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.30) 0%, transparent 100%),
        radial-gradient(1px 1px at 92% 15%, rgba(255,255,255,0.40) 0%, transparent 100%),
        radial-gradient(1px 1px at 33% 45%, rgba(255,255,255,0.22) 0%, transparent 100%),
        radial-gradient(1px 1px at 78% 90%, rgba(255,255,255,0.34) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

/* Solarsystem-Text entfernen */
#galaxyLabel {
    display: none;
}

/* Canvas */
#solarCanvas {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    z-index: 1;
    will-change: transform;
}

/* PLANETEN */
.planet-2d {
    position: absolute;
    cursor: pointer;
    text-align: center;
    transform-style: preserve-3d;
    transition:
        transform 1.35s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.8s ease,
        opacity 1.4s ease;
    will-change: transform, filter, opacity;
}

.planet-2d:hover {
    transform: scale(1.08) !important;
    filter: none !important;
    z-index: 120;
}

.planet-2d:hover img {
    filter:
        drop-shadow(0 10px 18px rgba(0, 0, 0, 0.48))
        drop-shadow(0 0 12px rgba(135, 170, 255, 0.24));
}

.planet-2d img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
    transition:
        filter 2.8s ease,
        transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Planetenbeschriftungen ohne Kreis/Form */
.planet-label {
    position: absolute;
    top: calc(100% + 9px);
    bottom: auto;
    left: 50%;
    transform: translate3d(-50%, 0, 0);
    background: none;
    backdrop-filter: none;
    padding: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    white-space: nowrap;

    color: rgba(245, 248, 255, 0.96);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.65px;
    line-height: 1;

    pointer-events: none;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.95),
        0 4px 12px rgba(0, 0, 0, 0.72);

    -webkit-font-smoothing: subpixel-antialiased;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    z-index: 5;
}

/* Wenn ein Planet aktiv ist, treten andere smooth zurück */
#solarSystemView.has-active-planet .planet-2d:not(.planet-active) {
    opacity: 0.28;
    filter: brightness(0.72) saturate(0.82) blur(0.2px);
}

#solarSystemView.has-active-planet .planet-2d.planet-left:not(.planet-active) {
    transform: translateX(-85px) scale(0.78) !important;
}

#solarSystemView.has-active-planet .planet-2d.planet-right:not(.planet-active) {
    transform: translateX(85px) scale(0.78) !important;
}

/* Aktiver Planet */
.planet-2d.planet-active {
    transform: scale(1.38) translateY(-8px) !important;
    filter: none !important;
    z-index: 900;
}

.planet-2d.planet-active img {
    animation: planetPremiumGlow 7s ease-in-out infinite;
}

/* Beschriftung wird beim Skalieren nicht riesig und bleibt lesbar */
.planet-2d.planet-active .planet-label {
    transform: translate3d(-50%, 0, 0) scale(0.78);
    color: #ffffff;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 1),
        0 5px 14px rgba(0, 0, 0, 0.82);
}

@keyframes planetPremiumGlow {
    0% {
        filter:
            brightness(1)
            contrast(1.02)
            saturate(1.03)
            drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55))
            drop-shadow(0 0 14px rgba(130, 170, 255, 0.20));
        transform: rotateZ(0deg) scale(1);
    }

    50% {
        filter:
            brightness(1.05)
            contrast(1.03)
            saturate(1.06)
            drop-shadow(0 14px 20px rgba(0, 0, 0, 0.58))
            drop-shadow(0 0 20px rgba(130, 170, 255, 0.16));
        transform: rotateZ(0.35deg) scale(1.01);
    }

    100% {
        filter:
            brightness(1)
            contrast(1.02)
            saturate(1.03)
            drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55))
            drop-shadow(0 0 14px rgba(130, 170, 255, 0.20));
        transform: rotateZ(0deg) scale(1);
    }
}

/* Zoom-Buttons */
.zoom-controls {
    position: absolute;
    bottom: 12px;
    right: 14px;
    z-index: 20;
    display: flex;
    gap: 6px;
}

.zoom-controls button {
    background: rgba(20, 30, 70, 0.85);
    border: 1px solid rgba(100,140,255,0.3);
    color: #99b3ff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: 0.2s;
    backdrop-filter: blur(6px);
}

.zoom-controls button:hover {
    background: rgba(80, 100, 220, 0.6);
    color: white;
}

.map-hint {
    position: absolute;
    bottom: 14px;
    left: 14px;
    font-size: 10px;
    color: rgba(150,170,255,0.4);
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 10;
}

/* TRENNLINIE */
.divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(80,120,255,0.4) 20%, rgba(80,120,255,0.4) 80%, transparent);
    flex-shrink: 0;
}

/* UNTERER BEREICH: BLOG */
#blogSection {
    position: relative;
    z-index: 2;
    background: #080c1e;
    display: flex;
    flex-direction: column;
    overflow: visible;
    flex: 0 0 auto;
    min-height: auto;
}

/* ARTIKEL DES TAGES */
#noPlanetMsg {
    padding: 16px 24px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 1220px;
    width: 100%;
    margin: 0 auto;
    order: 1;
    min-height: 250px;
}

#noPlanetMsg h3 {
    font-size: 10px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: rgba(170, 185, 255, 0.58);
    font-weight: 700;
}

#noPlanetMsg .blog-card {
    height: 180px;
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border-color: rgba(100,140,255,0.3);
}

#noPlanetMsg .blog-card:hover {
    border-color: rgba(100,140,255,0.6);
    box-shadow: 0 0 20px rgba(80,100,255,0.15);
}

#noPlanetMsg .blog-bild {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(80,110,200,0.25);
}

#noPlanetMsg .blog-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: #e0e8ff;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 8px;
}

#noPlanetMsg .blog-card p {
    font-size: 13px;
    color: rgba(180,195,240,0.8);
    line-height: 1.5;
}

/* PLANETENANSICHT */
#planetView {
    display: none;
    flex-direction: column;
    overflow: visible;
    order: 2;
    flex: 0 0 auto;
    min-height: 250px;
}

#planetView.active {
    display: flex;
}

/* Wenn noch keine Artikel im angeklickten Planeten sind, keinen leeren Bereich anzeigen */
#planetView.active:has(#blogList:not(:has(.blog-card))) {
    display: none;
}

.planet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 12px;
    border-bottom: 1px solid rgba(80,100,200,0.2);
    flex-shrink: 0;
    background: rgba(10,16,40,0.8);
    backdrop-filter: blur(8px);
}

.planet-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.planet-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #c8d8ff;
    letter-spacing: 0.5px;
}

.back-btn {
    background: rgba(30,45,100,0.7);
    border: 1px solid rgba(100,130,255,0.25);
    color: #99b3ff;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-primary {
    background-color: #31406f;
    background-image: none;

    border: 1px solid rgba(180, 195, 255, 0.24);
    color: #ffffff;

    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;

    font-family: "Inter", system-ui, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;

    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background-color 0.22s ease;

    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(40, 60, 130, 0.22);
}

.btn-primary:hover {
    background-color: #3a4f8d;
    background-image: none;

    transform: translateY(-1px);
    border-color: rgba(210, 220, 255, 0.34);
    box-shadow: 0 10px 26px rgba(50, 75, 160, 0.28);
}

/* BLOGLISTE */
#blogList {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    overflow: visible;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    flex: 0 0 auto;
}

#blogList::-webkit-scrollbar {
    width: 4px;
}

#blogList::-webkit-scrollbar-thumb {
    background: rgba(100,130,255,0.3);
    border-radius: 4px;
}

/* BLOG-CARDS */
.blog-card {
    background: rgba(20, 30, 65, 0.7);
    border: 1px solid rgba(80,110,200,0.2);
    border-radius: 14px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 6px 14px;
    align-items: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.blog-card:hover {
    border-color: rgba(100,140,255,0.4);
}

.blog-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #e0e8ff;
    grid-column: 1;
    grid-row: 1;
}

.blog-card p {
    font-size: 13px;
    color: rgba(180,195,240,0.8);
    line-height: 1.55;
    grid-column: 1;
    grid-row: 2;
}

.blog-card .blog-bild {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    grid-column: 2;
    grid-row: 1 / 3;
    flex-shrink: 0;
    display: block;
    border: 1px solid rgba(80,110,200,0.25);
}

/* NEUER ARTIKEL BUTTON */
#neuerEintragBtn {
    padding: 10px 18px 12px;
    display: flex;
    justify-content: flex-end;
    margin-top: 0;
    border-top: 1px solid rgba(80,100,200,0.2);
    flex-shrink: 0;
    order: 3;
}

/* 3 Artikel des Tages auf der Startseite */
.artikel-des-tages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    width: 100%;
}

.artikel-des-tages-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.artikel-text {
    min-width: 0;
}

/* RESPONSIVE */
@media (max-width: 1000px) {
    .artikel-des-tages-grid {
        grid-template-columns: 1fr;
    }

    #noPlanetMsg,
    #planetView {
        min-height: auto;
    }

    #noPlanetMsg .blog-card {
        height: auto;
    }
}

@media (max-width: 900px) {
    .planet-2d.planet-active .planet-label {
        transform: translate3d(-50%, 0, 0) scale(0.84);
    }
}

@media (max-width: 600px) {
    .planet-label {
        font-size: 12px;
        letter-spacing: 0.35px;
    }

    .planet-2d.planet-active .planet-label {
        transform: translate3d(-50%, 0, 0) scale(0.9);
    }
}