/**
 * Layers Panel Component Styles
 * Draggable floating modal matching original design
 */

[data-component="layers-panel"] {
  position: absolute;
  top: 66px;
  left: 66px;
  width: 260px;
  min-height: 160px;
  max-height: 70vh;
  display: none;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow: hidden;
}

[data-component="layers-panel"] .panel-header {
  font-weight: 700;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: move;
  touch-action: none;
  padding: 12px 14px 8px;
  flex-shrink: 0;
  user-select: none;
}

[data-component="layers-panel"] .panel-header button {
  border: none;
  background: transparent;
  color: #999;
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  display: flex;
}

[data-component="layers-panel"] .panel-header button:hover {
  background: #f1f2f4;
}

.layers-list {
  padding: 6px 14px 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Empty state */
[data-layers="empty"] {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* Layer Item */
.layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 4px;
}

.layer-item:hover {
  border-color: rgba(103, 80, 164, 0.2);
  background: rgba(103, 80, 164, 0.05);
}

.layer-item-active {
  border-color: #6750a4;
  background: rgba(103, 80, 164, 0.1);
}

.layer-item-hidden {
  opacity: 0.5;
}

.layer-item.dragging {
  opacity: 0.5;
}

.layer-item.drag-over-top::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #6750a4;
  border-radius: 3px;
}

.layer-item.drag-over-bottom::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: #6750a4;
  border-radius: 3px;
}

.layer-drag-handle {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.layer-drag-handle:hover {
  color: #6750a4;
  background: rgba(103, 80, 164, 0.08);
}

.layer-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.layer-item-icon .material-symbols-outlined {
  font-size: 18px;
}

.layer-item-content {
  flex: 1;
  min-width: 0;
}

.layer-item-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.layer-item-meta {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.layer-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.layer-action-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: #999;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.layer-action-btn .material-symbols-outlined {
  font-size: 16px;
}

.layer-action-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.layer-action-btn[data-layer-action="delete"]:hover {
  background: #ffebee;
  color: #f44336;
}

/* Scrollbar */
.layers-list::-webkit-scrollbar {
  width: 6px;
}

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

.layers-list::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.layers-list::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

/* Resize Handle */
.panel-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  touch-action: none;
  background: linear-gradient(135deg, transparent 0%, transparent 50%, #ccc 50%, #ccc 100%);
  border-bottom-right-radius: 8px;
}
