/* panels.css */
.left-panel {
    width: 64px;
    background: #ddd;
    padding: 10px;
    box-sizing: border-box;
    display: none; /* Ensure panel is hidden by default */
    flex-direction: column;
    gap: 20px;
    overflow: visible; /* Allow overflow */
}

.left-panel.expanded {
    width: 200px;
    overflow: visible; /* Allow overflow */
}

.left-panel .panel-resize-handle {
    display: none;
    right: -6px;
}

.left-panel.expanded .panel-resize-handle {
    display: none; /* Hide resize handles */
}

.left-panel .tool-button {
    position: relative;
}

.left-panel .tool-button:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%; /* Position the message to the right of the button */
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 1000;
    margin-left: 10px; /* Add some space between the button and the message */
}

.right-panel {
    width: 220px;
    background: #ddd;
    padding: 10px;
    box-sizing: border-box;
    display: none; /* Hide right panel by default */
    flex-direction: column;
    gap: 20px;
    border-left: 1px solid #ccc;
}

.right-panel-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.panel-section {
    position: relative;
    background: #eee;
    padding: 10px;
    border-radius: 4px;
    z-index: 1000;
}

.right-panel .radius-control,
.right-panel .layers-panel {
    margin-top: 20px;
}

.panel-resize-handle {
    display: none; /* Hide resize handles */
}

.panel-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 16px;
    background: white;
    box-shadow: -3px 0 0 white, 3px 0 0 white;
}

.right-panel .panel-resize-handle {
    display: none; /* Hide resize handles */
}

.panel-resize-handle:hover,
.resizing .panel-resize-handle {
    opacity: 0.8;
}

.resizing {
    user-select: none;
}

/* Add expand/collapse toggle button */
.panel-toggle {
    display: none; /* Remove expand/collapse toggle button styles */
}

.panel-toggle:hover {
    opacity: 0.8;
}

.panel-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid white;
}

.left-panel.expanded .panel-toggle::before {
    transform: translate(-50%, -50%);
}

/* Canvas container adjustments */
#canvas-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #f0f0f0;
}

/* Main layout */
main {
    display: flex;
    height: calc(100vh - 50px);
    position: relative;
    overflow: hidden;
}

.layers-panel {
    position: relative;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.layers-panel h3 {
    margin-bottom: 10px;
    font-size: 14px;
}

.layers-controls {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.layers-controls button {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    border-radius: 3px;
}

.layers-controls button:hover {
    background: var(--bg-hover);
}

.layers-list {
    max-height: 200px;
    overflow-y: auto;
    padding-bottom: 40px; /* Add padding to create space for toolbar */
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 8px;
    cursor: pointer;
    border-radius: 3px;
    background: var(--bg-secondary);
    margin-bottom: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s;
}

.layer-item:hover {
    background: var(--bg-hover);
    background-color: rgba(0, 120, 215, 0.05);
}

.layer-item.selected {
    background: var(--bg-selected);
    background-color: rgba(0, 120, 215, 0.1);
    border: 1px solid rgba(0, 120, 215, 0.4);
}

.layer-item input[type="checkbox"] {
    margin: 0;
}

.layer-item input[type="range"] {
    width: 60px;
    margin-left: auto;
}

.layer-preview-container {
    width: 50px;
    height: 50px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
}

.layer-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.layer-name {
    flex: 1;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

}

.layer-visibility {
    width: 24px;
    height: 24px;
    padding: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.layer-visibility:hover {
    background: var(--bg-hover);
}

.layer-visibility svg {
    width: 16px;
    height: 16px;
}

.layers-toolbar {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    padding: 8px; /* Add padding around toolbar */
    border-top: 1px solid var(--border-color); /* Optional: adds visual separation */
    background: #ddd; /* Match panel background to ensure clean look */
    width: calc(100% - 16px); /* Full width minus padding */
    justify-content: flex-end; /* Keep buttons right-aligned */
}

.layers-toolbar button {
    width: 24px;
    height: 24px;
    padding: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layers-toolbar button:hover {
    background: var(--bg-hover);
}

.layers-toolbar svg {
    width: 16px;
    height: 16px;
}

/* Tool panels base styles */
.tools-panel, .view-panel, .layers-panel {
    background: #eee;
    padding: 10px;
    border-radius: 4px;
}