/**
 * OrbiSky v2 - Starlink Train Flyover Styles
 * CSS für Starlink-Train-Überflug Beobachtungs-Slide
 *
 * Farbschema: Gold/Gelb (#FFD700)
 * Priorität 98 (nur Raketen höher)
 */

/* ============= Starlink Flyover Container ============= */

#starlink-flyover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Nachthimmel-Gradient mit goldenem Touch */
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 165, 0, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(20, 40, 80, 0.3) 0%, transparent 70%),
        linear-gradient(180deg, #030810 0%, #0a1628 40%, #0c1a30 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--margin-screen, 40px);
    box-sizing: border-box;
    z-index: 100;
    opacity: 0;
    transition: opacity 1.2s ease;
    overflow: hidden;
}

#starlink-flyover.active {
    display: flex;
    opacity: 1;
}

/* ============= Animierte Sterne mit Starlink-Spur ============= */

#starlink-flyover .starlink-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        /* Helle Sterne */
        radial-gradient(2px 2px at 8% 15%, rgba(255,255,255,0.9) 0%, transparent 100%),
        radial-gradient(2px 2px at 25% 40%, rgba(255,240,200,0.85) 0%, transparent 100%),
        radial-gradient(2px 2px at 72% 22%, rgba(255,215,0,0.7) 0%, transparent 100%),
        radial-gradient(2px 2px at 88% 65%, rgba(255,255,255,0.85) 0%, transparent 100%),
        /* Mittlere Sterne */
        radial-gradient(1.5px 1.5px at 15% 70%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 45% 12%, rgba(255,215,0,0.6) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 60% 85%, rgba(255,255,255,0.7) 0%, transparent 100%),
        radial-gradient(1.5px 1.5px at 92% 35%, rgba(255,240,200,0.6) 0%, transparent 100%);
    animation: starlinkStarsTwinkle 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes starlinkStarsTwinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ============= Starlink-Train Animation (Perlenkette) ============= */

#starlink-flyover .starlink-train-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

#starlink-flyover .satellite-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 0 0 24px rgba(255, 215, 0, 0.4);
    animation: trainTraverse 20s linear infinite;
}

/* Mehrere Satelliten-Punkte mit Versatz */
#starlink-flyover .satellite-dot:nth-child(1) { animation-delay: 0s; }
#starlink-flyover .satellite-dot:nth-child(2) { animation-delay: 0.4s; }
#starlink-flyover .satellite-dot:nth-child(3) { animation-delay: 0.8s; }
#starlink-flyover .satellite-dot:nth-child(4) { animation-delay: 1.2s; }
#starlink-flyover .satellite-dot:nth-child(5) { animation-delay: 1.6s; }
#starlink-flyover .satellite-dot:nth-child(6) { animation-delay: 2.0s; }
#starlink-flyover .satellite-dot:nth-child(7) { animation-delay: 2.4s; }
#starlink-flyover .satellite-dot:nth-child(8) { animation-delay: 2.8s; }

@keyframes trainTraverse {
    0% {
        left: -5%;
        top: 70%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        left: 50%;
        top: 25%;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 105%;
        top: 40%;
        opacity: 0;
    }
}

/* ============= Hauptinhalt ============= */

#starlink-flyover .starlink-content {
    position: relative;
    z-index: 10;
    text-align: center;
    width: 90%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
}

/* ============= Alert-Badge ============= */

#starlink-flyover .starlink-badge {
    /* Goldenes Badge */
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 50%, #FFD700 100%);
    color: #1a1510;
    font-size: 1.6em;
    font-weight: 700;
    padding: 0.5em 1.5em;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    box-shadow:
        0 4px 20px rgba(255, 215, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: starlinkBadgeGlow 3s ease-in-out infinite;
}

@keyframes starlinkBadgeGlow {
    0%, 100% {
        box-shadow:
            0 4px 20px rgba(255, 215, 0, 0.4),
            0 0 40px rgba(255, 215, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow:
            0 6px 30px rgba(255, 215, 0, 0.6),
            0 0 60px rgba(255, 215, 0, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* Phase: Visible - Grünes Badge */
#starlink-flyover.phase-visible .starlink-badge {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 50%, #16a34a 100%);
    color: #052e16;
    animation: starlinkBadgeNow 1.5s ease-in-out infinite;
}

@keyframes starlinkBadgeNow {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 4px 25px rgba(34, 197, 94, 0.5),
            0 0 50px rgba(34, 197, 94, 0.2);
    }
    50% {
        transform: scale(1.04);
        box-shadow:
            0 6px 35px rgba(34, 197, 94, 0.7),
            0 0 80px rgba(34, 197, 94, 0.3);
    }
}

/* Phase: Farewell - Sanfteres Orange */
#starlink-flyover.phase-farewell .starlink-badge {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #ea580c 100%);
    animation: starlinkBadgeGlow 3s ease-in-out infinite;
}

/* ============= Headline ============= */

#starlink-flyover .starlink-headline {
    font-size: 3.5em;
    font-weight: 600;
    color: #ffffff;
    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.2);
    line-height: 1.15;
}

/* ============= Subline (Satelliten-Anzahl) ============= */

#starlink-flyover .starlink-subline {
    font-size: 2.2em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.5);
}

/* ============= Train-Info ============= */

#starlink-flyover .starlink-train-info {
    font-size: 1.4em;
    color: #FFD700;
    font-weight: 500;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* ============= Brightness Badge ============= */

#starlink-flyover .starlink-brightness {
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 215, 0, 0.15);
    padding: 0.3em 1em;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ============= Richtungen (Trajektorie) ============= */

#starlink-flyover .starlink-directions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1em;
    font-size: 1.6em;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.6em 1.5em;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

#starlink-flyover .starlink-start-direction,
#starlink-flyover .starlink-end-direction {
    font-weight: 500;
    color: #ffffff;
}

#starlink-flyover .starlink-arrow {
    color: #FFD700;
    font-size: 1.2em;
}

/* ============= Duration ============= */

#starlink-flyover .starlink-duration {
    font-size: 1.4em;
    color: rgba(255, 255, 255, 0.7);
}

/* ============= Elevation ============= */

#starlink-flyover .starlink-elevation {
    font-size: 1.3em;
    color: #FFD700;
    font-weight: 500;
}

/* ============= Sichtbarkeits-Qualität ============= */

#starlink-flyover .starlink-quality {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    margin-top: 0.5em;
}

#starlink-flyover .starlink-quality-bar {
    width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

#starlink-flyover .starlink-quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #fbbf24 50%, #22c55e 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Qualitäts-Level Farben */
#starlink-flyover .starlink-quality-fill.quality-excellent {
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
}

#starlink-flyover .starlink-quality-fill.quality-good {
    background: linear-gradient(90deg, #fbbf24 0%, #22c55e 100%);
}

#starlink-flyover .starlink-quality-fill.quality-fair {
    background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%);
}

#starlink-flyover .starlink-quality-fill.quality-poor {
    background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

#starlink-flyover .starlink-quality-label {
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.7);
}

/* ============= Countdown ============= */

#starlink-flyover .starlink-countdown {
    font-size: 2.4em;
    font-weight: 600;
    color: #fbbf24;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    letter-spacing: 0.05em;
    text-shadow:
        0 0 15px rgba(251, 191, 36, 0.4),
        0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Phase: Visible - Grüner Countdown */
#starlink-flyover.phase-visible .starlink-countdown {
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

/* ============= Info-Bar unten ============= */

#starlink-flyover .starlink-info-bar {
    position: absolute;
    bottom: 4vh;
    left: 5vw;
    right: 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.3em;
    color: rgba(255, 255, 255, 0.6);
    z-index: 20;
}

#starlink-flyover .starlink-info-bar .location-name {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

#starlink-flyover .starlink-info-bar .orbisky-brand {
    font-weight: 700;
    letter-spacing: 0.02em;
}

#starlink-flyover .starlink-info-bar .orbisky-brand .accent {
    color: #FFD700;
}

/* ============= Responsive ============= */

@media (max-width: 720px) {
    #starlink-flyover .starlink-headline {
        font-size: 2.8em;
    }

    #starlink-flyover .starlink-subline {
        font-size: 1.8em;
    }

    #starlink-flyover .starlink-directions {
        font-size: 1.4em;
        flex-wrap: wrap;
    }

    #starlink-flyover .starlink-countdown {
        font-size: 2em;
    }
}
