@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;700&display=swap');

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Josefin Sans', sans-serif;
}

/* =========================================================
   TOP PANEL = APP CONTAINER
   ========================================================= */

#topPanel {
    width: 100%;
    height: 100vh;
    background: #f5f5f5;
    border-bottom: 1px solid #ccc;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Header */
#topPanelHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px 2px 12px;
/*  background: #e5e5e5; */
    background: #ddd;
    border-bottom: 1px solid #ccc;
    font-size: 16px;
    flex: 0 0 auto;
}

#toggleTopPanel {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

/* Do not display Syöte Trails on narow screens */
@media (max-width: 428px) {
    .no-display-narrow {
        display: none !important;
    }
}

/* =========================================================
   FILTERS
   ========================================================= */

#filters {
    padding: 6px 12px;
    border-bottom: 1px solid #888;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
}

.filter-group {
    margin-bottom: 0;
}

.filter-group span {
    font-weight: bold;
    margin-right: 6px;
}

@media (min-width: 700px) {
    #filters {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }
    .filter-group {
        margin-right: 10px;
    }
}

/* =========================================================
   BODY: TRAIL LIST + MAP
   ========================================================= */

:root {
  --trailListWidth: 146px;
}

.panelBody {
    flex: 1;
    min-height: 0;
    display: flex;
}

/* Trail list */
#trailList {
    height: 100%;
    box-sizing: border-box;
    width: var(--trailListWidth);
    flex: 0 0 var(--trailListWidth);
/*  padding: 0 12px; */
    overflow-y: auto;
    border-right: 1px solid #ccc;
    background: #f5f5f5;
}

/* Trail items */
.trail-item {
    padding: 4px 8px;
    border-bottom: 1px solid #888;
    line-height: 1.2;
    font-size: 14px;
    cursor: pointer;
}

.trail-item:hover {
    background: #eee;
}

.trail-item.active {
    background: #dbeafe;
/*  font-weight: bold; */
}

.trail-item.hovered {
    outline: 1px solid #60a5fa;
}

.trail-item.reset-all {
    text-align: center;
    font-weight: bold;
    background: #eee;
}

/* Map container */
#mapContainer {
    position: relative;
    flex: 1;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
    margin: 0;
}

.mylocation-control .locate-btn {
  width: 40px;
  height: 40px;
  line-height: 40px;
  font-size: 26px;
  font-weight: 900;

  border: none;
  padding: 0;
  display: block;
  text-align: center;
  cursor: pointer;
}

/* =========================================================
   COLLAPSED STATE
   (map remains visible)
   ========================================================= */

#topPanel.collapsed #filters {
    display: none;
}

#topPanel.collapsed #trailList {
    display: none;
}

/* When sidebar is collapsed/hidden, infoPanel should span full width */
#topPanel.collapsed ~ #infoPanel,
#topPanel.collapsed #infoPanel{
    left: 0;
    width: 100%;
}

/* =========================================================
   HOVER TOOLTIP
   ========================================================= */

#trackHoverInfo {
    position: fixed;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    display: none;
}

/* =========================================================
   INFO PANEL (overlays map bottom)
   ========================================================= */

#infoPanel {
    position: absolute;
    bottom: 0;
    left: var(--trailListWidth);
    width: calc(100% - var(--trailListWidth));
    max-height: 20%;
    background: rgba(255,255,255,0.95);
    border-top: 1px solid #ccc;
    overflow-y: auto;
    padding: 10px;
    z-index: 1;
}

#infoPanel.on-top {
    z-index: 999;
}

#elevationChart {
    height: 150px;
}

.nowrap {
    white-space: nowrap;
}

/* =========================================================
   MOBILE: STACK LIST ABOVE MAP
   ========================================================= */

@media (max-width: 400px) {
    .panelBody {
        flex-direction: column;
    }

    #trailList {
        width: 100%;
        flex: 0 0 auto;
        border-right: none;
        border-bottom: 1px solid #ccc;
        max-height: 35vh;
    }
}

