/* Tools Panel Styles */
.tools-panel,
.view-panel,
.layers-panel {
    background: #eee;
    padding: 5px; /* Reduced padding */
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px; /* Reduced gap */
}

/* Tool Buttons */
.toggle-button {
    width: 32px; /* Adjusted width */
    height: 32px; /* Adjusted height */
    padding: 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.toggle-button:hover {
    background-color: #e0e0e0;
}

.toggle-button.active {
    background-color: #007bff;
    color: white;
}

.toggle-button.active .tool-icon {
    color: white;
}

#place-node.active {
    background-color: #4CAF50;
    color: white;
}

/* Tool button icons */
.tool-icon {
    flex-shrink: 0;
}

.tool-button {
    width: 32px;
    height: 32px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tool-button .tool-icon {
    width: 20px;
    height: 20px;
}

.tool-button:hover::after {
    content: attr(title);
    position: absolute;
    left: 110%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Select tool specific styles */
.select-tool-container {
    position: relative;
}

#select-tool {
    justify-content: space-between;
}

.dropdown-arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.select-tool-container.active .dropdown-arrow {
    transform: rotate(-180deg);
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
}

.select-tool-container.active .select-options {
    display: block;
}

.select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px;
    border: none;
    background: none;
    text-align: left;
    transition: background-color 0.2s;
}

.select-option:hover {
    background-color: #f0f0f0;
}

.select-option.selected {
    background-color: #f0f0f0;
}

.select-option.selected::after {
    content: '✓';
    margin-left: auto;
    color: #4CAF50;
}

.select-tool-container .select-options button {
    width: 32px;
    height: 32px;
    padding: 4px;
}

/* Zoom Controls - Fixed positioning */
.zoom-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px; /* Increased gap for better spacing with new icons */
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px;
    border-radius: 4px;
    color: white;
}

#zoom-slider {
    width: 100px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent; /* Important: start with transparent background */
    margin: 0;
    padding: 0;
}

/* Chrome/Safari specific styles */
#zoom-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #555;
    border-radius: 2px;
    border: none;
}

#zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: white;
    margin-top: -4px; /* (thumb height - track height) / 2 */
    cursor: pointer;
    border: none;
}

/* Firefox specific styles */
#zoom-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    background: #555;
    border-radius: 2px;
    border: none;
}

#zoom-slider::-moz-range-thumb {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
}

#zoom-slider::-moz-range-progress {
    height: 4px;
    background: #007bff;
    border-radius: 2px;
}

/* Remove focus styles */
#zoom-slider:focus {
    outline: none;
}

#zoom-slider:focus::-webkit-slider-runnable-track {
    background: #555;
}

/* Remove any conflicting styles from styles.css */
.zoom-control #zoom-slider {
    width: 100px !important;
}

.zoom-icon {
    user-select: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    opacity: 0.8;
}

.zoom-icon:hover {
    transform: scale(1.1);
    opacity: 1;
}

.zoom-icon:active {
    transform: scale(0.95);
}

.radius-control {
    margin-top: 10px;
    display: flex;
    align-items: center;
}

.radius-control label { margin-right: 5px; }

#node-radius {
    width: 40px;
    text-align: center;
}

#node-radius:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Cursor styles for select tools */
.cursor-lasso {
    cursor: crosshair;
}

.cursor-polygon {
    cursor: crosshair;
}

.cursor-magic-wand {
    cursor: cell;
}

/* Active state for select tool */
#select-tool.active {
    background-color: #007bff;
    color: white;
}

#select-tool.active .tool-icon {
    color: white;
}
