/* ==========================================================================
   DEV ADVENTURE — LEVEL EDITOR STYLES
   Layout profesional, paleta indie retro, controles precisos e inspector.
   ========================================================================== */

.editor-body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background-color: #090a0f;
  color: #e2e8f0;
  font-family: 'Rajdhani', sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 1. TOPBAR */
.editor-topbar {
  height: 54px;
  background: #11131f;
  border-bottom: 2px solid #24293d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  gap: 12px;
}

.editor-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #fbbf24;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.brand-badge {
  background: #38bdf8;
  color: #0f172a;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 3px;
}

.editor-topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #181b2a;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #2d344d;
}

.control-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

.editor-select, .editor-input {
  background: #0d0f17;
  color: #f8fafc;
  border: 1px solid #3b4261;
  padding: 4px 8px;
  border-radius: 3px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  outline: none;
}

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

.editor-checkbox-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
}

.editor-checkbox-label input {
  cursor: pointer;
}

.editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.editor-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

.editor-btn:active {
  transform: translateY(1px);
}

.editor-btn-primary {
  background: #f59e0b;
  color: #0f172a;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.editor-btn-success {
  background: #10b981;
  color: #064e3b;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.editor-btn-info {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

.editor-btn-purple {
  background: #9333ea;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

.editor-btn-dim {
  background: #1e2438;
  color: #94a3b8;
  border: 1px solid #333d5e;
}

.editor-btn-dim:hover {
  color: #f8fafc;
  border-color: #38bdf8;
}

/* 2. MAIN LAYOUT */
.editor-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* 3. TOOL PALETTE (LEFT) */
.editor-toolbar {
  width: 170px;
  background: #121420;
  border-right: 2px solid #24293d;
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 8px;
  z-index: 10;
  overflow-y: auto;
}

.toolbar-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #64748b;
  text-transform: uppercase;
  margin: 8px 4px 4px 4px;
  letter-spacing: 0.5px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: #181b2c;
  color: #94a3b8;
  border: 1px solid #2b324c;
  border-radius: 4px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.tool-btn .key {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  background: #090a0f;
  color: #fbbf24;
  padding: 3px 5px;
  border-radius: 3px;
  border: 1px solid #333d5e;
}

.tool-btn:hover {
  background: #1f243b;
  color: #f8fafc;
  border-color: #38bdf8;
}

.tool-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: inset 0 0 8px rgba(56, 189, 248, 0.2);
}

.tool-btn.active .key {
  background: #38bdf8;
  color: #0f172a;
}

.tool-btn.tool-danger:hover, .tool-btn.tool-danger.active {
  border-color: #ef4444;
  color: #ef4444;
}

/* 4. WORKSPACE VIEWPORT (CENTER) */
.editor-viewport {
  flex: 1;
  background: #08090d;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

#editorCanvas {
  background: #0f172a;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 2px #38bdf8;
  border: 1px solid #24293d;
  image-rendering: pixelated;
}

/* 5. PROPERTIES INSPECTOR (RIGHT) */
.editor-inspector {
  width: 240px;
  background: #121420;
  border-left: 2px solid #24293d;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 14px;
  z-index: 10;
  overflow-y: auto;
}

.inspector-card {
  background: #181b2c;
  border: 1px solid #2b324c;
  border-radius: 6px;
  padding: 12px;
}

.inspector-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #fbbf24;
  margin-bottom: 10px;
  border-bottom: 1px solid #2b324c;
  padding-bottom: 6px;
}

.inspector-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inspector-field label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.inspector-field input, .inspector-field select {
  width: 90px;
  padding: 3px 6px;
}

.editor-color-picker {
  width: 32px !important;
  height: 28px;
  padding: 0 !important;
  border: 1px solid #3b4261;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  outline: none;
}

.editor-color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

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

.color-presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 140px;
  justify-content: flex-end;
}

.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}

.color-swatch:hover {
  transform: scale(1.25);
  border-color: #ffffff;
  z-index: 2;
}

.color-swatch.active {
  border-color: #ffffff;
  box-shadow: 0 0 4px #ffffff;
}

.inspector-empty {
  font-size: 12px;
  color: #64748b;
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}

.shortcuts-list {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.6;
}

.shortcuts-list kbd {
  background: #090a0f;
  color: #38bdf8;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid #2b324c;
}

/* 6. STATUS BAR (BOTTOM) */
.editor-statusbar {
  height: 28px;
  background: #0d0f17;
  border-top: 1px solid #24293d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  z-index: 100;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-highlight {
  color: #38bdf8;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
}

/* 7. TOAST NOTIFICATIONS */
.editor-toast {
  position: fixed;
  bottom: 40px;
  right: 20px;
  background: #1e2438;
  color: #f8fafc;
  border: 1px solid #38bdf8;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
  z-index: 1000;
}

.editor-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.editor-toast.success {
  border-color: #10b981;
  background: #064e3b;
  color: #a7f3d0;
}

.editor-toast.error {
  border-color: #ef4444;
  background: #7f1d1d;
  color: #fecaca;
}

.editor-toast.info {
  border-color: #38bdf8;
  background: #0c4a6e;
  color: #bae6fd;
}

/* 8. MODAL DIALOGS */
.editor-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 15, 0.82);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.editor-modal-box {
  background: #111420;
  border: 2px solid #38bdf8;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-modal-header {
  background: #1a1f30;
  border-bottom: 1px solid #283049;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-modal-title {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.editor-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0 4px;
}

.editor-modal-close:hover {
  color: #ef4444;
}

.editor-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #cbd5e1;
  font-size: 13px;
}

.editor-modal-desc {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.editor-modal-desc code {
  background: #090b12;
  color: #38bdf8;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  border: 1px solid #1e2538;
}

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

.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.modal-input-full {
  width: 100% !important;
  box-sizing: border-box;
}

.modal-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #f59e0b;
  color: #fde68a;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
}

.editor-modal-footer {
  background: #0d101a;
  border-top: 1px solid #283049;
  padding: 12px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

