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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
}

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

.legend-star {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.legend {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #082634;
    color: #FFFFFF;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

    .legend h3 {
        margin: 0 0 15px 0;
        font-size: 18px;
        color: #EE993F;
        border-bottom: 2px solid #FFF;
        padding-bottom: 8px;
        cursor: pointer;
        user-select: none;
    }

.legend-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #082634;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1001;
    width: 42px;
    height: 42px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: #EE993F;
}

@media (max-width: 768px) {
    .legend {
        display: none;
        top: 70px;
        right: 10px;        
        max-height: 60vh;
        
    }

        .legend.open {
            display: block;
        }

    .legend-toggle {
        display: flex;
    }
}

.group-item {
    margin: 10px 0;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

    .group-item:hover {
        background: #f5f5f5;
    }

.group-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 5px;
}

.color-star {
    font-size: 20px;
    min-width: 20px;
    height: 20px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    line-height: 1;
    letter-spacing: 1px;
}

.color-box {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border-radius: 3px;
    border: 2px solid #333;
}

.group-routes {
    margin-left: 30px;
    font-size: 13px;
    color: #666;
}

.route-marker {
    background: white;
    border: 2px solid;
    border-radius: 40%;
    width: 35px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    cursor: pointer;
}

.controls {
    position: absolute;
    top: 20px;
    left: 60px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
}

    .controls button {
        margin: 5px;
        padding: 8px 15px;
        border: none;
        border-radius: 5px;
        background: #2196F3;
        color: white;
        cursor: pointer;
        font-size: 14px;
    }

        .controls button:hover {
            background: #1976D2;
        }

.leaflet-interactive:focus {
    outline: none;
}

.leaflet-popup-content {
    margin: 10px;
    min-width: 150px;
}

.popup-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.popup-info {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.leaflet-interactive {
    cursor: pointer;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 2000;
    font-size: 18px;
    color: #333;
}

.error-message {
    color: #d32f2f;
    background: #ffebee;
    padding: 15px;
    border-radius: 5px;
    margin: 10px;
}

.route-tooltip {
    background: #082634;
    color: #fff;
    border: 2px solid #EE993F;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    padding: 4px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
