/* Crew Path / Galaxy Map */
.galaxy-map-wrapper {
    position: relative;
    border: 2px solid var(--saber-blue);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--saber-glow);
    margin: 1.5rem 0;
}

.galaxy-map-image {
    display: block;
    width: 100%;
    height: auto;
}

.galaxy-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.crew-path-line {
    fill: none;
    stroke: var(--saber-blue);
    stroke-width: 0.4;
    stroke-dasharray: 1.5 0.8;
    stroke-linecap: round;
    opacity: 0.9;
}

.marker-glow {
    fill: rgba(77, 184, 255, 0.35);
    animation: marker-pulse 3s ease-in-out infinite;
}

.marker-dot {
    fill: var(--starwars-yellow);
    stroke: var(--saber-blue);
    stroke-width: 0.25;
}

.marker-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 2px;
    fill: var(--starwars-yellow);
    font-weight: 700;
    text-transform: uppercase;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.8);
    stroke-width: 0.4px;
}

.marker-episode {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5px;
    fill: var(--saber-blue);
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.8);
    stroke-width: 0.3px;
}

.crew-path-marker a {
    cursor: pointer;
}

.crew-path-marker a:hover .marker-dot {
    fill: #fff;
}

.crew-path-marker a:hover .marker-label {
    fill: #fff;
}

@keyframes marker-pulse {
    0%, 100% { r: 1.5; opacity: 0.35; }
    50% { r: 2.2; opacity: 0.55; }
}

/* Episode Mini Map */
.episode-minimap {
    margin-top: 2.5rem;
    text-align: center;
}

.episode-minimap-heading {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2em;
    color: var(--starwars-yellow);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--saber-blue);
}

.episode-minimap-link {
    display: block;
    text-decoration: none;
}

/* Holographic 3D Minimap */
.holo-map-stage {
    position: relative;
    width: 500px;
    height: 380px;
    margin: -60px auto 0;
    perspective: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.holo-map-tilt {
    transform: rotateX(55deg);
    transform-style: preserve-3d;
    z-index: 1;
}

.holo-map-spin {
    width: 460px;
    height: 460px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    animation: holo-rotate 30s linear infinite;
    box-shadow:
        0 0 20px rgba(30, 100, 220, 0.4),
        0 0 40px rgba(30, 100, 220, 0.2),
        inset 0 0 20px rgba(30, 100, 220, 0.15);
    border: 1px solid rgba(77, 184, 255, 0.3);
    -webkit-mask-image: radial-gradient(circle, black 40%, transparent 70%);
    mask-image: radial-gradient(circle, black 40%, transparent 70%);
}

.holo-map-surface {
    width: 100%;
    height: 100%;
    background-image: url('/images/galaxy_map.jpeg');
    background-size: 500%;
    background-repeat: no-repeat;
    opacity: 0.7;
    filter: brightness(1.2);
}

.holo-map-tint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 100, 220, 0.3);
    mix-blend-mode: color;
    pointer-events: none;
}

@keyframes holo-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Marker overlay — sibling of tilt, unaffected by 3D transforms */
.holo-marker-overlay {
    position: absolute;
    top: calc(50% + 6px);
    left: 50%;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.holo-marker-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--starwars-yellow);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(77, 184, 255, 0.8), 0 0 16px rgba(77, 184, 255, 0.4);
    white-space: nowrap;
    margin-bottom: 4px;
}

.holo-marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--starwars-yellow);
    border: 2px solid rgba(77, 184, 255, 0.8);
    box-shadow: 0 0 10px rgba(77, 184, 255, 0.6), 0 0 20px rgba(77, 184, 255, 0.3);
    animation: holo-dot-pulse 3s ease-in-out infinite;
    flex-shrink: 0;
}

.holo-marker-line {
    width: 2px;
    height: 55px;
    background: linear-gradient(to bottom, rgba(77, 184, 255, 0.8), rgba(77, 184, 255, 0));
    animation: holo-beam-pulse 3s ease-in-out infinite;
}

@keyframes holo-dot-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(77, 184, 255, 0.6), 0 0 20px rgba(77, 184, 255, 0.3); }
    50%      { box-shadow: 0 0 16px rgba(77, 184, 255, 0.9), 0 0 32px rgba(77, 184, 255, 0.5); }
}

@keyframes holo-beam-pulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* Base glow — elliptical light beneath the hologram */
.holo-map-base-glow {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 40px;
    background: radial-gradient(ellipse, rgba(30, 100, 220, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

/* Hover: intensify glow */
.episode-minimap-link:hover .holo-map-spin {
    box-shadow:
        0 0 30px rgba(30, 100, 220, 0.6),
        0 0 60px rgba(30, 100, 220, 0.3),
        inset 0 0 30px rgba(30, 100, 220, 0.2);
}

.episode-minimap-link:hover .holo-map-base-glow {
    background: radial-gradient(ellipse, rgba(30, 100, 220, 0.5) 0%, transparent 70%);
}

.episode-minimap-link:hover .holo-marker-dot {
    box-shadow: 0 0 18px rgba(77, 184, 255, 0.9), 0 0 36px rgba(77, 184, 255, 0.5);
}

/* Crew Path Legend */
.crew-path-legend {
    margin-top: 2rem;
}

.crew-path-legend h2 {
    margin-top: 1rem;
}

.legend-stops {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.legend-stop {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid rgba(77, 184, 255, 0.3);
    border-left: 3px solid var(--saber-blue);
    border-radius: 0 6px 6px 0;
    flex: 1 1 200px;
}

.legend-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--starwars-yellow);
    border: 2px solid var(--saber-blue);
    box-shadow: 0 0 8px var(--saber-blue-glow);
    flex-shrink: 0;
}

.legend-info {
    display: flex;
    flex-direction: column;
}

.legend-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85em;
    color: var(--starwars-yellow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-name a {
    color: var(--starwars-yellow);
    font-size: 1em;
}

.legend-episodes {
    font-size: 0.8em;
    color: var(--saber-blue);
}

/* Galaxy Map Link Button */
.galaxy-map-link {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65em;
    color: var(--saber-blue);
    border: 1px solid var(--saber-blue);
    border-radius: 4px;
    padding: 0.25em 0.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
    vertical-align: middle;
    margin-left: 0.75rem;
    transition: background 0.2s ease, color 0.2s ease;
    font-weight: 700;
}

.galaxy-map-link:hover {
    background: var(--saber-blue);
    color: var(--dark-bg);
}
