/* ==========================================================================
   Workspace Stylesheet - imagemodifier.com
   ========================================================================== */

:root {
  --bg-dark: #121214;
  --bg-workspace: #18181c;
  --bg-panel: #202024;
  --bg-card: #28282d;
  --cyan-primary: #00adb5;
  --cyan-hover: #00f5ff;
  --cyan-glow: rgba(0, 173, 181, 0.15);
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 173, 181, 0.3);
  
  --text-main: #eeeeee;
  --text-sub: #9a9a9f;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', monospace;
  
  --transition-fast: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.editor-dark {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.editor-header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-light);
  height: 60px;
  min-height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

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

.editor-logo .logo-symbol {
  font-size: 24px;
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.editor-logo .logo-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.editor-logo .logo-badge {
  font-size: 10px;
  background: rgba(0, 173, 181, 0.1);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39c558;
  box-shadow: 0 0 8px #39c558;
}

/* Workspace Frame Grid */
.editor-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* Toolbar Side panel */
.editor-toolbar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border-light);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.toolbar-section h5 {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-primary);
  margin-bottom: 12px;
}

.tool-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tool-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: var(--transition-fast);
}

.tool-btn:hover {
  border-color: var(--cyan-primary);
  background: rgba(0, 173, 181, 0.08);
}

.property-group {
  margin-bottom: 16px;
}

.property-group label {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.color-picker-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
}

.color-picker-row input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: none;
  cursor: pointer;
}

.color-picker-row input[type="text"] {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-main);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.range-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.range-group span {
  width: 40px;
  color: var(--text-sub);
}

.range-group input[type="range"] {
  flex: 1;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--cyan-primary);
}

.action-btn {
  width: 100%;
  padding: 12px;
  font-weight: 500;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  margin-bottom: 10px;
}

.btn-danger {
  background: rgba(255, 46, 99, 0.1);
  color: #ff2e63;
  border-color: rgba(255, 46, 99, 0.2);
}

.btn-danger:hover {
  background: #ff2e63;
  color: #ffffff;
}

.btn-success {
  background: rgba(57, 197, 88, 0.1);
  color: #39c558;
  border-color: rgba(57, 197, 88, 0.2);
}

.btn-success:hover {
  background: #39c558;
  color: #ffffff;
}

.spacer-top {
  margin-top: auto;
}

/* Canvas Area Frame */
.editor-canvas-area {
  background: var(--bg-workspace);
  display: grid;
  grid-template-rows: 1fr 200px;
  overflow: hidden;
}

.canvas-container {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
}

.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-sub);
}

.canvas-selection-banner {
  background: rgba(0, 173, 181, 0.08);
  border: 1px solid var(--border-active);
  color: var(--cyan-primary);
  padding: 4px 10px;
  border-radius: 4px;
}

.canvas-wrapper {
  flex: 1;
  background: #0d0d10;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}

#svg-canvas {
  max-width: 800px;
  max-height: 600px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  border: 1px dashed rgba(255,255,255,0.05);
}

/* SVG Selection outline helper */
.selected-shape {
  outline: 2px dashed var(--cyan-primary) !important;
  outline-offset: 4px;
}

/* Layers list panel */
.layers-panel {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.layers-panel .panel-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.layers-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 10px 16px;
}

.layer-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 6px;
  background: var(--bg-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}

.layer-item:hover {
  border-color: var(--border-light);
}

.layer-item.active {
  border-color: var(--cyan-primary);
  background: rgba(0, 173, 181, 0.05);
}

.layer-delete-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.layer-delete-btn:hover {
  color: #ff2e63;
}

/* AI Agent Chat Sidebar */
.editor-sidebar {
  background: var(--bg-panel);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.agent-panel .panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header .header-icon {
  color: var(--cyan-primary);
  text-shadow: 0 0 8px var(--cyan-primary);
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 85%;
  line-height: 1.5;
}

.message-system {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-light);
  color: var(--text-sub);
  max-width: 100%;
}

.message-system code {
  color: var(--cyan-primary);
  font-family: var(--font-mono);
}

.message-system ul {
  padding-left: 16px;
  margin-top: 8px;
}

.message-user {
  background: var(--bg-card);
  align-self: flex-end;
  border: 1px solid var(--border-light);
}

.message-agent {
  background: rgba(0, 173, 181, 0.08);
  border: 1px solid var(--border-active);
  color: var(--text-main);
  align-self: flex-start;
}

.chat-input-form {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
}

.chat-input-form input {
  flex: 1;
  background: var(--bg-workspace);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-main);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
}

.chat-input-form input:focus {
  outline: none;
  border-color: var(--cyan-primary);
}

.btn-chat-send {
  background: var(--cyan-primary);
  color: #121214;
  border: none;
  border-radius: 4px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition-fast);
}

.btn-chat-send:hover {
  background: var(--cyan-hover);
  box-shadow: 0 0 10px var(--cyan-glow);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transform: translateZ(0);
  will-change: transform;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  width: 90%;
  max-width: 600px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 24px;
  cursor: pointer;
}

.close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px;
}

.modal-body textarea {
  width: 100%;
  height: 300px;
  background: var(--bg-workspace);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-main);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  resize: none;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
}

.btn-gold {
  background: var(--cyan-primary);
  color: #121214;
  border: none;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

/* Mobile Responsive Overrides */
@media (max-width: 1024px) {
  body.editor-dark {
    height: auto;
    overflow-y: auto;
  }
  
  .editor-workspace {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  
  .editor-toolbar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    height: auto;
    overflow-y: visible;
  }
  
  .editor-canvas-area {
    width: 100%;
    height: auto;
  }
  
  #svg-canvas {
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
  
  .layers-panel {
    border-top: 1px solid var(--border-light);
  }
}

