* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
}

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

.overlay-container {
    position: absolute;
    top: 20px;
    left: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform: translateX(-100%); /* Start hidden */
    transition: transform 0.3s ease;
    padding-left: 30px;
    padding-right: 15px;
    max-width: 300px; /* Prevent oversized container */
}

/* When expanded class is present, show the container */
.overlay-container.expanded {
    transform: translateX(0) !important; /* Use !important to override any other styles */
}

.toggle-button {
    position: absolute;
    top: 10px;
    right: -30px;
    z-index: 11;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    padding: 0;
}

.toggle-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.arrow-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.overlay-container.expanded .arrow-icon {
    transform: rotate(180deg);
}

.logo {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    opacity: 0.8;
}

.controls {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.control-panel, .stats-panel {
    padding: 15px;
}

.label-row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-bottom: 0px;
    margin-top: 0px;
    align-items: center;
}

.label-row .control-item {
    margin-bottom: 0px;
    margin-top: 0px;
    padding: 0px 2px 0px 0px;
}

.control-panel {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.control-panel h3, .stats-panel h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
    min-height: 28px;
}

.control-item label {
    font-size: 14px;
    color: #555;
}

.stat-item {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.glider-info-panel {
    position: absolute;
    top: 28px;
    right: 28px;
    background: #fff;
    border-radius: 12px;
    padding: 18px 16px 12px 16px;
    width: 200px;
    max-width: 96vw;
    box-shadow: 0 4px 18px rgba(0,0,0,0.13);
    backdrop-filter: blur(6px);
    z-index: 20;
    transition: transform 0.22s cubic-bezier(.4,0,.2,1), opacity 0.22s cubic-bezier(.4,0,.2,1);
    border: 1px solid #e6e8ee;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.glider-info-panel.hidden {
    transform: translateX(300px);
    opacity: 0;
    pointer-events: none;
}

.glider-info-panel h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #232b39;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom: 1px solid #ececf0;
    padding-bottom: 6px;
    text-align: left;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0;
}
.info-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 22px;
    font-size: 13px;
    padding: 0 0 0 0;
    margin: 0;
    border: none;
}
.info-row span:first-child {
    font-weight: 500;
    color: #5b6472;
    font-size: 13px;
    text-align: left;
    padding: 0 0 0 2px;
    letter-spacing: 0.01em;
    flex: 1 1 40%;
}
.info-row .value-unit {
    display: inline-flex;
    align-items: baseline;
    gap: 0.25em;
    justify-content: flex-end;
    flex: 1 1 60%;
}
.info-row span.value {
    font-family: inherit;
    color: #232b39;
    font-size: 13px;
    font-weight: 400;
    text-align: right;
    padding-right: 0;
}
.info-row span.unit {
    color: #a0a7b7;
    font-size: 12px;
    font-weight: 400;
    margin-left: 0.15em;
    text-align: left;
    min-width: 1.5em;
    letter-spacing: 0.01em;
}
.info-row span.unit:empty {
    display: none;
}


.close-btn {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 22px;
    cursor: pointer;
    color: #a0a0b2;
    background: #f7f8fa;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ececf0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.close-btn:hover {
    color: #fff;
    background: #4264fb;
    border-color: #4264fb;
}

/* Custom Mapbox styles */
.mapboxgl-ctrl-logo {
    opacity: 0.5;
}

.mapboxgl-ctrl-attrib {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.7) !important;
}

/* Glider marker style */
.glider-marker {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.glider-marker:hover {
    transform: scale(1.2);
    transition: transform 0.2s ease;
}

.glider-label {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    line-height: 1.1;
    display: inline-block;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: always;
}
.label-line1, .label-line2 {
    margin: 0;
    padding: 0;
    line-height: normal;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: always;
}
.label-line2 {
    color: #e0e0e0;
    margin-top: 0px;
}

/* Animation for glider movement */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.glider-marker.new {
    animation: pulse 1s ease;
}

/* Trail styles */
#trail-length-value {
    font-size: 12px;
    color: #555;
    text-align: center;
    width: 100%;
}

/* Mapbox-style toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 16px;
    margin-right: 4px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: background 0.3s;
    border-radius: 16px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: transform 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.switch input:checked + .slider {
    background-color: #4264fb;
}
.switch input:checked + .slider:before {
    transform: translateX(16px);
}
.switch-label {
    font-size: 13px;
    color: #555;
    margin-left: 2px;
    user-select: none;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
}

@media (max-width: 600px) {
  .controls {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  .control-panel, .stats-panel {
    padding: 7px 8px;
  }
  .control-panel h3, .stats-panel h3 {
    margin-bottom: 4px;
    font-size: 14px;
  }
  .control-item {
    gap: 3px;
    margin-bottom: 1px;
    min-height: 20px;
  }
  .control-item label {
    font-size: 13px;
  }
  .label-row {
    gap: 2px;
  }
}

/* Slider styling */
input[type="range"] {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #ddd;
    outline: none;
    border-radius: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

img.on-ground {
    filter: grayscale(100%) opacity(0.6);
    transition: filter 0.2s ease;
}
