.legend-container {
    position: absolute;
    z-index: 25;
    filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.6));
    animation: floating 3.5s ease-in-out infinite;
}

.legend-container:hover {
    animation-play-state: paused;
}

#sidebar-legend {
    bottom: 3%;
    left: 2%;
    width: 210px;
    max-width: 28vw;
}

.legend-board {
    background-color: #f6ebd8;
    border: 3px solid #d4a373;
    border-radius: 14px;
    padding: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.legend-header {
    background: linear-gradient(180deg, #558b2f 0%, #33691e 100%);
    color: white;
    text-align: center;
    border-radius: 20px;
    padding: 5px 10px;
    font-weight: 800;
    font-size: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    border: 1px solid #1b5e20;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legend-header:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 4px 6px rgba(0, 0, 0, 0.2);
}

.legend-header.small-header {
    font-size: 11px;
    padding: 3px 10px;
    margin-top: 12px;
    margin-bottom: 8px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    cursor: default;
}

.legend-header.small-header:hover {
    filter: none;
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.legend-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 2px;
}

/* Custom Scrollbar for Legend List */
.legend-list::-webkit-scrollbar {
    width: 4px;
}

.legend-list::-webkit-scrollbar-track {
    background: transparent;
}

.legend-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.legend-item:hover,
.legend-item.active {
    background-color: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.l-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.l-icon svg {
    width: 14px;
    height: 14px;
}

.l-text {
    font-weight: 800;
    color: #4e342e;
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* Color definitions for each cluster item icon */
.legend-item[data-filter="alam"] .l-icon {
    background-color: #558b2f;
}

.legend-item[data-filter="budaya"] .l-icon {
    background-color: #6a1b9a;
}

.legend-item[data-filter="sejarah"] .l-icon {
    background-color: #c96b00;
}

.legend-item[data-filter="religi"] .l-icon {
    background-color: #0288d1;
}

.legend-item[data-filter="buatan"] .l-icon {
    background-color: #d81b60;
}

.legend-item[data-filter="transportasi"] .l-icon {
    background-color: #00838f;
}

.legend-item[data-filter="kuliner"] .l-icon {
    background-color: #e65100;
}

.legend-item[data-filter="souvenir"] .l-icon {
    background-color: #7b1fa2;
}

.legend-item[data-filter="edukasi"] .l-icon {
    background-color: #00796b;
}

.legend-item[data-filter="penginapan"] .l-icon {
    background-color: #5d4037;
}

/* Keterangan Box Styling */
.legend-keterangan {
    min-height: 125px;
    display: flex;
    flex-direction: column;
}

#ket-default {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4px 8px;
}

.ket-default-title {
    font-size: 10px;
    color: #4e342e;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
}

.ket-default-highlight {
    color: #2e7d32;
    font-weight: 800;
    font-size: 11px;
}

.ket-default-sub {
    font-size: 9px;
    color: #666;
    line-height: 1.3;
    margin: 6px 0 0 0;
    font-weight: 500;
}

#ket-dynamic {
    display: none;
    padding: 0 8px 4px 8px;
    text-align: center;
}

#ket-desc {
    font-size: 10px;
    color: #4e342e;
    line-height: 1.3;
    margin: 0 0 8px 0;
    font-weight: 500;
}

#ket-recommendation {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    padding: 6px;
    font-size: 9px;
    color: #333;
    font-weight: 700;
    border: 1px dashed #d4a373;
}
