/* Floating Tools - Legend and Location */

/* Container for floating buttons */
.floating-tools {
    position: fixed;
    bottom: 20px;
    left: 300px; /* Position after sidebar */
    display: flex;
    gap: 10px;
    z-index: 1500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-tools.sidebar-collapsed {
    left: 68px; /* Adjust when sidebar is collapsed */
}

/* Floating button style */
.floating-btn {
    width: 48px;
    height: 48px;
    background: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.2s;
    position: relative;
}

.floating-btn:hover {
    background: #232937;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.floating-btn.active {
    background: #2563eb;
    border-color: #3b82f6;
}

.floating-btn i {
    color: #e1e7ef;
    font-size: 18px;
}

.floating-btn.active i {
    color: white;
}

/* Tooltip */
.floating-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1f2e;
    color: #e1e7ef;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.floating-btn:hover::before {
    opacity: 1;
}

/* Legend Panel */
.legend-panel {
    position: fixed;
    bottom: 80px;
    left: 300px;
    width: 250px;
    background: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: 8px;
    padding: 16px;
    display: none;
    z-index: 1400;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend-panel.sidebar-collapsed {
    left: 68px;
}

.legend-panel.active {
    display: block;
}

.legend-panel h4 {
    margin: 0 0 12px 0;
    color: #e1e7ef;
    font-size: 14px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid #2d3548;
}

.legend-section {
    margin-bottom: 16px;
}

.legend-section:last-child {
    margin-bottom: 0;
}

.legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.legend-item span {
    color: #e1e7ef;
    font-size: 11px;
}

/* Location Tools Panel */
.location-panel {
    position: fixed;
    bottom: 80px;
    left: 358px;
    width: 200px;
    background: #1a1f2e;
    border: 1px solid #2d3548;
    border-radius: 8px;
    padding: 12px;
    display: none;
    z-index: 1400;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-panel.sidebar-collapsed {
    left: 126px;
}

.location-panel.active {
    display: block;
}

.location-btn {
    width: 100%;
    padding: 8px;
    background: #232937;
    border: 1px solid #2d3548;
    border-radius: 4px;
    color: #e1e7ef;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-btn:hover {
    background: #2d3548;
    border-color: #3b82f6;
}

.location-btn:last-child {
    margin-bottom: 0;
}

.location-btn i {
    width: 16px;
    text-align: center;
}

/* Coordinates Display */
.coordinates-display {
    margin-top: 8px;
    padding: 6px;
    background: #0f1419;
    border-radius: 4px;
    font-size: 10px;
    color: #64748b;
    text-align: center;
    font-family: monospace;
}

/* Close button for panels */
.panel-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.panel-close:hover {
    color: #e1e7ef;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .floating-tools {
        bottom: 10px;
        left: 10px;
    }
    
    .legend-panel,
    .location-panel {
        left: 10px;
        right: 10px;
        width: auto;
    }
}