/* ==========================================================================
   ZDOG STUDIO - MODERN PRESETS & AESTHETIC STYLE SHEET (SPLINE STYLED)
   ========================================================================== */

:root {
  /* UI Colors - Dark Theme (Default) */
  --bg-darkest: #11141b;      /* Main window background */
  --bg-dark: #181c24;         /* Viewport background */
  --bg-sidebar: #1d2027;      /* Sidebar panel background */
  --bg-panel: #21252d;        /* Cards & Section headers */
  --bg-control: #12141a;      /* Inputs background */
  --bg-control-active: #2b303a;
  
  /* Borders */
  --border-color: #282c35;
  --border-focus: #ff5c00;    /* Focus orange */
  
  /* Highlights & Accents */
  --accent-orange: #ff5c00;   /* Render Orange */
  --accent-orange-hover: #e04f00;
  
  --accent-blue: #3b82f6;     /* Add/Select tool Blue */
  --accent-blue-hover: #2563eb;
  
  --text-active: #ffffff;
  --text-muted: #7f8c9d;
  --text-muted-dark: #4f5b66;

  /* Transparent & Helper helpers */
  --bg-hover: rgba(255, 255, 255, 0.02);
  --bg-active: rgba(255, 255, 255, 0.04);
  --bg-item-header: rgba(0, 0, 0, 0.05);
  --bg-item-header-hover: rgba(255, 255, 255, 0.01);
  --bg-settings-hover: rgba(255, 255, 255, 0.03);
  --border-indent: rgba(255, 255, 255, 0.03);
  --grid-line-color: rgba(255, 255, 255, 0.012);
  --bg-scrollbar-thumb: rgba(255, 255, 255, 0.08);
  --bg-scrollbar-thumb-hover: rgba(255, 255, 255, 0.18);
  
  /* Shadow & Floating elements */
  --shadow-color: rgba(0, 0, 0, 0.35);
  --bg-floating: rgba(29, 32, 39, 0.85);

  /* Dot presets */
  --dot-purple: #8b5cf6;
  --dot-red: #ef4444;
  --dot-orange: #f97316;
  --dot-yellow: #eab308;
  --dot-green: #10b981;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --transition: all 0.15s ease;
}

[data-theme="light"] {
  /* UI Colors - Light Theme based on playful/neo-brutalist cartoon palette */
  --bg-darkest: #7c70ff;      /* Main lavender/purple background behind floating panels */
  --bg-dark: #f0f3f8;         /* Viewport background (light gray/blue) */
  --bg-sidebar: #ffffff;      /* Sidebar panel background (pure white) */
  --bg-panel: #f8f9fa;        /* Cards & Section headers */
  --bg-control: #ffffff;      /* Inputs background */
  --bg-control-active: #e8e6ff;
  
  /* Borders - Dark solid borders like neo-brutalist cartoon */
  --border-color: #1e293b;
  --border-focus: #ff5c00;
  
  /* Highlights & Accents */
  --accent-orange: #ff5c00;
  --accent-orange-hover: #e04f00;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  
  /* Text */
  --text-active: #1e293b;     /* Dark text */
  --text-muted: #64748b;      /* Slate gray */
  --text-muted-dark: #94a3b8;
  
  /* Transparent & Helper helpers */
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-active: rgba(0, 0, 0, 0.06);
  --bg-item-header: rgba(0, 0, 0, 0.02);
  --bg-item-header-hover: rgba(0, 0, 0, 0.04);
  --bg-settings-hover: rgba(0, 0, 0, 0.04);
  --border-indent: rgba(30, 41, 59, 0.08);
  --grid-line-color: rgba(30, 41, 59, 0.03);
  --bg-scrollbar-thumb: rgba(0, 0, 0, 0.12);
  --bg-scrollbar-thumb-hover: rgba(0, 0, 0, 0.25);
  
  /* Shadow & Floating elements */
  --shadow-color: rgba(30, 41, 59, 0.15);
  --bg-floating: rgba(255, 255, 255, 0.9);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-darkest);
  color: var(--text-active);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-scrollbar-thumb);
  border-radius: 20px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bg-scrollbar-thumb-hover);
}

/* Main Grid Layout */
.editor-container {
  display: grid;
  grid-template-columns: 280px 1fr 310px;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ==========================================================================
   LEFT SIDEBAR STYLE
   ========================================================================== */

.sidebar-left {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* User Card */
.workspace-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.workspace-info h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-active);
  letter-spacing: 0.1px;
}

.workspace-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.settings-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.settings-btn:hover {
  color: var(--text-active);
  background: var(--bg-settings-hover);
}

.settings-btn i {
  width: 15px;
  height: 15px;
}

/* Panel Sections */
.panel-section {
  border-bottom: 1px solid var(--border-color);
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 8px 20px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-section-header i {
  width: 13px;
  height: 13px;
}

/* Sample List items */
.samples-list {
  list-style: none;
  padding: 0 12px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sample-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  gap: 10px;
}

.sample-item:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-active);
}

.sample-item.active {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-active);
  font-weight: 600;
}

.sample-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sample-item .dot.purple { background-color: var(--dot-purple); }
.sample-item .dot.red { background-color: var(--dot-red); }
.sample-item .dot.orange { background-color: var(--dot-orange); }
.sample-item .dot.yellow { background-color: var(--dot-yellow); }
.sample-item .dot.green { background-color: var(--dot-green); }

.sample-item .shortcut {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text-muted-dark);
  font-weight: 400;
}

.add-sample-btn {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 6px;
  margin: 0 20px 16px 20px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.add-sample-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-active);
}

.add-sample-btn i {
  width: 12px;
  height: 12px;
}

/* Scene hierarchy tree */
.flex-grow {
  flex-grow: 1;
}

.search-bar-container {
  position: relative;
  margin: 4px 16px 10px 16px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

#hierarchy-search {
  width: 100%;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  padding: 7px 10px 7px 30px;
  border-radius: 8px;
  color: var(--text-active);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  outline: none;
  transition: var(--transition);
}

#hierarchy-search:focus {
  border-color: var(--accent-orange);
}

.hierarchy-tree-container {
  overflow-y: auto;
  padding: 0 16px 20px 16px;
  max-height: calc(100vh - 350px);
}

.hierarchy-tree {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hierarchy-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  gap: 8px;
  border: 1px solid transparent;
}

.hierarchy-item:hover {
  background: var(--bg-hover);
  color: var(--text-active);
}

.hierarchy-item.selected {
  background: var(--bg-control-active);
  color: var(--text-active);
  font-weight: 500;
  border-color: var(--border-color);
}

.hierarchy-item i {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.hierarchy-item .node-type-icon {
  color: var(--text-muted-dark);
}

.hierarchy-item.selected .node-type-icon {
  color: var(--accent-blue);
}

.hierarchy-item .node-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.hierarchy-item .node-actions {
  display: none;
  gap: 4px;
}

.hierarchy-item:hover .node-actions,
.hierarchy-item.selected .node-actions {
  display: flex;
}

.hierarchy-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted-dark);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.hierarchy-action-btn:hover {
  color: var(--text-active);
  background: var(--bg-active);
}

.hierarchy-action-btn.visibility-toggle.muted {
  opacity: 0.3;
}

.indent-0 { margin-left: 0; }
.indent-1 { margin-left: 10px; border-left: 1px solid var(--border-indent); padding-left: 10px; }
.indent-2 { margin-left: 20px; border-left: 1px solid var(--border-indent); padding-left: 10px; }
.indent-3 { margin-left: 30px; border-left: 1px solid var(--border-indent); padding-left: 10px; }

/* ==========================================================================
   CENTER VIEWPORT AREA
   ========================================================================== */

.viewport-area {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  position: relative;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
}

/* Grid overlay background */
.viewport-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--grid-line-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-color) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

.viewport-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  z-index: 10;
  pointer-events: none;
}

.viewport-hud-top > * {
  pointer-events: auto;
}

.camera-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.camera-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-active);
}

.camera-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sub-divider {
  color: var(--text-muted-dark);
  margin: 0 4px;
}

.viewport-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dropdown styling */
.dropdown-wrapper {
  position: relative;
}

.hud-select-btn {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  color: var(--text-active);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.hud-select-btn:hover {
  background: var(--bg-panel);
}

.hud-select-btn i {
  width: 12px;
  height: 12px;
  color: var(--text-muted);
}

.hud-dropdown-menu {
  position: absolute;
  top: 36px;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 120px;
  display: none;
  flex-direction: column;
  padding: 4px;
  box-shadow: 0 10px 20px var(--shadow-color);
  z-index: 200;
}

.hud-dropdown-menu.show {
  display: flex;
}

.hud-dropdown-menu .menu-item {
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}

.hud-dropdown-menu .menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-active);
}

.hud-dropdown-menu .menu-item.active {
  background: var(--accent-blue);
  color: white;
}

.hud-btn {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.hud-btn:hover {
  background: var(--bg-panel);
  color: var(--text-active);
}

.hud-btn.active {
  color: var(--text-active);
}

.hud-btn.play-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.hud-btn.play-btn:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}

.hud-btn.play-btn.active {
  background: var(--accent-orange);
  box-shadow: 0 4px 10px rgba(255, 92, 0, 0.3);
}

.hud-btn.play-btn.active:hover {
  background: var(--accent-orange-hover);
}

.hud-btn i {
  width: 14px;
  height: 14px;
}

/* Canvas viewport */
.canvas-wrapper {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: relative;
}

.zdog-canvas {
  max-width: 100%;
  max-height: 100%;
  cursor: grab;
}

.zdog-canvas:active {
  cursor: grabbing;
}

/* Bottom HUD Floating Toolbar */
.viewport-hud-bottom {
  padding: 20px;
  display: flex;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.viewport-hud-bottom > * {
  pointer-events: auto;
}

.floating-toolbar {
  background: var(--bg-floating);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  padding: 5px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 8px 24px var(--shadow-color);
}

.add-circle-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.add-circle-btn:hover {
  background: var(--accent-blue-hover);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

.add-circle-btn i {
  width: 15px;
  height: 15px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.tool-btn:hover {
  background: var(--bg-hover);
  color: var(--text-active);
}

.tool-btn.active {
  background: var(--bg-active);
  color: var(--text-active);
}

.tool-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.tool-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.tool-btn i {
  width: 14px;
  height: 14px;
}

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-color);
  margin: 0 2px;
}

/* Floating shape menu position */
.add-shape-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  bottom: 44px;
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  width: 160px;
  display: none;
  flex-direction: column;
  padding: 4px 0;
  box-shadow: 0 8px 20px var(--shadow-color);
  max-height: 280px;
  overflow-y: auto;
  z-index: 150;
}

.dropdown-menu.show {
  display: flex;
}

.menu-group {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted-dark);
  padding: 6px 12px 2px 12px;
  letter-spacing: 0.3px;
}

.menu-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-active);
}

.menu-item i {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   RIGHT SIDEBAR STYLE
   ========================================================================== */

.sidebar-right {
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.sidebar-panel-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.sidebar-panel-container.hide {
  display: none;
}

/* Collapsible Card Widget */
.collapsible-card {
  border-bottom: 1px solid var(--border-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  user-select: none;
  background-color: var(--bg-item-header);
}

.card-header:hover {
  background-color: var(--bg-item-header-hover);
}

.card-header h4 {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.card-header .chevron {
  width: 12px;
  height: 12px;
  color: var(--text-muted-dark);
  transition: var(--transition);
}

.collapsible-card.collapsed .card-body {
  display: none;
}

.collapsible-card.collapsed .chevron {
  transform: rotate(-90deg);
}

.card-body {
  padding: 12px 20px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Property Sliders / Fields */
.property-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.property-row label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Custom Dropdown select */
.select-wrapper {
  position: relative;
  width: 140px;
}

.select-wrapper select {
  width: 100%;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  color: var(--text-active);
  font-size: 0.74rem;
  padding: 5px 24px 5px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  transition: var(--transition);
}

.select-wrapper select:focus {
  border-color: var(--accent-orange);
}

.select-chevron {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  color: var(--text-muted-dark);
  pointer-events: none;
}

/* Segmented Control Toggle Yes/No */
.segmented-control {
  display: flex;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  padding: 2px;
  border-radius: 6px;
  width: 140px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.segment-btn.active {
  background: var(--bg-control-active);
  color: var(--text-active);
}

/* Inline checkbox styling */
.property-row.inline-two {
  justify-content: flex-start;
  gap: 16px;
  margin-top: 4px;
}

/* Switch toggle styling */
.custom-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
}

.custom-toggle input {
  display: none;
}

.toggle-track {
  width: 28px;
  height: 16px;
  background-color: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  position: relative;
  transition: var(--transition);
}

.toggle-track::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted-dark);
  transition: var(--transition);
}

.custom-toggle input:checked + .toggle-track {
  background-color: var(--accent-orange);
  border-color: var(--accent-orange);
}

.custom-toggle input:checked + .toggle-track::before {
  left: 14px;
  background-color: white;
}

/* Slider wrappers */
.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 140px;
}

.slider-wrapper input[type="range"] {
  flex-grow: 1;
}

.value-text {
  font-size: 0.74rem;
  color: var(--text-active);
  min-width: 20px;
  text-align: right;
}

/* Premium Color picker */
.color-picker-box {
  display: flex;
  align-items: center;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px;
  width: 140px;
  gap: 6px;
}

.color-preview-wrapper {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.color-preview-wrapper input[type="color"] {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 26px;
  height: 26px;
  border: none;
  cursor: pointer;
}

.color-hex-text {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-active);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  width: 60px;
  text-transform: uppercase;
}

.opacity-val {
  font-size: 0.65rem;
  color: var(--text-muted-dark);
  margin-left: auto;
  padding-right: 4px;
}

/* ==========================================
   TRANSFORMS SUBSECTION STYLING
   ========================================== */

.transform-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-indent);
  padding-top: 10px;
}

.transform-section:first-child {
  border-top: none;
  padding-top: 0;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted-dark);
  letter-spacing: 0.3px;
}

.coord-inputs {
  display: flex;
  gap: 6px;
}

.coord-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px 6px;
  gap: 6px;
}

.coord-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  width: 10px;
}

.coord-lbl.x-lbl { color: #f43f5e; }
.coord-lbl.y-lbl { color: #10b981; }
.coord-lbl.z-lbl { color: #3b82f6; }

.coord-field input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-active);
  font-size: 0.74rem;
  width: 100%;
  text-align: right;
  font-family: var(--font-mono);
}

.coord-sliders {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0,0,0,0.08);
  padding: 8px;
  border-radius: 6px;
}

/* ==========================================
   RANGE SLIDER RESET & STYLING
   ========================================== */

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--bg-control);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--accent-orange);
}

/* Render section orange button */
.render-section {
  padding: 20px;
  margin-top: auto;
}

.render-btn {
  width: 100%;
  background: var(--accent-orange);
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(255, 92, 0, 0.25);
}

.render-btn:hover {
  background: var(--accent-orange-hover);
  box-shadow: 0 4px 20px rgba(255, 92, 0, 0.35);
}

.render-btn span {
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.empty-tip {
  font-size: 0.72rem;
  color: var(--text-muted-dark);
  text-align: center;
  font-style: italic;
  padding: 4px 0;
}

/* ==========================================
   CODE GENERATION CARD (Right Sidebar toggle)
   ========================================== */

#code-panel {
  padding: 16px;
}

.code-card {
  background: var(--bg-darkest);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 15px var(--shadow-color);
}

.code-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-hover);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.copy-btn {
  background: var(--bg-active);
  border: 1px solid var(--border-color);
  color: var(--text-active);
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.copy-btn:hover {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

.copy-btn i {
  width: 10px;
  height: 10px;
}

.code-viewer {
  padding: 12px;
  overflow: auto;
  max-height: calc(100vh - 280px);
  background: #0e1014;
}

.code-viewer pre {
  margin: 0;
}

.code-viewer code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.45;
  color: #c0a0ff;
  white-space: pre;
}

/* Syntax colors */
.code-comment { color: #5c6370; font-style: italic; }
.code-keyword { color: #f43f5e; font-weight: 600; }
.code-class { color: #f59e0b; }
.code-number { color: #10b981; }
.code-string { color: #10b981; }
.code-property { color: #60a5fa; }

.code-instructions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-instructions h5 {
  font-size: 0.76rem;
  color: var(--text-active);
}

.code-instructions p {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.html-snippet {
  background: var(--bg-darkest);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px;
  overflow-x: auto;
}

.html-snippet code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #10b981;
}

/* Theme Toggle Button Styling */
#btn-theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

#btn-theme-toggle:hover {
  color: var(--text-active);
  background: var(--bg-settings-hover);
}

#btn-theme-toggle i {
  width: 15px;
  height: 15px;
}

/* Timeline Styling */
.timeline-container {
  position: absolute;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-floating);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-color);
  width: 520px;
  z-index: 10;
}

.timeline-container .frame-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  width: 55px;
  text-align: center;
}

.timeline-slider-wrapper {
  position: relative;
  flex-grow: 1;
  display: flex;
  align-items: center;
}

#timeline-slider {
  width: 100%;
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: var(--bg-control);
  -webkit-appearance: none;
  border: 1px solid var(--border-color);
}

#timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-orange);
  cursor: pointer;
  border: 2px solid var(--text-active);
  transition: var(--transition);
}

#timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#keyframe-markers {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.keyframe-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: var(--accent-orange);
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1px solid var(--bg-darkest);
  z-index: 5;
  transition: var(--transition);
}

.keyframe-dot:hover {
  background-color: var(--text-active);
  transform: translate(-50%, -50%) rotate(45deg) scale(1.3);
}

/* Modal Dialog Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 13, 18, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.hide {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.modal-container {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 580px;
  max-width: 90%;
  box-shadow: 0 16px 40px var(--shadow-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-active);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header h3 i {
  color: var(--accent-orange);
  width: 16px;
  height: 16px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-active);
  background: var(--bg-hover);
}

.modal-close-btn i {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-description {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
}

#import-code-input {
  width: 100%;
  height: 280px;
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-active);
  resize: none;
  outline: none;
  transition: var(--transition);
  line-height: 1.4;
}

#import-code-input:focus {
  border-color: var(--border-focus);
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-panel);
}

.modal-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.modal-btn.primary {
  background: var(--accent-orange);
  color: #ffffff;
}

.modal-btn.primary:hover {
  background: var(--accent-orange-hover);
}

.modal-btn.secondary {
  background: var(--bg-control);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.modal-btn.secondary:hover {
  color: var(--text-active);
  background: var(--bg-control-active);
}


