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

@font-face {
  font-family: "OpenRunde"; /* set name */
  src: url(font/OpenRunde-Regular.woff); /* url of the font */
  font-weight:400;
}
@font-face {
  font-family: "OpenRunde"; /* set name */
  src: url(font/OpenRunde-Semibold.woff); /* url of the font */
  font-weight:500;
}

@font-face {
  font-family: "OpenRunde"; /* set name */
  src: url(font/OpenRunde-Bold.woff); /* url of the font */
  font-weight:600;
}

body {
  font-family: "OpenRunde", sans-serif;
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  background:#2A2A2A;
  letter-spacing: 0.02em;
  overflow: auto;
}

.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
input,button,select{
  font-family: "OpenRunde", sans-serif;
  letter-spacing: 0.02em;
}


/* App Layout - Two Column */
.app-layout {
}

.preview-section {
  position: fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  margin-left:-237px;
}

.controls-section {
  position: relative;
  float:right;
  width: 474px;
  z-index: 100;
  overflow-y: auto;
  padding:24px;
  bottom:0;
}

/* Controls Section */
.controls{
    display:flex;
    flex-direction: column;
  gap:24px;
}
.form-section{
  background-color:#303030;
  border-radius:28px;
  padding:24px;
  color:#fff;
  display:flex;
    flex-direction: column;
  gap:20px;
}
.form-section.multiple-options{
  padding:0;
  gap:0;
}
.control-group {
  display: flex;
  flex-direction: row;
  gap: 8px;
  min-height:44px;
    align-items: center;
    justify-content: space-between;
}

.control-group label {

}

.control-group input[type="file"],
.control-group select,
.control-group .button {
  padding: 12px 20px;
  border-radius: 40px;
  border:none;
  appearance: none;
  font-size: 16px;
  color:#fff;
  background: #424242;
  cursor: pointer;
}
.control-group select{
  width:194px;
  background: #424242 url(select.svg) right 20px center no-repeat;
}
.checkbox-option{
  display:flex;
  min-height:48px;
  width:100%;
  align-items: center;
    justify-content: space-between;
}
/* Color Picker Row */
.color-picker-row {
  display: flex;
  gap: 5px;
  align-items: center;
}

.button-group-button.red-button{
  background:#533B38;
  color:#FFEDEF;
}
.button.blue-button{
  background:#007aff;
  color:#fff;
}

.hex-input {
padding: 12px 19px;
    background: #424242;
    border-radius: 8px 24px 24px 8px;
    height:44px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    width:120px;
    font-family:monospace;
}

#bg-color-hex:focus {
  border-color: #007aff;
  outline: none;
}


.control-group input[type="checkbox"].toggle {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-right: 8px;
}


/* Crop Buttons Row */
.option-overall-reset {
  display: flex;
  gap: 12px;
  width:100%;
}

.addition-controls-group{
  display:flex;
    padding: 24px;
    gap: 20px;
    flex-direction: column;
  border-top:1px solid #3B3B3B;
}
.reset-mini{
  width:30px;
  height:30px;
  background:#424242 url(reset.svg) center center no-repeat;
  text-indent:-1000px;
  overflow:hidden;
  border-radius:50%;
  border:none;
  cursor:pointer;
}
.reset-mini,.button-group-button,#lock-aspect,.control-group select,input[type="color"]{
cursor:pointer;
}

.option-button{
  display:block;
  height:44px;
  min-width:44px;
  max-width:44px;
  background-color:#424242;
  border-radius:22px;
  border:none;
  text-indent:-1000px;
  overflow:hidden;
}
#lock-aspect{
  appearance: none;
  background:#424242 url(lock.svg) center center no-repeat;
  display:block;
}
#lock-aspect:checked{
  box-shadow:0 0 0 2px #007aff, inset 0 0 0 1px #007aff;
}

#flip-crop{ 
  background:#424242 url(flip.svg) center center no-repeat;
  display:none;
}
.button-group {
  display: flex;
  gap: 5px;
}

.button-group-button {
  padding: 12px 19px;
  background: #424242;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  border:none;
}
.button-group-button:first-child{
  border-radius:24px 8px 8px 24px;
  padding-left:21px;
}
.button-group-button:last-child{
  border-radius:8px 24px 24px 8px ;
  padding-right:21px;
}
.button-group-button.selected{
  box-shadow:0 0 0 2px #007aff, inset 0 0 0 1px #007aff;
}
.compact-button-group{
  width:178px;
}
.compact-button-group > *{
  flex-grow: 1;
}
.shape-btn{
  text-indent:-1000px;
  overflow:hidden;
  height:44px;
}
.shape-btn[data-shape="rounded-rect"]{
  background:#424242 url(square.svg) center center no-repeat;
}
.shape-btn[data-shape="oval"]{
  background:#424242 url(oval.svg) center center no-repeat;
}
/* Preview Container with Background */
#preview-container {
  display: inline-block;
  padding: 40px;
  border-radius: 8px;
  position: relative;
}

/* Crop Background Highlight - sits below frame container */
#crop-bg-highlight {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#crop-bg-highlight.no-transition {
  transition: none;
}


input[type="color"]{
    border-radius: 22px 8px 8px 22px;
    height: 44px;
    width: 44px;
    border: none;
    outline: none;
    -webkit-appearance: none;
    background:none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0; 
}
input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 22px 8px 8px 22px;
  
}


#frame-container {
  position: relative;
  max-width: 300px;
  width: 100%;
  overflow: visible;
  z-index: 1;
}

#ghost-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  filter: grayscale(100%);
  z-index: -1;
  pointer-events: none;
}

#ghost-user-image {
  position: absolute;
  background-size: 100% 100%;
  background-position: center;
  pointer-events: none;
  user-select: none;
}

#ghost-frame-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
    position: absolute;
    z-index: 1;
}

#frame-container img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* Hide frame images until they have a source */
#frame-container img:not([src]),
#frame-container img[src=""] {
  display: none;
}

#frame-container #user-image {
  position: absolute;
  object-fit: cover;
  z-index: 0;
  background-size: 100% 100%;
  transition: clip-path 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Positioning will be set dynamically by JavaScript based on model geometry */
}

#frame-image {
  position: relative;
  z-index: 1;
  transition: clip-path 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#frame-container #user-image.no-transition,
#frame-image.no-transition {
  transition: none;
}

/* Magnifier Box */
#magnifier-box,#crop-box{
  position: absolute;
  cursor: move;
}
#magnifier-box{
    border-radius: 8px;
  z-index: 15;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.08));
}

/* Add blue outline when selected */
#magnifier-box.selected,#crop-box.selected{
  outline: 3px solid #007aff;
  outline-offset: 0px;
}

#magnifier-box.oval {
  border-radius: 50%;
}
#magnifier-box.selected{
  outline-offset: -1px;
}


/* Hide magnifier handles when not selected */
#magnifier-box:not(.selected) .magnifier-resize-handle {
  display: none;
}

#magnifier-canvas {
  
  display: block;
  pointer-events: none;
  border-radius: 8px;
  overflow: hidden;
}

#magnifier-box.oval #magnifier-canvas {
  clip-path: ellipse(50% 50% at 50% 50%);
}

/* Magnifier Resize Handles - Match Crop Box Style */
.magnifier-resize-handle,.crop-handle {
  position: absolute;
  background: white;
  border: 2px solid #007aff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: all;
  z-index: 25;
}

.magnifier-resize-handle.corner,.crop-handle.corner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.magnifier-resize-handle.edge,.crop-handle.edge {
  background: white;
  border: 2px solid #007aff;
  border-radius: 4px;
}

.magnifier-resize-handle.top-left,.crop-handle.top-left {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}

.magnifier-resize-handle.top-right,.crop-handle.top-right {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}

.magnifier-resize-handle.bottom-left,.crop-handle.bottom-left {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}

.magnifier-resize-handle.bottom-right,.crop-handle.bottom-right {
  bottom: -6px;
  right: -6px;
  cursor: nwse-resize;
}

.magnifier-resize-handle.edge.top,
.magnifier-resize-handle.edge.bottom,.crop-handle.top,.crop-handle.bottom {
  width: 40px;
  height: 8px;
  left: 50%;
  margin-left: -20px;
}

.magnifier-resize-handle.edge.top,.crop-handle.top {
  top: -4px;
  cursor: ns-resize;
}

.magnifier-resize-handle.edge.bottom,.crop-handle.bottom {
  bottom: -4px;
  cursor: ns-resize;
}

.magnifier-resize-handle.edge.left,
.magnifier-resize-handle.edge.right,.crop-handle.right,.crop-handle.left{
  width: 8px;
  height: 40px;
  top: 50%;
  margin-top: -20px;
}

.magnifier-resize-handle.edge.left,.crop-handle.left{
  left: -4px;
  cursor: ew-resize;
}

.magnifier-resize-handle.edge.right,.crop-handle.right {
  right: -4px;
  cursor: ew-resize;
}




/* Range Slider Styling */
.range-input {
  width: 100%;
  height: 12px;
  max-width:220px;
  border-radius: 6px;
  background: #424242;
  outline: none;
  -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width:24px;
  height:24px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  -webkit-appearance: none;
  appearance: none;
  width:24px;
  height:24px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* Dim Overlay - shows what's outside the crop area */
#dim-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  pointer-events: none;
  z-index: 8;
  clip-path: polygon(
    0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
    var(--crop-left) var(--crop-top),
    var(--crop-left) var(--crop-bottom),
    var(--crop-right) var(--crop-bottom),
    var(--crop-right) var(--crop-top),
    var(--crop-left) var(--crop-top)
  );
}

/* Snap Guidelines */
#snap-guideline-vertical,
#snap-guideline-horizontal {
  position: absolute;
  background: #007aff;
  pointer-events: none;
  z-index: 20;
  opacity: 1;
  border-radius:3px;
}

#snap-guideline-vertical {
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  transform: translateX(-50%);
}

#snap-guideline-horizontal {
  left: 0;
  top: 50%;
  width: 100%;
  height: 2px;
  transform: translateY(-50%);
}

/* Crop Box */
#crop-box {
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#crop-box.no-transition {
  transition: none;
}

/* Hide crop handles when not selected */
#crop-box:not(.selected) .crop-handle {
  display: none;
}






/* Canvas (hidden) */
#canvas {
  display: none;
}



.group-header{
  padding:24px;
}
.toggle + label {
  position: relative;
  width: 49px;
  height: 28px;
  background-color: #424242;
  border-radius: 20px;
  transition: all 0.3s;
  text-indent:-1000px;
  overflow: hidden;
  cursor: pointer;
}
.toggle:disabled + label {
  opacity: 0.5;
  cursor: not-allowed;
}
.toggle + label::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius:50%;
  background-color: white;
  top: 2px;
  left: 2px;
  transition: all 0.3s;
}

.toggle:checked + label::after {
  left : 23px;
}
.toggle:checked + label {
  background-color: #007aff;
}
.toggle:disabled:checked + label {
  background-color: #007aff;
  opacity: 0.5;
}
.toggle {
  display : none;
}

.visually-hidden:not(:focus):not(:active) {
	border: 0;
	clip: rect(0 0 0 0); 
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap; 
	width: 1px;
}

fieldset{
  border:none;
}

.sig{ 
  font-size:13px;
  color:#949494;
  padding:24px;
  text-align:center;

}
.sig a{
  color:#949494;
  text-decoration:none
}
.sig a:hover{
  color:#C4C4C4;
}

/* Loading Spinner */
#loading-spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1000;
}

#loading-spinner p {
  color: #fff;
  font-size: 16px;
  margin-top: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Hide frame container during loading */
#frame-container.loading {
  opacity: 0;
  pointer-events: none;
}
.mobile-warning{
  display:none;
}
@media (max-width: 988px) {
 .preview-section{
  text-align: center;
  position: relative;
  margin:0;
  transform:none;
  top:auto;
  left:auto;
 }
 .sig{
  position: static;
  text-align:center;
  font-size:14px;
  padding:12px 0 42px 0;
  width:100%;
 }
 .controls-section{
  float:none;
  width:100%;
 }
 .multiple-options{
  display:none !important;
 }
 .mobile-warning{
  display:block;
  text-align:center;
  font-size:14px;
  color:#949494;
  background-color: #303030;
    border-radius: 28px;
    padding: 18px;
 }
 body,.control-group input[type="file"], .control-group select, .control-group .button {
  font-size:14px;
 }
.button-group-button,.control-group .button.blue-button{
  padding:12px 16px;
  font-size:13px;
}
 .form-section{
  padding: 18px;
  gap:14px;
 }
 .controls{
  gap:18px;
 }
 .controls-section{
  padding:16px;
 }
}

