/* The map is a fixed full-screen display */
body { overflow: hidden; }
.map-updated { font-size: 14px; color: var(--accent); margin-bottom: 10px; font-family: Lato, sans-serif; font-weight: bold; }

#dash-map { width: 100vw; height: 100vh; background: var(--bg); display: flex; justify-content: center; align-items: center; }   /* Change change map background */
.map-wrapper { position: relative; aspect-ratio: 16 / 9; height: 100vh; max-width: 100vw; background: #111C4E; overflow: hidden; } /* Change change map background */
.map-img { width: 100%; height: 100%; object-fit: contain; }
.map-title-overlay { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); z-index: 1001; font-size: 70px; color: #111C4E; font-weight: bold; text-transform: uppercase; }
.map-legend-overlay { position: absolute; top: 30px; right: 30px; background: rgba(0, 0, 0, 0.7); padding: 20px; border: 1px solid #333; z-index: 1001; text-align: left; }
.key-title { margin: 0 0 15px 0; font-size: 28px; color: #ff8c00; } /* Change Key Title Text */
.legend-item { display: flex; align-items: center; 
    gap: 20px; /* Increase gap to accommodate bigger boxes : was 12px */
    font-size: 18px; /* Change Key Legend Items Text : was 14 px*/
    margin-bottom: 12px;  /* Increase Bottom Margin ; was 8px */
    font-weight: bold; 
    text-transform: uppercase; } /* Change Key Legend Items Text */
#map-svg, #map-markers { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
#map-static-labels { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }
.map-point { position: absolute; display: flex; align-items: center; gap: 8px; }
.map-point-base { left: calc(74.6% - 12.5px); top: calc(86.6% - 12.5px); flex-direction: column; align-items: flex-start; }
.map-point-base .map-point-label { margin-left: -55px; }
.map-point-ptarmigan { left: calc(52.7% - 12.5px); top: calc(28.3% - 58px); flex-direction: column; align-items: flex-start; }
.map-point-dot { width: 25px; height: 25px; border-radius: 50%; background: #111C4E; flex-shrink: 0; }
.map-point-label { font-family: Lato, sans-serif; font-size: 32px; font-weight: bold; color: #111C4E; white-space: nowrap; line-height: 1.2; }

/* Fade between LIFTS <-> PISTES (map layers only) */
#map-svg, #map-markers {
    opacity: 1;
    transition: opacity 0.25s ease;
    will-change: opacity;
}
.map-wrapper.is-fading #map-svg,
.map-wrapper.is-fading #map-markers {
    opacity: 0;
}
/* Lifts tab: solid colour line (original style, same width as before) */
.lift-solid { fill: none; stroke-linecap: round; stroke-width: 0.8; }
/* Status is shown by line style as well as colour: open = solid, expected = dashed, closed = faded */
.stat-open.lift-solid { stroke: var(--status-open); }
.stat-expected.lift-solid { stroke: var(--status-expected); stroke-dasharray: 1.2 1.2; }
.stat-closed.lift-solid { stroke: var(--status-closed); opacity: 0.55; }
.legend-closed { opacity: 0.55; }

/* Tab bar */
.map-tab-bar { position: absolute; bottom: 30px; right: 30px; z-index: 1001; display: flex; gap: 0; }
.map-tab { padding: 12px 24px; font-size: 18px; font-weight: bold; text-transform: uppercase; border: 2px solid #333; background: rgba(0, 0, 0, 0.6); color: #aaa; cursor: pointer; transition: background 0.2s, color 0.2s; }
.map-tab:first-child { border-radius: 6px 0 0 6px; }
.map-tab-runs { border-radius: 0 6px 6px 0; border-left: none; }
/* Small link to log.html, to the right of the LIFTS / PISTES buttons */
.map-log-link { align-self: center; margin-left: 5px; font-size: 12px; color: #ccc; text-decoration: underline; text-transform: uppercase; }
.map-log-link:hover { color: #fff; }
.map-tab:hover { color: #fff; background: rgba(0, 0, 0, 0.8); }
.map-tab-active { background: #ff8c00; color: #111C4E; border-color: #ff8c00; }
.legend-tab-panel { margin-bottom: 4px; }
.legend-subtitle { font-size: 18px; color: #ccc; margin-bottom: 10px; font-weight: bold; }
.legend-subtitle-row { display: flex; align-items: center; gap: 20px; margin-bottom: 10px; }
.legend-subtitle-cell { width: 60px; font-size: 18px; color: #ccc; font-weight: bold; text-align: center; }
.legend-piste-line { width: 60px; height: 14px; display: block; flex-shrink: 0; }

/* Pistes: thinner than lifts; colour by difficulty; strong = open, faint = closed */
.piste-line { fill: none; stroke-linecap: round; stroke-width: 0.15; }
/* Open runs: ~4x thicker */
.piste-green.piste-open { stroke: #28a745; stroke-width: 0.6; }
.piste-blue.piste-open { stroke: #007bff; stroke-width: 0.6; }
.piste-red.piste-open { stroke: #dc3545; stroke-width: 0.6; }
.piste-black.piste-open { stroke: #1a1a1a; stroke-width: 0.6; }
/* Expected runs: short visible dashes (1 2 in viewBox units – same ratio as key’s 4 12, smaller so many dashes per run) */
.piste-green.piste-expected { stroke: #5fd37a; stroke-width: 0.6; stroke-dasharray: 1 2; stroke-linecap: round; }
.piste-blue.piste-expected { stroke: #5aa3e8; stroke-width: 0.6; stroke-dasharray: 1 2; stroke-linecap: round; }
.piste-red.piste-expected { stroke: #e86a6a; stroke-width: 0.6; stroke-dasharray: 1 2; stroke-linecap: round; }
.piste-black.piste-expected { stroke: #4a4a4a; stroke-width: 0.6; stroke-dasharray: 1 2; stroke-linecap: round; }
/* Difficulty colours - closed (faint) */
.piste-green.piste-closed { stroke: rgba(40, 167, 69, 0.35); }
.piste-blue.piste-closed { stroke: rgba(0, 123, 255, 0.35); }
.piste-red.piste-closed { stroke: rgba(220, 53, 69, 0.35); }
.piste-black.piste-closed { stroke: rgba(0, 0, 0, 0.35); }
.station { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; transform: translate(-50%, -50%); z-index: 10; }
.station.stat-open { background: #28a745; animation: station-pulse 2s infinite ease-in-out; }
.station.stat-expected { background: #ff8c00; animation: station-pulse 2s infinite ease-in-out; }
.station.stat-closed { background: #dc3545; animation: station-pulse 3s infinite ease-in-out; }
.lift-num { position: absolute; width: 22px; height: 22px; background: #000; color: #fff; border-radius: 50%; border: 1.5px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; transform: translate(-50%, -50%); z-index: 15; }
@keyframes station-pulse { 0%, 100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.7; } 50% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; } }