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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    margin: 0;
    padding: 0;
}

#map {
    height: 100vh;
    width: 100%;
}

/* Leaflet popup styling */
.leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.leaflet-popup-content strong {
    color: #2c5f2d;
    font-size: 1.1em;
}

.leaflet-popup-close-button {
    font-size: 20px;
    padding: 4px 8px 0 0;
}

/* Race popup styling */
.race-popup {
    padding: 15px;
}

.race-popup h3 {
    margin: 0 0 10px 0;
    color: #2c5f2d;
    font-size: 1.2em;
    border-bottom: 2px solid #2c5f2d;
    padding-bottom: 8px;
}

.race-popup .race-description {
    margin: 10px 0;
    color: #555;
    line-height: 1.4;
}

.race-popup .race-details {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
}

.race-popup .race-details div {
    margin: 5px 0;
    color: #333;
}

.race-popup .race-details strong {
    color: #2c5f2d;
    font-size: 1em;
}

.race-popup .race-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #2c5f2d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: background 0.2s;
}

.race-popup .race-link:hover {
    background: #234a24;
}

/* Layer control styling */
.layer-control-container {
    position: relative;
}

.layer-control-btn {
    background: white;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    transition: all 0.2s;
}

.layer-control-btn:hover {
    background: #f0f0f0;
}

.layer-control-btn.active {
    background: #e8e8e8;
}

.layer-dropdown {
    position: absolute;
    top: 0;
    right: 40px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
}

.layer-dropdown-header {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.layer-checkbox-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 8px;
    font-size: 14px;
    user-select: none;
}

.layer-checkbox-item:hover {
    background: #f5f5f5;
}

.layer-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.layer-checkbox-item .layer-icon {
    font-size: 16px;
}

.layer-checkbox-item span:not(.layer-icon) {
    flex: 1;
}

.layer-section {
    border-bottom: 1px solid #e0e0e0;
}

.layer-section-title {
    padding: 8px 15px 4px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layer-checkbox-subitem {
    padding-left: 20px;
    font-size: 13px;
}

/* Category folder styling */
.layer-category {
    border-bottom: 1px solid #f0f0f0;
}

.layer-category:last-child {
    border-bottom: none;
}

.layer-category-header {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    user-select: none;
    transition: background 0.2s;
    gap: 6px;
}

.layer-category-header input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.layer-category-header:hover {
    background: #f5f5f5;
}

.layer-category-arrow {
    font-size: 9px;
    color: #888;
    transition: transform 0.2s;
    display: inline-block;
}

.layer-category-arrow.open {
    transform: rotate(90deg);
}

.layer-category-name {
    flex: 1;
}

.layer-category-count {
    background: #e8e8e8;
    color: #666;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 10px;
}

.layer-category-items {
    border-top: 1px solid #f0f0f0;
}

.layer-category-race {
    padding-left: 30px;
}

@media (max-width: 768px) {
    #header h1 {
        font-size: 1.5em;
    }

    #header p {
        font-size: 0.9em;
    }
}
