* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #0b1120;
  color: #f8fafc;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-header {
  height: 54px;
  background-color: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back {
  color: #94a3b8;
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-back:hover {
  background-color: #334155;
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.brand-icon {
  width: 20px;
  height: 20px;
  color: #38bdf8;
}

.badge-pro {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.tool-group, .history-group, .style-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn {
  background-color: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background-color: #334155;
  color: #ffffff;
}

.tool-btn.active {
  background-color: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.badge-step-icon {
  font-weight: 800;
  font-size: 14px;
}

.divider {
  width: 1px;
  height: 24px;
  background-color: #334155;
  margin: 0 4px;
}

#prop-color {
  width: 32px;
  height: 32px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  padding: 2px;
}

#prop-width {
  background-color: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-mockup {
  background-color: #334155;
  color: #f8fafc;
}

.btn-mockup.active {
  background: #0284c7;
  color: #ffffff;
}

.btn-export {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
}

.btn-export:hover {
  background: linear-gradient(135deg, #047857, #059669);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  min-width: 240px;
  z-index: 200;
  overflow: hidden;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  padding: 10px 14px;
  background: none;
  border: none;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: #334155;
}

/* Workspace layout */
.editor-workspace-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.sidebar-mockup {
  width: 280px;
  background-color: #1e293b;
  border-right: 1px solid #334155;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: margin-left 0.25s ease;
}

.sidebar-mockup.collapsed {
  margin-left: -280px;
}

.sidebar-title {
  padding: 14px 16px;
  border-bottom: 1px solid #334155;
}

.sidebar-title h3 {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.sidebar-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-item label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.label-with-val {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.switch-control {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.switch-title {
  font-size: 12px;
  color: #f8fafc;
}

.input-text, .input-select {
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 10px;
  color: #f8fafc;
  font-size: 12px;
  outline: none;
}

.input-text:focus, .input-select:focus {
  border-color: #38bdf8;
}

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

.os-card input {
  display: none;
}

.os-box {
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  background-color: #0f172a;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.os-card input:checked + .os-box {
  border-color: #38bdf8;
  background-color: #0284c7;
  color: #ffffff;
}

.os-emoji {
  font-size: 18px;
}

.bg-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bg-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #334155;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.bg-chip:hover {
  transform: scale(1.15);
}

.bg-chip.active {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* Canvas stage */
.canvas-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px;
  background-color: #0b1120;
}

.canvas-card {
  display: inline-block;
  box-shadow: 0 25px 50px rgba(0,0,0,0.7);
  border-radius: 4px;
}

#studio-canvas {
  display: block;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e293b;
  color: #f8fafc;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
  border: 1px solid #334155;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}
