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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%
}

body {
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  height: calc(var(--vh, 1vh) * 100);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  width: 100dvw;
  width: 100svw
}

#root {
  height: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  position: relative;
  width: 100%;
  width: 100vw;
  width: 100dvw;
  width: 100svw
}

:root {
  --vh: 1vh;
  --vw: 1vw;
  --vmin: 1vmin;
  --vmax: 1vmax
}

/* Orientation Guard */
.orientation-guard-container {
  position: relative;
  height: 100%
}

.orientation-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .45);
  z-index: 4000;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%)
}

.orientation-card {
  background: #fff;
  padding: 20px 24px;
  border-radius: 28px;
  box-shadow: 0 10px 30px #00000040;
  text-align: center;
  max-width: 90vw
}

.orientation-title {
  font-weight: 800;
  color: #333;
  margin-bottom: 8px;
  font-size: 20px
}

.orientation-text {
  color: #555;
  font-size: 14px;
  margin-bottom: 8px
}

.orientation-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center
}

.unified-rotation-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px
}

.rotation-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block
}

.landscape-rotation .rotation-image {
  animation: rotateToLandscape 2s ease-in-out infinite
}

@keyframes rotateToLandscape {
  0% {
    transform: rotate(0) scale(.9);
    opacity: .8
  }

  25% {
    transform: rotate(90deg) scale(1);
    opacity: 1
  }

  50% {
    transform: rotate(90deg) scale(1);
    opacity: 1
  }

  75% {
    transform: rotate(90deg) scale(1);
    opacity: 1
  }

  to {
    transform: rotate(0) scale(.9);
    opacity: .8
  }
}

@media (orientation: portrait) {
  /* Removed, using JS for better mobile support */
}

/* Model Viewer Root */
html,
body,
#root {
  max-height: 100dvh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important
}

body {
  position: static !important
}

.mv-root,
.mv-root * {
  box-sizing: border-box !important
}

.mv-root {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  width: 100vw;
  background: #0076BB;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  padding: 15px !important;
  max-height: 100vh !important;
  margin: 0 !important
}

.mv-content {
  flex: 1;
  background: #ffffff;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  position: relative;
  height: 100% !important;
  max-height: 100vh !important
}

/* Header */
.mv-header {
  position: relative;
  background: #ffffff00;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 101;
  min-height: clamp(60px, 12vmin, 80px);
  pointer-events: none
}

.mv-header>* {
  pointer-events: auto
}

.mv-logo-chip {
  background: #ffde01;
  padding: clamp(10px, 2vmin, 14px) clamp(14px, 2.5vmin, 18px);
  border-radius: 20px 0px 2ch;
  min-width: clamp(70px, 14vmin, 90px);
  min-height: clamp(24px, 5vmin, 32px);
  display: flex;
  align-items: center;
  justify-content: center
}

.mv-logo {
  height: clamp(24px, 5vmin, 32px);
  width: auto;
  min-height: 30px;
  min-width: 60px;
  filter: drop-shadow(0 2px 4px #0003)
}

.mv-title-section {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
  z-index: 102;
  pointer-events: auto;
  width: auto;
  min-width: clamp(120px, 25vmin, 180px)
}

/* Model Select Dropdown */
.mv-model-select-wrapper {
  position: relative;
  display: inline-block;
  min-width: clamp(120px, 25vmin, 180px);
  z-index: 103
}

.mv-model-select {
  font-weight: 700;
  color: #333;
  background: #ffffff;
  border: 2px solid #ffd400;
  border-radius: 12px;
  padding: clamp(8px, 1.5vmin, 12px) clamp(16px, 3vmin, 24px);
  cursor: pointer;
  outline: none;
  transition: all .2s ease;
  min-width: clamp(120px, 25vmin, 180px);
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.5vmin, 12px);
  position: relative
}

.mv-model-select:hover {
  border-color: #e6c200;
  background-color: #fffef0
}

.mv-model-select:focus {
  border-color: #ffd400;
  box-shadow: 0 0 0 3px #ffd40033
}

.mv-model-select span {
  flex: 1;
  text-align: center
}

.dropdown-trigger {
  /* Used in HTML but no specific styles in original CSS */
}

.mv-dropdown-arrow {
  flex-shrink: 0;
  transition: transform .2s ease
}

.mv-dropdown-arrow.open {
  transform: rotate(180deg)
}

.mv-model-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 2px solid #ffd400;
  border-radius: 12px;
  box-shadow: 0 4px 12px #00000026;
  overflow: hidden;
  z-index: 104;
  max-height: 150px;
  overflow-y: auto;
  animation: dropdownFadeIn .2s ease
}

@keyframes dropdownFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.mv-model-option {
  width: 100%;
  font-weight: 600;
  padding: clamp(10px, 2vmin, 14px) clamp(16px, 3vmin, 24px);
  background: #ffffff;
  color: #333;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all .2s ease;
  outline: none
}

.mv-model-option:last-child {
  border-bottom: none
}

.mv-model-option:hover {
  background-color: #fffef0;
  color: #0076bb
}

.mv-model-option.selected {
  background-color: #fffef0;
  color: #0076bb;
  font-weight: 700
}

.mv-model-option.selected svg {
  flex-shrink: 0;
  margin-left: 8px
}

.dropdown-item {
  /* Used in HTML but same as mv-model-option */
}

.selected {
  /* Used as modifier class, styles above */
}

/* Model Container */
.mv-model-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  isolation: isolate
}

.mv-model-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1
}

#canvas-container {
  /* Used in HTML but styles handled by mv-model-container */
}

/* Loader */
#loader {
  /* Used in HTML for loader functionality */
}

.mv-content.loading .mv-model-container canvas {
  filter: blur(10px) !important;
  -webkit-filter: blur(10px) !important
}

.mv-content.loading .mv-header,
.mv-content.loading .mv-footer,
.mv-root.loading .mv-button-container,
.mv-root.loading .mv-cc-btn {
  filter: blur(10px);
  -webkit-filter: blur(10px);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none
}

.spinner {
  /* Generic spinner class - adding common spinner styles */
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, .3);
  border-top: 4px solid #ffd400;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto
}

@keyframes spin {
  0% {
    transform: rotate(0)
  }

  to {
    transform: rotate(360deg)
  }
}

/* Rotation Indicator */
.mv-rotation-indicator {
  position: absolute;
  top: 50%;
  right: clamp(20px, 4vmin, 40px);
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none
}

/* Footer */
.mv-footer {
  background: #ffffff00;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 101;
  min-height: clamp(60px, 12vmin, 80px);
  position: absolute !important;
  pointer-events: none;
  bottom: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important
}

.mv-footer>* {
  pointer-events: auto
}

.mv-progress-section {
  align-items: center;
  gap: clamp(16px, 3vmin, 20px);
  margin-bottom: 15px;
  margin-left: 15px
}

.mv-step-label {
  font-size: clamp(16px, 3vmin, 20px);
  color: #333;
  font-weight: 600
}

.mv-progress-bar {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vmin, 14px)
}

#progress-bar {
  /* Used in HTML, styles handled by mv-progress-bar */
}

.progress-step {
  width: clamp(28px, 6vmin, 36px);
  height: clamp(28px, 6vmin, 36px);
  border-radius: 50%;
  background: #e0e0e0;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(14px, 3vmin, 16px);
  font-weight: 700;
  border: 2px solid #e0e0e0;
  position: relative;
  cursor: pointer;
  transition: all .2s ease
}

.progress-step:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px #0003
}

.progress-step.active {
  background: #ffd400;
  color: #333;
  border-color: #ffd400
}

.progress-step.active:hover {
  background: #e6c200;
  transform: scale(1.1)
}

.progress-step:not(:last-child):after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(8px, 1.5vmin, 10px);
  height: 2px;
  background: #e0e0e0
}

.active {
  /* Used as modifier class, styles above */
}

.mv-footer-right {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vmin, 16px);
  position: absolute;
  right: 31px;
  bottom: 20px;
  position: fixed
}

.mv-powered {
  font-size: clamp(12px, 2vmin, 14px);
  color: #666;
  white-space: nowrap
}

.help-btn {
  /* Generic help button styles */
}

.mv-help-btn {
  background: rgba(192, 192, 192, .686);
  color: #333;
  width: clamp(40px, 6vmin, 36px);
  height: clamp(40px, 6vmin, 36px);
  border-radius: 50%;
  border: none;
  font-size: clamp(14px, 3vmin, 16px);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0;
  margin-bottom: 0
}

.mv-help-btn:hover {
  background: #d0d0d0
}

/* Buttons */
.mv-button-container {
  position: absolute;
  top: clamp(20px, 4vmin, 32px);
  right: clamp(20px, 4vmin, 32px);
  display: flex;
  gap: 8px;
  z-index: 102
}

.mv-back-btn {
  background: rgba(192, 192, 192, .686);
  color: #000;
  border: none;
  padding: clamp(10px, 2vmin, 14px) clamp(14px, 2.5vmin, 18px);
  border-radius: 0 20px 20px 0;
  font-size: clamp(16px, 3vmin, 18px);
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  /* width: 100px; */
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center
}

.mv-Reset-btn {
  background: rgba(192, 192, 192, .686);
  color: #000;
  border: none;
  padding: clamp(10px, 2vmin, 14px) clamp(14px, 2.5vmin, 18px);
  border-radius: 20px 0 0 20px;
  font-size: clamp(16px, 3vmin, 18px);
  font-weight: 600;
  width: 100px;
  height: 40px;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center
}

.mv-cc-btn {
  position: absolute;
  right: 31px;
  bottom: 75px;
  background: rgba(192, 192, 192, .686);
  color: #000;
  border: none;
  width: clamp(40px, 6vmin, 36px);
  height: clamp(40px, 6vmin, 36px);
  border-radius: 50%;
  font-size: clamp(14px, 3vmin, 16px);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 102;
  transition: all .2s ease
}

.mv-Reset-btn:hover,
.mv-back-btn:hover {
  background: rgba(0, 0, 0, .4);
  transform: translateY(-1px)
}

/* Instruction Overlay */
#instruction-overlay {
  /* Used in HTML for instruction display */
}

#instruction-text {
  /* Used in HTML for instruction text */
}

/* Dropdown */
#dropdown {
  /* Used in HTML for dropdown functionality */
}

#current-mode {
  /* Used in HTML for current mode display */
}

/* Media Queries for specific devices */
@media (max-width: 375px) and (max-height: 667px) {

  .mv-back-btn,
  .mv-Reset-btn {
    height: 32px !important;
    font-size: 12px !important;
    width: 70px !important
  }

  .mv-cc-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 10px !important
  }
}

@media (min-width: 375px) and (max-width: 375px) and (min-height: 812px) and (max-height: 812px) {

  .mv-back-btn,
  .mv-Reset-btn {
    height: 34px !important;
    font-size: 13px !important;
    width: 75px !important
  }

  .mv-cc-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 11px !important
  }
}

@media (min-width: 390px) and (max-width: 390px) and (min-height: 844px) and (max-height: 844px) {

  .mv-back-btn,
  .mv-Reset-btn {
    height: 36px !important;
    font-size: 14px !important;
    width: 80px !important
  }

  .mv-cc-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 12px !important
  }
}

@media (min-width: 428px) and (max-width: 428px) and (min-height: 926px) and (max-height: 926px) {

  .mv-back-btn,
  .mv-Reset-btn {
    height: 40px !important;
    font-size: 18px !important;
    width: 90px !important
  }

  .mv-cc-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important
  }
}

@media (min-width: 393px) and (max-width: 393px) and (min-height: 852px) and (max-height: 852px) {

  .mv-back-btn,
  .mv-Reset-btn {
    height: 38px !important;
    font-size: 16px !important;
    width: 85px !important
  }

  .mv-cc-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 14px !important
  }
}

@media (min-width: 430px) and (max-width: 430px) and (min-height: 932px) and (max-height: 932px) {

  .mv-back-btn,
  .mv-Reset-btn {
    height: 42px !important;
    font-size: 20px !important;
    width: 94px !important
  }

  .mv-cc-btn {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important
  }
}

@media (display-mode: standalone) {
  .mv-root {
    overflow: hidden !important;
    position: relative !important
  }

  .mv-content {
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important
  }
}

@media (orientation: portrait) {
  .mv-root {
    padding: 6px
  }

  .mv-header {
    padding: clamp(12px, 2.5vmin, 20px) clamp(16px, 3vmin, 24px);
    flex-direction: column;
    gap: clamp(12px, 2vmin, 16px);
    align-items: flex-start
  }

  .mv-title-section {
    position: static;
    transform: none;
    align-self: center;
    text-align: center
  }

  .mv-footer {
    flex-direction: column;
    gap: clamp(12px, 2vmin, 16px);
    align-items: flex-start
  }

  .mv-footer-right {
    align-self: flex-end
  }

  .mv-button-container {
    top: clamp(24px, 3vmin, 24px);
    right: clamp(28px, 3vmin, 24px)
  }
}

@media (max-width: 480px) {
  .mv-root {
    padding: 4px !important
  }

  .mv-header {
    padding: clamp(10px, 2vmin, 16px) clamp(12px, 2.5vmin, 20px)
  }

  .mv-button-container {
    top: clamp(12px, 2.5vmin, 20px);
    right: clamp(12px, 2.5vmin, 20px);
    gap: 6px
  }

  .mv-back-btn,
  .mv-Reset-btn {
    padding: clamp(8px, 1.5vmin, 12px) clamp(10px, 2vmin, 14px);
    font-size: clamp(12px, 2.5vmin, 16px);
    width: 80px;
    height: 36px
  }

  .mv-cc-btn {
    right: 12px;
    bottom: 50px;
    width: clamp(20px, 4vmin, 28px);
    height: clamp(20px, 4vmin, 28px);
    font-size: clamp(10px, 2vmin, 14px)
  }

  .mv-progress-section {
    gap: clamp(8px, 1.5vmin, 12px)
  }

  .mv-progress-bar {
    gap: clamp(6px, 1vmin, 10px)
  }

  .progress-step,
  .mv-help-btn {
    width: clamp(20px, 4vmin, 28px);
    height: clamp(20px, 4vmin, 28px);
    font-size: clamp(10px, 2vmin, 14px)
  }
}

@media (max-width: 768px) {
  .mv-model-select-wrapper {
    position: relative
  }

  .mv-title-section {
    position: absolute;
    left: 50%;
    transform: translate(-50%);
    width: auto
  }
}

@media (orientation: landscape) {
  .mv-button-container {
    top: clamp(24px, 3vmin, 24px);
    right: clamp(28px, 3vmin, 24px)
  }
}

.mv-finish-section {
  display: none;
}


.mv-finish-section {
  position: fixed;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 102;
  bottom: 3px
}

.mv-finish-btn {
  background: #ffd400;
  color: #0b2250;
  border: 3px solid #ffffff;
  box-shadow: 0 8px 8px #00000078;
  padding: clamp(8px, 1.8vmin, 12px) clamp(16px, 3.5vmin, 24px);
  border-radius: 999px;
  font-size: clamp(16px, 2.2vmin, 16px);
  font-weight: 700;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 2px 8px #ffd4004d
}

.mv-finish-btn:hover {
  background: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px #ffd40066
}

.mv-finish-btn:active {
  transform: translateY(0)
}