.editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-editor);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.editor-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.editor-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: rgba(15, 15, 25, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-color);
  z-index: calc(var(--z-editor) + 1);
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-panel.open {
  right: 0;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.editor-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.editor-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.editor-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.editor-tabs::-webkit-scrollbar {
  display: none;
}

.editor-tab {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: none;
  font-family: var(--font);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  position: relative;
}

.editor-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.editor-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.editor-content::-webkit-scrollbar {
  width: 6px;
}

.editor-content::-webkit-scrollbar-track {
  background: transparent;
}

.editor-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.editor-section {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.editor-section.active {
  display: flex;
}

.editor-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.editor-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.editor-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.editor-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.editor-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.editor-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.editor-select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.editor-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.editor-select option {
  background: #1a1a2e;
  color: var(--text);
}

.editor-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-color-input {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  background: none;
  padding: 2px;
  flex-shrink: 0;
}

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

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

.editor-color-hex {
  flex: 1;
}

.editor-range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.editor-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: var(--transition);
}

.editor-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
  transition: var(--transition);
}

.editor-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.editor-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
}

.editor-range-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 32px;
  text-align: right;
}

.editor-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.editor-link-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.editor-link-item .link-info {
  flex: 1;
  min-width: 0;
}

.editor-link-item .link-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.editor-link-item .link-info p {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-link-actions {
  display: flex;
  gap: 4px;
}

.editor-link-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.editor-link-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.editor-link-btn.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.editor-link-btn.duplicate:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.editor-add-btn {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.editor-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.editor-bg-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.editor-bg-option {
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.editor-bg-option:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.editor-bg-option.active {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}

.editor-bg-option i {
  font-size: 20px;
}

.editor-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.editor-footer .btn {
  flex: 1;
}

.editor-social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.editor-social-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.editor-social-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.editor-social-item .editor-input {
  padding: 8px 12px;
  font-size: 13px;
}

.editor-file-upload {
  position: relative;
  width: 100%;
  padding: 32px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.02);
}

.editor-file-upload:hover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.05);
}

.editor-file-upload i {
  font-size: 32px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.editor-file-upload p {
  font-size: 14px;
  color: var(--text-secondary);
}

.editor-file-upload input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.editor-preview-img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.theme-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.theme-preset {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.theme-preset:hover {
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.3);
}

.theme-preset.active {
  border-color: var(--text);
  box-shadow: 0 0 12px rgba(255,255,255,0.1);
}
