/* ── Right Panel ─────────────────────────────── */
.panel-section {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

.panel-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.panel-section:last-child::after {
  display: none;
}

.panel-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--panel-text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 12px;
  background: var(--color-brand);
  border-radius: 2px;
}

/* ── Layers Panel ────────────────────────────── */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 200ms;
  font-size: 13px;
  color: var(--panel-text);
  border: 1px solid transparent;
}

.layer-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
}

.layer-item.active {
  background: rgba(242,0,0,0.1);
  border-color: rgba(242,0,0,0.25);
  color: #fff;
}

.layer-item .layer-preview {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.layer-item .layer-preview canvas {
  max-width: 100%;
  max-height: 100%;
}

.layer-item .layer-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.layer-item .layer-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 200ms;
}

.layer-item:hover .layer-actions {
  opacity: 1;
}

.layer-item .layer-actions button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--panel-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms;
}

.layer-item .layer-actions button:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.layer-item .layer-actions button svg {
  width: 14px;
  height: 14px;
}

/* ── Collapsible Sections ───────────────────── */
.collapsible-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  transition: color 200ms;
}

.collapsible-header:hover {
  color: #fff;
}

.collapse-arrow {
  font-size: 10px;
  transition: transform 200ms;
  display: inline-block;
  width: 14px;
  color: var(--panel-text-muted);
}

.collapsible-section.collapsed .collapsible-body {
  display: none;
}

.section-icon {
  font-size: 11px;
  color: var(--color-brand);
  margin-right: 2px;
}

/* ── Properties Panel ────────────────────────── */
.property-group {
  margin-bottom: 18px;
}

.property-group:last-child { margin-bottom: 0; }

.property-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--panel-text-muted);
  margin-bottom: 8px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.property-input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  background: rgba(255,255,255,0.05);
  color: var(--panel-text);
  transition: all 200ms;
}

.property-input:hover {
  border-color: rgba(255,255,255,0.18);
}

.property-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(242,0,0,0.12);
  background: rgba(255,255,255,0.08);
}

.property-input-sm {
  width: 64px;
  flex: none;
}

.property-slider {
  width: 100%;
  accent-color: var(--color-brand);
  height: 4px;
  cursor: pointer;
}

.property-color {
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: all 200ms;
}

.property-color:hover {
  border-color: var(--color-brand);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Font Picker ─────────────────────────────── */
.font-picker-dropdown {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.font-picker-dropdown::-webkit-scrollbar {
  width: 5px;
}

.font-picker-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.font-picker-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
}

.font-picker-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background 200ms;
  color: var(--panel-text);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.font-picker-item:last-child {
  border-bottom: none;
}

.font-picker-item:hover {
  background: rgba(255,255,255,0.06);
}

.font-picker-item.active {
  background: var(--color-brand);
  color: #fff;
}

/* ── Color Swatches ──────────────────────────── */
.color-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 6px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 200ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.color-swatch:hover {
  transform: scale(1.2);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 1;
  position: relative;
}

.color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 4px #fff;
  transform: scale(1.1);
}

/* ── Gradient Swatches ────────────────────────── */
.gradient-swatches,
.gradient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
}

.gradient-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 200ms;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.gradient-swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 1;
  position: relative;
}

.gradient-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 4px #fff;
  transform: scale(1.1);
}

/* ── Alignment buttons ──────────────────────── */
.align-buttons {
  display: flex;
  gap: 6px;
}

.align-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--panel-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms;
}

.align-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
  background: rgba(242,0,0,0.08);
}

.align-btn svg {
  width: 16px;
  height: 16px;
}

/* ── No Selection State ────────────────────── */
.panel-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--panel-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel-empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}
