:root {
  --bg-gradient: linear-gradient(135deg, #090d16, #111827);
  --card-bg: rgba(17, 24, 39, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-primary);
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
  position: relative;
}

.sidebar {
  width: 340px;
  height: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--card-border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
}

.panel-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-section h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-grid {
  display: grid;
  grid-template-columns: 70px 1fr;
  row-gap: 8px;
  font-size: 13px;
}

.info-label {
  color: var(--text-secondary);
}

.info-val {
  font-weight: 500;
  word-break: break-all;
}

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

.control-group label {
  font-size: 12px;
  color: var(--text-secondary);
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

#color-hex {
  font-size: 13px;
  font-family: monospace;
}

select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
  font-size: 13px;
  cursor: pointer;
}

select:focus {
  border-color: var(--accent-blue);
}

.checkbox-group {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.dims-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  color: #34d399;
  text-align: center;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.viewport {
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

#canvas-2d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  background: #0f172a;
}

.drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drag-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.drag-box {
  border: 3px dashed rgba(59, 130, 246, 0.6);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  max-width: 450px;
  background: rgba(30, 41, 59, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.drag-icon {
  font-size: 50px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}

.drag-text {
  font-size: 16px;
  font-weight: 500;
  color: #93c5fd;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(9, 13, 22, 0.8);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 90;
  gap: 15px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* CAD Transform Tools */
.tool-buttons {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-tool {
  flex: 1;
  padding: 8px 6px;
  font-size: 11px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-tool:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-tool.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Precise Sliders Layout */
.slider-row {
  display: grid;
  grid-template-columns: 20px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 11px;
}

.slider-row span:last-child {
  text-align: right;
  color: #34d399;
}

.slider-row input[type="range"] {
  height: 4px;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.lang-btn:hover:not(.active) {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}


