/* Custom Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "MotoSans", Ubuntu, Cantarell, sans-serif !important;
  background: linear-gradient(180deg, #030303 0%, #1a241d 50%, #3c4a3c 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.page-container {
  position: relative;
  min-height: 100vh;
  width: 100%;
}

/* Motorola Logo */
.motorola-logo {
  width: 200px;
  height: 50px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
}

div#signature-preview-step5 {
  color: #fff !important;
  padding-top: 11px;
  font-weight: 500;
}

.motorola-logo-small {
  width: 100px;
  height: 40px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
}

/* Phone Visual */
.phone-visual {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2d5016 0%, #1a3009 100%);
  border-radius: 30px;
  position: relative;
  transform: rotate(-15deg) translateX(-20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.phone-visual::before {
  content: "";
  position: absolute;
  top: 20%;
  left: 20%;
  width: 60%;
  height: 40%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
}

.phone-visual::after {
  content: "";
  position: absolute;
  top: 25%;
  left: 25%;
  width: 8%;
  height: 8%;
  background: #84cc16;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #84cc16, 15% 0 0 0 #84cc16, 30% 0 0 0 #84cc16,
    7.5% 15% 0 0 #84cc16;
}

/* Lime Green Wave */
/* .lime-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
    clip-path: ellipse(120% 100% at 50% 100%);
    z-index: 1;
    opacity: 0.8;
} */

/* Preview Container */

.preview-container {
  /* width: auto;
  height: auto;
  max-width: min(85vw, 600px);
  Default to vertical ratio: 800/1200 = 2/3 */
  max-height: calc(100vh - 330px);
  aspect-ratio: 2/3;
  border: 1px solid #ffffff;
  /* position: relative;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0px;
  
  padding: 5px;
  display: flex;
  flex-direction: column; */
  overflow: hidden;
}

.preview-container img:not(.motorola-logo-small) {
  height: auto !important;
}

.preview-text {
  background: linear-gradient(90deg, #667a2e 0%, #b7d354 100%);
  padding: 8px 10px;
}

.pic-img {
  margin-top: -44px;
}
.pic-img img {
  position: inherit !important;
  width: 77px !important;
}

/* Ensure images fill container properly in vertical layout */
.preview-container[style*="aspect-ratio: 2/3"] {
  min-width: 200px;
}

/* Desktop-specific styling for vertical layout */
@media (min-width: 769px) {
  .preview-container[style*="aspect-ratio: 2/3"] {
    max-width: 250px;
    width: min(30vw, 250px) !important;
  }
}

/* Responsive sizing based on viewport */
@media (max-width: 768px) {
  .preview-container {
    max-width: min(90vw, 500px);
    max-height: calc(100vh - 250px);
  }

  .preview-container[style*="aspect-ratio: 2/3"] {
    width: min(80vw, 300px) !important;
    max-width: min(80vw, 300px) !important;
  }
}

/* Background image only - exclude logo images */
.preview-container img:not(.motorola-logo-small) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
}

.preview-container > div:not(#final-preview-loader) {
  position: relative;
  z-index: 2;
  border-radius: 0px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.preview-text {
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); */
  z-index: 3;
  min-height: auto;
  height: auto;
}

/* Responsive text sizing based on container - scales with zoom */
.preview-text {
  font-size: clamp(0.5rem, 1.5vw, 0.75rem);
}

.preview-text div,
.preview-text p {
  line-height: 1.2;
}

/* #custom-text-preview-step1,
#custom-text-preview-step2,
#custom-text-preview-step3,
#custom-text-preview-step4,
#custom-text-preview-step5 {
  font-size: clamp(0.4rem, 1.8vw, 0.65rem) !important;
  line-height: 1.3;
} */

#signature-preview-step1,
#signature-preview-step2,
#signature-preview-step3,
#signature-preview-step4,
#signature-preview-step5 {
  font-size: clamp(0.7rem, 2.2vw, 0.9rem) !important;
  line-height: 1.2;
}

#preview-disclaimer-step1,
#preview-disclaimer-step2,
#preview-disclaimer-step3,
#preview-disclaimer-step4,
#preview-disclaimer-step5 {
  font-size: clamp(0.25rem, 1.2vw, 0.4rem) !important;
  line-height: 1.4;
  word-wrap: break-word;
}

.preview-text div {
  /* margin-bottom: 8px; */
  font-weight: 500;
  font-size: 14px !important;
  line-height: 1.4;
}

#final-canvas .preview-text div {
  height: 40px;
  line-height: 2;
}

#final-canvas img {
  position: absolute !important;
  top: 0 !important;
}

/* Selected States */
.orientation-btn.selected > div,
.color-btn.selected > div {
  border-color: #84cc16 !important;
  border-width: 3px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .lime-wave {
    height: 30%;
  }

  .phone-visual {
    transform: rotate(-10deg) translateX(-10px) scale(0.8);
  }

  h2 {
    font-size: 1.5rem !important;
  }

  .preview-container {
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .lime-wave {
    height: 25%;
  }

  .phone-visual {
    transform: rotate(-5deg) scale(0.6);
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-container:not(.hidden) {
  animation: fadeIn 0.5s ease-in-out;
}

/* Button Hover Effects */
.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Canvas Styling */
#final-canvas {
  max-width: 100%;
  height: auto;
  /* border-radius: 10px; */
}

/* AR Camera Styling */
#ar-camera-container {
  position: relative;
  max-width: 100%;
}

#ar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  /* border-radius: 8px; */
}

#ar-canvas {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

#ar-phone-overlay {
  transition: transform 0.1s ease-out, opacity 0.2s ease-out;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.ar-phone-overlay img {
  width: 180px !important; /* set the exact size you want */
  max-width: 180px !important;
  height: auto !important;
  object-fit: contain !important;

  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  display: block !important;

  /* Safari-specific fix */
  -webkit-transform: translateX(-50%);
  -webkit-user-drag: none;
}

.figer-btn-ct {
  margin: auto;
  max-width: 20% !important;
}

.signature-text {
  white-space: nowrap;
  width: 62px;
  overflow: hidden;
  font-size: 12px !important;
  text-overflow: ellipsis;
}

#finger-status {
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* AR Camera Controls */
#ar-camera-container button {
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive AR Camera */
@media (max-width: 768px) {
  #ar-video,
  #ar-canvas {
    max-width: 100%;
  }

  .figer-btn-ct {
    margin: auto;
    max-width: 100% !important;
  }

  #ar-phone-overlay {
    width: 18px !important;
  }
}

/* Upload Options Cards */
.upload-option-card {
  transition: all 0.3s ease;
}

.upload-option-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Button Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

.upload-btn {
  position: relative;
  overflow: hidden;
}

.upload-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.upload-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* File Selected Status */
#file-selected {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Final Preview Loader */
#final-preview-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

#final-preview-loader .animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

#final-preview-img {
  transition: opacity 0.3s ease-in;
}
