/* ==========================================================================
   properties.css - Right Inspector & Vector Styling Panel (Light Theme)
   ========================================================================== */

#properties-container {
  grid-area: properties;
  background-color: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 40;
}

#properties-container::-webkit-scrollbar {
  width: 6px;
}
#properties-container::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  transition: padding 0.15s ease;
}

.panel-section:last-child {
  border-bottom: none;
}

/* Collapsible Accordion Header */
.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 3px 0;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.panel-section-header:hover .panel-heading {
  color: var(--accent-primary, #0284c7);
}

.panel-section-header:hover .panel-chevron {
  color: var(--accent-primary, #0284c7);
}

.panel-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
  margin: 0;
  transition: color 0.15s ease;
}

.panel-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #94a3b8);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
}

.accordion-section.is-collapsed {
  padding-bottom: 6px;
  gap: 0;
}

.accordion-section.is-collapsed .panel-chevron {
  transform: rotate(-90deg);
}

.accordion-section.is-collapsed .panel-section-content {
  display: none !important;
}

.panel-section-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Formatting button active states */
#properties-container .topbar-btn.active,
#properties-container .topbar-btn.secondary.active {
  background-color: var(--accent-primary, #0284c7) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary, #0284c7) !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35) !important;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

input[type="text"],
input[type="number"],
select.form-select {
  width: 100%;
  height: 30px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-primary);
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

/* Stepper Component with Crisp Vectors and White Theme */
.stepper-box {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  height: 28px;
  flex-shrink: 0;
}

.stepper-box:focus-within {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.stepper-input {
  width: 44px;
  height: 100%;
  border: none !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  padding: 0 4px !important;
  outline: none !important;
  box-shadow: none !important;
  -moz-appearance: textfield;
}

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

.stepper-arrows {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  height: 100%;
  width: 22px;
}

.stepper-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50%;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  padding: 0;
  transition: background 0.1s, color 0.1s;
}

.stepper-arrow:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.stepper-arrow.up {
  border-bottom: 1px solid #e2e8f0;
}

.stepper-arrow svg {
  width: 8px;
  height: 8px;
  pointer-events: none;
}

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

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 30px;
  border-radius: 5px;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
}

.hex-input {
  flex: 1;
}

.slider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-row span {
  font-size: 11px;
  color: var(--accent-primary);
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.tip-box {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--accent-primary);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-val {
  font-weight: 600;
  color: var(--text-primary);
}

.tips-list {
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

.capitalize {
  text-transform: capitalize;
}

.panel-quick-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 2px;
}

.panel-quick-actions .topbar-btn {
  flex: 1 1 28px;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  justify-content: center;
  font-size: 11px;
}

/* Predefined Color Swatches Grid */
.color-swatches-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin-top: 8px;
  padding: 6px;
  background: var(--bg-hover, #1e293b);
  border-radius: 6px;
  border: 1px solid var(--border-subtle, #334155);
}

.color-swatch-chip {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease;
  position: relative;
}

.color-swatch-chip:hover {
  transform: scale(1.18);
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border-color: #ffffff;
}

.color-swatch-chip.active {
  transform: scale(1.12);
  outline: 2px solid var(--accent, #0284c7);
  outline-offset: 1px;
  z-index: 1;
}

/* Dual-Swatch Target Selector (Illustrator/Photoshop Style) */
.color-target-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.color-target-tab {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--border-subtle, #cbd5e1);
  background: var(--bg-input, #ffffff);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.color-target-tab:hover {
  border-color: var(--accent-primary, #0284c7);
  background: rgba(2, 132, 199, 0.04);
}

.color-target-tab.active {
  border-color: var(--accent-primary, #0284c7) !important;
  background: rgba(2, 132, 199, 0.08) !important;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15);
}

.color-target-tab .target-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-target-tab.active .target-name {
  color: var(--accent-primary, #0284c7);
}

.color-target-tab .target-val {
  font-size: 10px;
  color: var(--text-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

