/* Layers Panel Styles */
.layers-panel {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 8px;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #ffffff;
    user-select: none;
    display: flex;
    flex-direction: column;
}

.layers-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3a3a;
    margin-bottom: 8px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.checkbox-container:hover {
    background-color: #4a4a4a;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-container .custom-checkbox {
    height: 16px;
    width: 16px;
    background-color: #2a2a2a;
    border: 1px solid #666;
    border-radius: 3px;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.checkbox-container input:checked ~ .custom-checkbox {
    background-color: #3a76d6;
    border-color: #3a76d6;
}

.checkbox-container .custom-checkbox::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .custom-checkbox::after {
    display: block;
}

.checkbox-container input:indeterminate ~ .custom-checkbox {
    background-color: #3a76d6;
    border-color: #3a76d6;
}

.checkbox-container input:indeterminate ~ .custom-checkbox::after {
    display: block;
    content: "";
    position: absolute;
    top: 7px;
    left: 3px;
    width: 8px;
    height: 2px;
    background-color: white;
    border: none;
    transform: none;
    box-shadow: none;
}

.checkbox-container:hover {
    background-color: #4a4a4a;
}

.layers-panel-title {
    font-weight: bold;
    color: #ffffff;
}

.layers-panel-controls {
    display: flex;
    gap: 4px;
}

.layers-btn {
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.layers-btn:hover {
    background: #4a4a4a;
}

.layers-btn:active {
    background: #5a5a5a;
}

.layers-btn:disabled {
    background: #2a2a2a;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.5;
}

.layers-btn:disabled:hover {
    background: #2a2a2a;
}

.layers-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.layer-row {
    display: flex;
    align-items: center;
    padding: 6px 4px;
    margin-bottom: 2px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    position: relative;
    gap: 6px;
}

.layer-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.layer-row.selected {
    background: #2d5aa0 !important;
    box-shadow: inset 0 0 0 1px #4a7bc8;
}

.layer-row.dragging {
    opacity: 0.6;
}

.layer-thumbnail {
    width: 48px;
    height: 48px;
    border: 1px solid #4a4a4a;
    border-radius: 2px;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.layer-thumbnail canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.layer-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, #555 25%, transparent 25%), 
        linear-gradient(-45deg, #555 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #555 75%), 
        linear-gradient(-45deg, transparent 75%, #555 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    z-index: 1;
}

.layer-thumbnail canvas {
    position: relative;
    z-index: 2;
}

.layer-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 4px;
    border-radius: 2px;
    color: #ffffff;
}

.layer-name.editing {
    background: #4a4a4a;
    border: 1px solid #6a6a6a;
    outline: none;
    color: #ffffff;
}

.layer-name input {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 12px;
    width: 100%;
    outline: none;
}

.drag-insertion-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #4a7bc8;
    border-radius: 1px;
    z-index: 1000;
    box-shadow: 0 0 4px rgba(74, 123, 200, 0.6);
}

.layers-container::-webkit-scrollbar {
    width: 6px;
}

.layers-container::-webkit-scrollbar-track {
    background: #2a2a2a;
}

.layers-container::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 3px;
}

.layers-container::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.layer-visibility-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    font-size: 14px;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.layer-visibility-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Icon container styles */
.layers-panel .icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.layers-panel .icon-container img {
    filter: brightness(0) invert(1);
}

.layers-panel .icon-container.visibility-hidden {
    opacity: 0.5;
}

.layers-panel .icon-container.visibility-hidden img {
    filter: brightness(0) invert(1);
    opacity: 0.3;
}

.layers-panel .icon-container.fallback-text {
    font-size: 10px;
    color: #888888;
}
