/* ==========================================================================
   panel.css — Right Panel Styles (Layers, Properties, Page Tabs)
   Business Card Generator
   ========================================================================== */

/* ---------- Page Tabs ---------- */

.page-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.page-tabs__tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-sm);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.page-tabs__tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.page-tabs__tab--active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.page-tabs__tab--active:hover {
  color: var(--accent-cyan);
}

/* ---------- Layer List ---------- */

.layer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-left: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
  min-height: 32px;
}

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

.layer-item--selected {
  background: rgba(0, 240, 255, 0.06);
  border-left-color: var(--accent-cyan);
}

.layer-item--selected:hover {
  background: rgba(0, 240, 255, 0.1);
}

/* Drag handle (grip dots) */
.layer-item__drag {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: grab;
  font-size: 10px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

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

.layer-item__drag:active {
  cursor: grabbing;
}

/* Visibility eye icon */
.layer-item__visibility {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.layer-item__visibility:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

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

/* Lock icon */
.layer-item__lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.layer-item__lock:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.layer-item__lock--locked {
  color: var(--accent-yellow);
  opacity: 0.8;
}

/* Layer type icon */
.layer-item__type-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

/* Layer name (editable) */
.layer-item__name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.layer-item__name:focus {
  cursor: text;
  background: var(--bg-deep);
  border-color: var(--border-focus);
  outline: none;
}

/* Layer thumbnail (small preview) */
.layer-item__thumbnail {
  width: 24px;
  height: 16px;
  flex-shrink: 0;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.layer-item__thumbnail svg {
  width: 100%;
  height: 100%;
}

/* ---------- Property Inspector ---------- */

.property-inspector {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-xs) var(--space-sm);
  align-items: center;
}

.property-inspector__label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: right;
  user-select: none;
}

.property-inspector__row {
  display: contents;
}

/* Two-column value row (e.g., X / Y, W / H) */
.property-inspector__pair {
  display: flex;
  gap: var(--space-xs);
}

.property-inspector__pair > input {
  flex: 1;
  min-width: 0;
}

/* ---------- Form Inputs ---------- */

.input {
  height: 26px;
  padding: 0 var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--font-size-sm);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.input:hover {
  border-color: var(--text-muted);
}

.input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--glow-cyan);
  outline: none;
}

.input::placeholder {
  color: var(--text-muted);
}

/* Number input — narrower */
.input--number {
  width: 64px;
  text-align: center;
  -moz-appearance: textfield;
}

.input--number::-webkit-inner-spin-button,
.input--number::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Color swatch input */
.input--color {
  width: 26px;
  height: 26px;
  padding: 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.input--color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.input--color::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

/* Select dropdown */
.input--select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238888aa'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
}

/* ---------- Range Slider ---------- */

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent-cyan);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--accent-cyan);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.slider::-moz-range-track {
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
}

/* Active slider — pink track fill */
.slider:active::-webkit-slider-thumb {
  background: var(--accent-pink);
  box-shadow: 0 0 10px rgba(255, 41, 117, 0.5);
}

/* ---------- Icon Buttons ---------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.icon-btn:active {
  background: var(--bg-panel);
}

.icon-btn--glow:hover {
  box-shadow: var(--glow-cyan);
  border-color: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
}

.icon-btn--danger:hover {
  color: var(--accent-pink);
  border-color: rgba(255, 41, 117, 0.2);
  box-shadow: var(--glow-pink);
}

/* ---------- Section Dividers ---------- */

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-xs) 0;
}

/* ---------- Empty State ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
  gap: var(--space-sm);
}

.empty-state__icon {
  font-size: 24px;
  opacity: 0.5;
}
