/* ──────────────────────────────────────────────────────────────────────────
   WSP colour theme
   ────────────────────────────────────────────────────────────────────────── */

:root {
    /* Primary palette */
    --wsp-black: #000000;
    --wsp-white: #ffffff;
    --wsp-red: #ff372f;

    /* Secondary palette */
    --wsp-grey-1: #404040;
    --wsp-grey-2: #cccccc;
    --wsp-red-1: #cc2126;
    --wsp-red-2: #680005;
}

/* ──────────────────────────────────────────────────────────────────────────
   Reset & base
   ────────────────────────────────────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ──────────────────────────────────────────────────────────────────────────
   Top navigation bar
   ────────────────────────────────────────────────────────────────────────── */

.top-nav {
    display: flex;
    align-items: center;
    background-color: var(--wsp-black);
    color: var(--wsp-white);
    height: 52px;
    padding: 0 6px;
    gap: 4px;
    /* Sits above the Leaflet map (z-index 400–1000) */
    position: relative;
    z-index: 1100;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    user-select: none;
    -webkit-user-select: none;
}

/* Brand block: WSP logo + page title, sits at the far left of the nav bar */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 8px;
    flex-shrink: 0;
}

.brand-logo {
    height: 28px;
    width: auto;
    display: block;
}

.brand-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--wsp-white);
    white-space: nowrap;
}

@media (max-width: 480px) {
    /* Save horizontal space for the tabs on narrow/mobile screens */
    .brand-title {
        display: none;
    }
}

/* Tab group stretches to fill the remaining width of the nav bar */
.nav-tabs {
    display: flex;
    flex: 1;
    height: 100%;
}

/* Each tab takes up an equal share (half) of the nav bar */
.nav-tabs .nav-tab {
    flex: 1 1 0;
}

/* Shared button styles */
.nav-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    padding: 0 18px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-radius: 0;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-btn:hover,
.nav-btn:focus-visible {
    background-color: rgba(255, 55, 47, 0.18);
    color: var(--wsp-white);
    outline: none;
}

.nav-btn:active {
    background-color: rgba(255, 55, 47, 0.3);
}

/* Active tab has a coloured underline indicator */
.nav-tab.active {
    color: var(--wsp-white);
    border-bottom: 3px solid var(--wsp-red);
}

/* ──────────────────────────────────────────────────────────────────────────
   Custom Leaflet map controls (locate-me + home buttons)
   ────────────────────────────────────────────────────────────────────────── */

.leaflet-control-custom-btn {
    background-color: var(--wsp-white);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wsp-grey-1);
    text-decoration: none;
}

.leaflet-control-custom-btn:hover,
.leaflet-control-custom-btn:focus-visible {
    background-color: var(--wsp-grey-2);
    color: var(--wsp-black);
}

.leaflet-control-custom-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   Main content area (fills viewport below nav)
   ────────────────────────────────────────────────────────────────────────── */

.main-content {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ──────────────────────────────────────────────────────────────────────────
   Panels (map & info share the same slot)
   ────────────────────────────────────────────────────────────────────────── */

.panel {
    position: absolute;
    inset: 0;
}

.panel.hidden {
    display: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   Map
   ────────────────────────────────────────────────────────────────────────── */

#map {
    width: 100%;
    height: 100%;
    background-color: #d8e8d8; /* visible briefly before tiles load */
}

/* ──────────────────────────────────────────────────────────────────────────
   Info panel
   ────────────────────────────────────────────────────────────────────────── */

#info-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: #f7f9fc;
}

.info-content {
    padding: 24px 20px 40px;
    max-width: 680px;
    margin: 0 auto;
    color: var(--wsp-grey-1);
}

.info-content h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--wsp-black);
}

.info-content h2 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
    color: var(--wsp-red-1);
}

.info-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--wsp-black);
}

.info-content p {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 10px;
}

.info-content ul {
    padding-left: 20px;
    margin-bottom: 10px;
}

.info-content li {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 8px;
}

.info-content code {
    background-color: var(--wsp-grey-2);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    color: var(--wsp-grey-1);
}

/* ──────────────────────────────────────────────────────────────────────────
   Conference point style
   ────────────────────────────────────────────────────────────────────────── */
/* Conference location text marker */
.conference-location-icon .conference-text {
    background-color: white;
    color: black;
    font-weight: bold;
    font-size: 14px;
    padding: 2px 0%;
    border-radius: 2px;
    white-space: nowrap;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
    text-align: center;
    line-height: 1.4;
}
/* ──────────────────────────────────────────────────────────────────────────
   Detection point pop-up table
   ────────────────────────────────────────────────────────────────────────── */

.popup-table {
    border-collapse: collapse;
    font-size: 13px;
    min-width: 160px;
}

.popup-table th,
.popup-table td {
    padding: 3px 6px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--wsp-grey-2);
}

.popup-table th {
    font-weight: 600;
    color: var(--wsp-grey-1);
    white-space: nowrap;
    padding-right: 10px;
}

.popup-table tr:last-child th,
.popup-table tr:last-child td {
    border-bottom: none;
}

/* ──────────────────────────────────────────────────────────────────────────
   GPS location dot (injected into the map via Leaflet divIcon)
   ────────────────────────────────────────────────────────────────────────── */

.gps-location-dot {
    width: 16px;
    height: 16px;
    background-color: #2196f3;
    border: 2.5px solid white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    animation: gps-pulse 2s ease-out infinite;
}

@keyframes gps-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(33, 150, 243, 0.65), 0 1px 4px rgba(0,0,0,0.4); }
    70%  { box-shadow: 0 0 0 12px rgba(33, 150, 243, 0),   0 1px 4px rgba(0,0,0,0.4); }
    100% { box-shadow: 0 0 0 0   rgba(33, 150, 243, 0),    0 1px 4px rgba(0,0,0,0.4); }
}
