


html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.maplibregl-popup-content {
    color: black;
}

#map-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    border: none;
}

#stop-name-selected{
    margin: 0 0 8px 0;
    padding: 10px 0px;
}

#controls {
    border: 5px rgb(185, 86, 86) solid;
    width: 100vw;
    height: 40vh;
    background-color: rgb(54, 20, 20);
    border-radius: 16px 16px 50px 50px;
    margin-top: -24px; /* Pulls controls up so they overlap the map */
    z-index: 10;       /* Keeps controls above the map canvas */
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 14px 18px;
    color: white;
    font-family: sans-serif;
}

#controls header {
    display: flex;
    align-items: center;
    gap: 10px;
}

#controls header h1 {
    margin: 0;
    font-size: 1.1rem;
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.maplibregl-ctrl-icon{
    color: white !important;
    /* background-image: none !important; */
}
.maplibregl-ctrl-geolocate{
    border: rgb(146, 71, 71) 2px solid !important;
    background-color:rgb(247, 113, 113) !important;
}

.header-action-btn {
    min-width: 68px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.header-action-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-location-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.22);
}


.departures-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.departure-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s, transform 0.1s;
}

.departure-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.departure-item.realtime {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(74, 222, 128, 0.5);
}

.departure-item.realtime:hover {
    background: rgba(34, 197, 94, 0.3);
}

.departure-route {
    background-color: #4b0909;
    padding: 3px 5px;
    border: rgb(192, 100, 100) solid 3px;
    border-radius: 7px;
    font-weight: bold;
    font-size: 1.1em;
    color: #ff9d9d;
}

.departure-headsign {
    font-size: 0.9em;
    color: #ddd;
    margin-left: 5px;
    text-align: left;
}

.departure-time {
    font-size: 0.95em;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 6px;
    border-radius: 4px;
}

/* Bus custom pin marker */
.bus-marker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
    user-select: none;
}

.bus-marker-box {
    background: #ffffff;
    border: 3px solid rgb(185, 86, 86);
    border-radius: 8px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.bus-marker-label {
    font-size: 14px;
    font-weight: bold;
    color: rgb(185, 86, 86);
}

.bus-marker-container.selected {
    filter: drop-shadow(0 0 7px rgba(220, 38, 38, 0.55)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.12));
}

.bus-marker-container.selected .bus-marker-box {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35), 0 0 10px rgba(220, 38, 38, 0.28);
}

.bus-marker-container.selected .bus-marker-label {
    text-shadow: 0 0 6px rgba(220, 38, 38, 0.55);
}

.bus-marker-pin {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid rgb(185, 86, 86);
    margin-top: -1px;
}

/* Bus popup styling */
.bus-popup-content {
    font-family: sans-serif;
    color: #333;
    padding: 2px;
    max-width: 240px;
}

.bus-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.bus-popup-title {
    font-weight: bold;
    font-size: 1.1em;
    color: rgb(185, 86, 86);
}

.bus-popup-toggle-btn {
    background: none;
    border: 1px solid rgb(185, 86, 86);
    color: rgb(185, 86, 86);
    border-radius: 4px;
    font-size: 0.75em;
    padding: 2px 6px;
    cursor: pointer;
}

.bus-popup-toggle-btn:hover {
    background: rgba(185, 86, 86, 0.1);
}

.bus-popup-details {
    font-size: 0.85em;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bus-popup-details.hidden {
    display: none;
}

.bus-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.bus-popup-label {
    color: #777;
}

.bus-popup-val {
    font-weight: 500;
    color: #222;
    text-align: right;
    word-break: break-word;
}

/* Bus details panel in #controls */
.bus-details-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
}

.bus-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
}

.bus-details-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff9d9d;
}

.bus-back-btn {
    background: rgba(185, 86, 86, 0.3);
    border: 1px solid rgb(185, 86, 86);
    color: white;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.15s;
}

.bus-back-btn:hover {
    background: rgba(185, 86, 86, 0.6);
}

.bus-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px 16px;
    font-size: 0.9em;
}

.bus-detail-item {
    display: flex;
    flex-direction: column;
}

.bus-detail-key {
    font-size: 0.8em;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bus-detail-val {
    font-size: 1em;
    font-weight: 600;
    color: #ffffff;
    margin-top: 2px;
}




/* ── Header ─────────────────────────────────────────────────── */
header {
  height: var(--header-h);

  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 100%);
  color: #fff;
  position: relative;
  z-index: 200;
}

header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ── Dark Mode Toggle Button ─────────────────────────────────── */
.dark-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
  margin-right: 6px;
}
.dark-mode-btn svg { width: 20px; height: 20px; }
.dark-mode-btn:hover { background: rgba(255,255,255,0.3); }
