@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Anybody:wght@400;700;900&display=swap');

:root {
    --blue: #000dff;
    --blue-light: #84a8ec;
    --yellow: #ffe600;
    --cyan: #0040ff;
    --lime: #91ff00;
    --black: #0a0a0a;
    --white: #ffffff;
    --gray: #dcdcdc;
    --transgray: #dcdcdcb2;
    --darkgray: #6a6a6a;

    --body: Arial, sans-serif;
    --mono: 'Space Mono', monospace;
    --display: 'Anybody', sans-serif;

    --border: 2px solid var(--blue);
    --border-dark: 2px solid var(--black);

    /* gradient palette */
    --grad-1: linear-gradient(135deg, #ff6b6b 0%, #feca57 25%, #48dbfb 50%, #ff9ff3 75%, #54a0ff 100%);
    --grad-2: linear-gradient(90deg, #00ff87 0%, #60efff 50%, #ff00e5 100%);
}

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

body {
    font-family: var(--body);
    font-size: 18px;
    background: var(--black);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== */
/* UNIFIED HEADINGS */
/* ==================== */

h1,
h2,
h3,
h4 {
    font-family: var(--display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--blue);
    margin: 0;
}

h1 {
    font-size: 36px;
    font-weight: 900;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}


/* primary hover */
.hover-primary:hover,
.calendar-day:hover:not(.inactive),
nav a:hover,
.footer-links a:hover {
    background: var(--lime);
    color: var(--black);
}

/* secondary hover border highlight */
.hover-border:hover,
.step:hover,
.faq-item:hover,
.node-card:hover {
    border-color: var(--blue);
}


.hover-shift:hover,
.event-item:hover {
    transform: translateX(4px);
}

/* HEADER */
header {
    display: flex;
    width: 100%;
    align-items: stretch;
    position: fixed;
    z-index: 999;
    top: 0px;
}

.header-title {
    font-family: var(--display);
    font-size: 40px;
    font-weight: 900;
    color: var(--white);
    background: var(--blue);
    padding: 0 10px;
    display: flex;
    align-items: center;
    letter-spacing: 1px;
}

nav {
    background: var(--black);
    display: flex;
    margin-left: auto;
    width: 360px;
}

nav a {
    padding: 0 20px;
    text-decoration: none;
    color: var(--white);
    border-left: 1px solid #333;
    transition: all 0.1s;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

nav a:hover {
    background: var(--lime);
    color: var(--black);
    text-decoration: dotted;
    text-underline-position: below;
}

nav a.active {
    background: var(--blue);
    color: var(--white);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    font-family: var(--display);
    background: var(--blue);
    border: none;
    color: var(--white);
    font-size: 30px;
    cursor: pointer;
    z-index: 1000;
}

.nav-toggle:hover {
    background: var(--lime);
    color: var(--black);
}

/* MAIN LAYOUT */
main {
    display: flex;
    height: calc(100vh - 40px);
}

/* MAP SECTION */
.map-section {
    flex: 1;
    border-right: 3px solid var(--blue);
    position: relative;
    background: var(--black);
    overflow: hidden;
    min-width: 0;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Override maplibre popup styles for dark theme */
.maplibregl-popup-content {
    background: var(--black) !important;
    border: 2px solid var(--white) !important;
    border-radius: 0 !important;
    padding: 16px !important;
    color: var(--white) !important;
    font-family: var(--mono) !important;
}

.maplibregl-popup-close-button {
    font-size: 24px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 28px !important;
    color: var(--white) !important;
    right: 4px !important;
    top: 4px !important;
}

.maplibregl-popup-close-button:hover {
    background: var(--blue) !important;
    color: var(--white) !important;
}

.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: var(--white) !important;
}

.map-overlay {
    position: absolute;
    top: 58px;
    left: 20px;
    background: var(--black);
    border: 2px solid var(--white);
    padding: 12px 16px;
    font-size: 12px;
    z-index: 10;
}

.map-overlay h3 {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--white);
    color: var(--blue);
}

.coord {
    font-family: var(--mono);
    color: #666;
}

/* Stats overlay */
.stats-overlay {
    position: absolute;
    top: 58px;
    right: 20px;
    z-index: 10;
}

.stat-box {
    background: var(--black);
    color: var(--yellow);
    padding: 12px 16px;
    margin-bottom: 8px;
    font-weight: 700;
}

/* Style switcher */
.style-switcher {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--black);
    border: 1px solid var(--white);
    padding: 8px 12px;
    font-size: 12px;
    z-index: 10;
    cursor: pointer;
    transition: all 0.1s;
}

.style-switcher:hover {
    background: var(--blue);
    border-color: var(--blue);
}

.style-switcher .label {
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

#style-indicator {
    color: var(--white);
    font-weight: 600;
}

.stat-box .num {
    font-family: var(--display);
    font-size: 32px;
    line-height: 1;
}

.stat-box .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Popup styles */
.marker-popup {
    font-family: var(--mono);
    font-size: 12px;
}

.marker-popup h4 {
    margin-bottom: 4px;
    color: var(--yellow);
}

.marker-popup .org {
    color: var(--white);
    margin-bottom: 4px;
}

.marker-popup .coord {
    color: #666;
    font-size: 10px;
}

/* SIDEBAR */
.sidebar {
    margin: 40px 0;
    width: 360px;
    flex-shrink: 0;
    background: var(--gray);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.sidebar-section {
    border-bottom: 2px solid var(--black);
    padding: 20px;
    padding-bottom: 40px;
}

.sidebar-section h2 {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}

.sidebar-section h2::before {
    content: '';
    width: 14px;
    height: 14px;
    background: var(--yellow);
    border: 2px solid var(--black);
}

/* CALENDAR (mini / sidebar) */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: var(--black);
    border: 2px solid var(--black);
}

.calendar-header {
    background: var(--black);
    color: #666;
    padding: 8px 4px;
    text-align: center;
    font-size: 10px;
    text-transform: uppercase;
}

.calendar-day {
    background: var(--gray);
    padding: 6px;
    min-height: 44px;
    font-size: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.1s;
    color: var(--black);
}

.calendar-day:hover {
    background: var(--lime);
}

.calendar-day.inactive {
    background: var(--darkgray);
    color: #999;
    cursor: default;
}

.calendar-day.has-event {
    background: linear-gradient(135deg, var(--gray) 70%, transparent 70%),
        var(--yellow);
    color: var(--black);
}

.calendar-day.jam-day {
    background: linear-gradient(135deg, var(--gray) 70%, transparent 70%),
        var(--blue);
    color: var(--black);
}

.calendar-day.play-day {
    background: linear-gradient(135deg, var(--gray) 70%, transparent 70%),
        var(--lime);
    color: var(--black);
}

.calendar-day.launch {
    background: linear-gradient(135deg, var(--gray) 70%, transparent 70%),
        var(--blue);
    color: var(--black);
    font-weight: 700;
}

.day-num {
    font-weight: 600;
}

.day-label {
    font-size: 8px;
    text-transform: uppercase;
    margin-top: 2px;
    line-height: 1.2;
    color: var(--black);
}

.calendar-day.has-event .day-label {
    color: var(--black);
}

.calendar-day.launch .day-label {
    color: var(--blue);
}

/* LOCATIONS LIST */
.locations-list {
    list-style: none;
}

.location-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-bottom: 1px dotted #444;
    cursor: pointer;
    transition: all 0.1s;
}

.location-item:hover {
    padding-left: 12px;
}

.location-info {
    flex: 1;
}

.location-city {
    font-weight: 700;
    font-size: 18px;
    padding-bottom: 3px;
    color: var(--black);
}

.location-org {
    font-size: 14px;
    color: var(--blue);
}

.location-tz {
    font-size: 12px;
    color: #666;
    font-family: var(--mono);
}

/* EVENT LIST */
.event-list {
    list-style: none;
}

.event-item {
    border: 2px solid #444;
    margin-bottom: 8px;
    transition: all 0.1s;
}

.event-item:hover {
    border-color: var(--blue);
    transform: translateX(4px);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid #444;
}

.event-title {
    color: var(--black);
    font-weight: 600;
    font-size: 16px;
}

.event-location {
    font-size: 9px;
    padding: 3px 6px;
    background: var(--blue);
    color: var(--black);
    font-weight: 700;
}

.event-meta {
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    gap: 12px;
    color: #999;
}

.event-item.event-color-jam {
    border-left: 4px solid var(--blue);
}

.event-item.event-color-play {
    border-left: 4px solid var(--yellow);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* FOOTER */
footer {
    background: var(--black);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: stretch;
    font-size: 18px;
    border-top: 2px solid var(--blue);
    z-index: 100;
}

.footer-brand {
    background: var(--blue);
    color: var(--white);
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-weight: 200;
    font-family: var(--display);
}

.footer-status {
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid #333;
    color: var(--white);
}

.footer-status .blink {
    color: var(--lime);
    animation: blink 1s infinite;
}

.footer-links {
    display: flex;
    margin-left: auto;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-left: 1px solid #333;
    font-weight: 700;
    transition: all 0.1s;
}

.footer-links a:hover {
    background: var(--lime);
    color: var(--black);
}

.footer-time {
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-left: 1px solid #333;
    color: var(--yellow);
    font-family: var(--mono);
}


@media (max-width: 900px) {

    main {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 40px);
    }

    .map-section {
        min-height: 60vh;
        padding: 0px;
        border: none;
    }

    .header-title {
        font-size: 25px;
        margin: none;
        padding: none;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        padding: 0px 10px;
        order: -1;
    }

    .map-section {
        flex: 1;
        top: 38px;
        border: none;
        border-right: none;
        position: relative;
        overflow: hidden;
        min-width: 0;
    }

    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding-left: 50px;
        /* height: 100vh; */
        flex-direction: column;
        background: var(--black);
        transition: transform 0.3s;
        z-index: 999;
        transform: translateX(-100%);
    }

    nav.open {
        transform: translateX(0);
    }

    nav a {
        border-left: none;
        font-size: 28px;
        padding: 10px;
        justify-content: flex-start;
    }

    /* main {
        height: 100vh;
    } */
    .sidebar {
        width: 100%;
        height: auto;
    }

    .sidebar-section {
        border-bottom: 2px solid var(--black);
        /* padding-bottom: 40px; */
    }
}

@media (max-width: 768px) {
    footer {
        font-size: 12px;
        height: auto;
        flex-wrap: wrap;
    }

    .footer-brand {
        padding: 8px 12px;
        font-size: 14px;
    }

    .footer-status {
        padding: 8px 10px;
        font-size: 11px;
    }

    .footer-links {
        order: 3;
        width: 100%;
        border-top: 1px solid #333;
    }

    .footer-links a {
        flex: 1;
        justify-content: center;
        padding: 8px;
        font-size: 11px;
        border-left: none;
        border-right: 1px solid #333;
    }

    .footer-links a:last-child {
        border-right: none;
    }

    .footer-time {
        padding: 8px 10px;
        font-size: 11px;
        margin-left: auto;
    }

    main {
        margin-bottom: 80px;
    }
}

/* UTILITIES */
.mono {
    font-family: var(--mono);
}

.uppercase {
    text-transform: uppercase;
}

.small {
    font-size: 11px;
}