/**
 * Layout Styles
 * Grid layout, sections, and responsive structure
 */

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(28px);
}

.control-pane {
  border-right: 1px solid rgba(15, 15, 15, 0.08);
  padding: 48px 40px 32px 48px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 32px;
}

.control-pane header {
  display: grid;
  gap: 12px;
}

.workspace {
  position: relative;
  padding: 32px 48px 48px 48px;
  display: flex;
  flex-direction: column;
  background: #f9fafc;
}

.workspace-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.canvas-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}

.canvas-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 32px;
  /* padding: 40px; */
   /* position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0; */
  /* width: clamp(320px, 60vw, 520px); */
  height: clamp(200px, 80vh, 80vh);

  aspect-ratio: 1; 
  box-shadow: 0 28px 70px rgba(15, 15, 15, 0.06);
  overflow: hidden;
}

.canvas-wrapper[data-view-mode="3d"] canvas {
  display: none;
}

.canvas-wrapper[data-view-mode="2d"] model-viewer {
  display: none;
}

.canvas-wrapper[data-drag-active="true"] {
  box-shadow: inset 0 0 0 2px rgba(20, 124, 229, 0.45),
    0 32px 80px rgba(20, 124, 229, 0.28);
  background: linear-gradient(180deg, #f0f8ff 0%, #f5f9ff 100%);
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

model-viewer {
  width: 100%;
  height: 100%;
  background: transpredarent;
}

/* Responsive Layout */
@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 100dvh;
  }
  .control-pane {
    border-right: none;
    border-bottom: 1px solid rgba(15, 15, 15, 0.08);
    grid-template-rows: auto auto auto 1fr;
    padding: 32px 24px;
    button {
      line-height: 112%;
      max-height: 60px;
      font-size: 12px;
    }
  }

  .workspace {
    padding: 24px;
  }

  .canvas-stage {
    margin-top: 16px;
  }

  .canvas-wrapper {
    display: block;
    width: 100%;
    height: 100;
    aspect-ratio: auto;
  }
}
