/* ============================================================
   FireWeb — Layers & Pages Panel Styles
   ============================================================ */

/* ---- Layers Panel ---- */
.layers-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.layers-list::-webkit-scrollbar {
    width: 5px;
}

.layers-list::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.layer-item {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-dark);
}

.layer-row {
    display: flex;
    align-items: center;
    height: 26px;
    padding: 0 var(--space-xs);
    gap: var(--space-xxs);
    cursor: pointer;
    transition: background var(--transition-fast);
    background: var(--bg-panel);
}

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

.layer-row.selected {
    background: var(--bg-selected);
    color: var(--text-bright);
}

.layer-expand {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
}

.layer-expand.expanded {
    transform: rotate(90deg);
}

.layer-expand svg {
    width: 8px;
    height: 8px;
}

.layer-visibility {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    transition: color var(--transition-fast);
}

.layer-visibility:hover {
    color: var(--text-primary);
}

.layer-visibility.hidden-layer {
    color: var(--text-muted);
    opacity: 0.4;
}

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

.layer-lock {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    opacity: 0.3;
    transition: all var(--transition-fast);
}

.layer-lock:hover {
    opacity: 0.8;
}

.layer-lock.locked {
    opacity: 1;
    color: var(--accent-warning);
}

.layer-lock svg {
    width: 12px;
    height: 12px;
}

.layer-name {
    flex: 1;
    font-size: var(--font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    padding: 0 var(--space-xxs);
}

.layer-name.editing {
    background: var(--bg-input);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    padding: 1px var(--space-xxs);
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
}

.layer-thumbnail {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    flex-shrink: 0;
    overflow: hidden;
}

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

/* Object sub-items within a layer */
.layer-objects {
    padding-left: var(--space-xl);
}

.object-row {
    display: flex;
    align-items: center;
    height: 22px;
    padding: 0 var(--space-xs);
    gap: var(--space-xxs);
    cursor: grab;
    transition: background var(--transition-fast);
    font-size: var(--font-size-xs);
}

.object-row:hover {
    background: var(--bg-hover);
}

.object-row.selected {
    background: var(--bg-selected);
    color: var(--text-bright);
}

.object-row.dragging {
    opacity: 0.4;
}

.object-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.object-icon svg {
    width: 100%;
    height: 100%;
}

.object-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.object-vis-btn,
.object-lock-btn {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0;
    opacity: 0.4;
    transition: all var(--transition-fast);
}

.object-vis-btn:hover,
.object-lock-btn:hover {
    opacity: 0.8;
    color: var(--text-primary);
}

.object-vis-btn.hidden-obj {
    opacity: 0.3;
}

.object-lock-btn.locked-obj {
    opacity: 1;
    color: var(--accent-warning);
}

.object-vis-btn svg,
.object-lock-btn svg {
    width: 10px;
    height: 10px;
}

/* Active layer highlight */
.layer-row.active-layer {
    background: var(--bg-medium);
}

.layer-row.active-layer .layer-name {
    color: var(--text-accent);
}

/* ---- Layers Panel Footer ---- */
.layers-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs);
    border-top: 1px solid var(--border-dark);
    background: var(--bg-panel);
}

.layers-footer button {
    width: 22px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    padding: 0;
}

.layers-footer button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.layers-footer button svg {
    width: 14px;
    height: 14px;
}

/* ---- Pages Panel ---- */
.pages-list {
    flex: 1;
    overflow-y: auto;
}

.page-item {
    display: flex;
    align-items: center;
    height: 24px;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: background var(--transition-fast);
}

.page-item:hover {
    background: var(--bg-hover);
}

.page-item.active {
    background: var(--bg-selected);
    color: var(--text-bright);
}

.page-item .page-icon svg {
    width: 12px;
    height: 12px;
}

/* ---- Drag & Drop ---- */
.layer-row.drag-over-above {
    border-top: 2px solid var(--accent-primary);
}

.layer-row.drag-over-below {
    border-bottom: 2px solid var(--accent-primary);
}

.object-row.drag-over-above {
    border-top: 2px solid var(--accent-primary);
}

.object-row.drag-over-below {
    border-bottom: 2px solid var(--accent-primary);
}
