﻿/**
 * WearAI Frontend Styles
 * 
 * @package WearAI
 * @version 1.0.0
 * @author WearAI
 * @license GPL-2.0-or-later
 * 
 * Stylesheet for virtual try-on modal and UI elements.
 * 
 * Structure:
 * 1. CSS Variables
 * 2. Modal & Popup Base Styles
 * 3. Camera & Upload Interface
 * 4. Loading & Progress States
 * 5. Results & Before/After Slider
 * 6. Gallery Selection
 * 7. Buttons & Interactive Elements
 * 8. Animations & Transitions
 * 9. Responsive Design
 */

/* ========================================
   1. CSS Variables - Brand Customization
   ======================================== */
:root {
  --wearai-brand: #4338ca;
  /* WearAI Indigo - Primary */
  --wearai-brand-hover: #a41bee;
  /* Brand Purple - Hover */
  --wearai-brand-light: rgba(67, 56, 202, 0.1);
  /* Indigo tint */
  --wearai-accent: #3b82f6;
  /* Electric Blue - Accent */
  --wearai-bg-dark: #030712;
  /* Midnight Void - Background */
  --wearai-text-white: #f9fafb;
  /* Text White - Headings */
  --wearai-text-grey: #9ca3af;
  /* Text Grey - Body */
  --wearai-glass: rgba(255, 255, 255, 0.05);
  /* Glass White - Cards */
  --wearai-success: #10b981;
  /* Verified Green */
  --wearai-error: #ef4444;
  /* Error Red */
}

/* ========================================
   2. Modal & Popup Base Styles with Animations
   ======================================== */
#wearai-popup {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transition: visibility 0.3s, opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2147483647 !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.popup-content {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease-out;
}

/* This is the state when the popup is HIDDEN */
.popup-hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.popup-hidden .popup-content {
  transform: scale(0.92) translateY(-20px);
  opacity: 0;
}

/* This is the state when the popup is VISIBLE */
#wearai-popup:not(.popup-hidden) {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  animation: fadeInBackdrop 0.3s ease-out;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(3, 7, 18, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

#wearai-popup:not(.popup-hidden) .popup-content {
  transform: scale(1) translateY(0) !important;
  opacity: 1 !important;
  animation: popupSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Popup open animation */
@keyframes fadeInBackdrop {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes popupSlideIn {
  from {
    transform: scale(0.92) translateY(-20px);
    opacity: 0;
  }

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

/* Shimmer effect for product page button */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Product page "Try It On" button styling - Stronger specificity for live site */
.wearai-button,
button.wearai-button,
a.wearai-button,
#wearai-open {
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
}

.wearai-button::before,
button.wearai-button::before,
a.wearai-button::before,
#wearai-open::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.3) 50%,
      rgba(255, 255, 255, 0) 100%) !important;
  transform: translateX(-100%) !important;
  transition: transform 0s !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

.wearai-button:hover::before,
button.wearai-button:hover::before,
a.wearai-button:hover::before,
#wearai-open:hover::before {
  animation: shimmer 0.8s ease-in-out !important;
}

.wearai-button:hover,
button.wearai-button:hover,
a.wearai-button:hover,
#wearai-open:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.1) !important;
  box-shadow: 0 6px 16px -2px rgba(124, 58, 237, 0.4) !important;
}

/* Fallback styles for Tailwind classes (in case Tailwind doesn't load) */
#wearai-popup .flex {
  display: flex !important;
}

#wearai-popup .inline-flex {
  display: inline-flex !important;
}

#wearai-popup .flex-col {
  flex-direction: column !important;
}

#wearai-popup .flex-row {
  flex-direction: row !important;
}

#wearai-popup .items-center {
  align-items: center !important;
}

#wearai-popup .justify-center {
  justify-content: center !important;
}

#wearai-popup .justify-between {
  justify-content: space-between !important;
}

#wearai-popup .gap-1\.5 {
  gap: 0.375rem !important;
}

#wearai-popup .gap-2 {
  gap: 0.5rem !important;
}

#wearai-popup .gap-2\.5 {
  gap: 0.625rem !important;
}

#wearai-popup .gap-3 {
  gap: 0.75rem !important;
}

#wearai-popup .gap-4 {
  gap: 1rem !important;
}

#wearai-popup .gap-6 {
  gap: 1.5rem !important;
}

#wearai-popup .hidden {
  display: none !important;
}

#wearai-popup .block {
  display: block !important;
}

#wearai-popup .relative {
  position: relative !important;
}

#wearai-popup .absolute {
  position: absolute !important;
}

#wearai-popup .w-4 {
  width: 1rem !important;
}

#wearai-popup .w-5 {
  width: 1.25rem !important;
}

#wearai-popup .w-full {
  width: 100% !important;
}

#wearai-popup .h-4 {
  height: 1rem !important;
}

#wearai-popup .h-5 {
  height: 1.25rem !important;
}

#wearai-popup .p-4 {
  padding: 1rem !important;
}

#wearai-popup .p-6 {
  padding: 1.5rem !important;
}

#wearai-popup .px-4 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

#wearai-popup .py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

#wearai-popup .py-3 {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

#wearai-popup .py-3\.5 {
  padding-top: 0.875rem !important;
  padding-bottom: 0.875rem !important;
}

#wearai-popup .pt-2 {
  padding-top: 0.5rem !important;
}

#wearai-popup .mt-4 {
  margin-top: 1rem !important;
}

#wearai-popup .mt-6 {
  margin-top: 1.5rem !important;
}

#wearai-popup .mb-1 {
  margin-bottom: 0.25rem !important;
}

#wearai-popup .mb-2 {
  margin-bottom: 0.5rem !important;
}

#wearai-popup .mb-3 {
  margin-bottom: 0.75rem !important;
}

#wearai-popup .mb-4 {
  margin-bottom: 1rem !important;
}

#wearai-popup .text-xs {
  font-size: 0.75rem !important;
  line-height: 1rem !important;
}

#wearai-popup .text-sm {
  font-size: 0.875rem !important;
  line-height: 1.25rem !important;
}

#wearai-popup .text-base {
  font-size: 1rem !important;
  line-height: 1.5rem !important;
}

#wearai-popup .text-lg {
  font-size: 1.125rem !important;
  line-height: 1.75rem !important;
}

#wearai-popup .text-xl {
  font-size: 1.25rem !important;
  line-height: 1.75rem !important;
}

#wearai-popup .font-medium {
  font-weight: 500 !important;
}

#wearai-popup .font-semibold {
  font-weight: 600 !important;
}

#wearai-popup .font-bold {
  font-weight: 700 !important;
}

#wearai-popup .text-center {
  text-align: center !important;
}

#wearai-popup .text-gray-400 {
  color: #9ca3af !important;
}

#wearai-popup .text-gray-500 {
  color: #6b7280 !important;
}

#wearai-popup .text-gray-600 {
  color: #4b5563 !important;
}

#wearai-popup .text-gray-700 {
  color: #374151 !important;
}

#wearai-popup .text-gray-800 {
  color: #1f2937 !important;
}

#wearai-popup .text-gray-900 {
  color: #111827 !important;
}

#wearai-popup .text-white {
  color: #ffffff !important;
}

#wearai-popup .bg-gray-50 {
  background-color: #f9fafb !important;
}

#wearai-popup .bg-gray-200 {
  background-color: #e5e7eb !important;
}

#wearai-popup .bg-white {
  background-color: #ffffff !important;
}

#wearai-popup .border-2 {
  border-width: 2px !important;
}

#wearai-popup .border-dashed {
  border-style: dashed !important;
}

#wearai-popup .border-gray-200 {
  border-color: #e5e7eb !important;
}

#wearai-popup .rounded-xl {
  border-radius: 0.75rem !important;
}

#wearai-popup .rounded-lg {
  border-radius: 0.5rem !important;
}

#wearai-popup .cursor-pointer {
  cursor: pointer !important;
}

#wearai-popup .transition-all {
  transition: all 0.3s !important;
}

#wearai-popup .transition-colors {
  transition: color 0.15s, background-color 0.15s !important;
}

#wearai-popup .duration-150 {
  transition-duration: 0.15s !important;
}

#wearai-popup .duration-300 {
  transition-duration: 0.3s !important;
}

#wearai-popup .shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

#wearai-popup .shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* Progress Bar Animation */
.progress-bar-inner {
  transition: width 4s ease-in-out;
}

/* Dropzone Drag-Over State */
.dropzone.is-dragging {
  border-color: var(--wearai-brand) !important;
  background-color: var(--wearai-brand-light) !important;
}

.dropzone.is-dragging svg {
  transform: scale(1.1);
}

/* Before/After Slider */
.slider-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: .75rem;
  aspect-ratio: 1;
  background: #f8fafc;
}

.slider-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: translateZ(0);
  will-change: auto;
}

.slider-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: width .15s ease-out;
}

.slider-base {
  position: absolute;
  inset: 0;
}

.resizer {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  cursor: ew-resize;
  z-index: 10;
  transition: left .15s ease-out;
}

.resizer-button {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(77, 77, 227, 0.2);
  border: 1px solid rgba(77, 77, 227, 0.1);
}

.resizer-button svg {
  width: 20px;
  height: 20px;
  color: #374151;
}

/* Loader message transitions with blur effect */
.loader-status {
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader-message {
  display: none !important;
  position: absolute !important;
  top: 50% !important;
  left: 0 !important;
  right: 0 !important;
  transform: translateY(-50%) !important;
  white-space: nowrap !important;
  text-align: center !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #111827 !important;
  pointer-events: none !important;
  opacity: 0 !important;
  filter: blur(0px) !important;
  transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out !important;
}

.loader-message.active {
  display: block !important;
  opacity: 1 !important;
  filter: blur(0px) !important;
}

.loader-message.exiting {
  opacity: 0 !important;
  visibility: visible !important;
  transform: translateY(calc(-50% - 10px)) !important;
  filter: blur(5px) !important;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.3s !important;
}

/* Shimmer loading bar */
.shimmer-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 9999px;
  background: #c7d2fe;
  /* indigo-200 */
  overflow: hidden;
}

.shimmer {
  position: absolute;
  top: 0;
  left: -40%;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0), rgba(99, 102, 241, .45), rgba(99, 102, 241, 0));
  animation: shimmer-slide 1.25s linear infinite;
}

@keyframes shimmer-slide {
  0% {
    left: -40%;
  }

  100% {
    left: 100%;
  }
}

/* Loading preview image */
.loading-image-preview {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #f9fafb;
}

.loading-preview-img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  display: block;
}

.image-shimmer {
  position: absolute;
  top: 0;
  left: -40%;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .65), rgba(255, 255, 255, 0));
  animation: shimmer-slide 1.25s linear infinite;
}

/* Single result image */
.result-image-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.result-image {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
}

/* New try-on image container - Absolutely fixed size */
.tryon-image-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
  min-height: 400px !important;
  max-height: 400px !important;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #eee url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" fill-opacity=".25"><rect x="200" width="200" height="200" /><rect y="200" width="200" height="200" /></svg>');
  background-size: 35px 35px;
  padding: 6px;
  position: relative;
  box-sizing: border-box !important;
  flex-shrink: 0;
  flex-grow: 0;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s ease;
}

.tryon-image-container:hover {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.06);
}

.tryon-image-container img {
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border-radius: 12px;
  transition: opacity 0.3s ease;
  opacity: 0;
  animation: fadeInImage 0.4s ease forwards;
  flex-shrink: 0;
}

@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Ensure all image types respect the container */
.tryon-image-container img.portrait,
.tryon-image-container img.landscape,
.tryon-image-container img.square {
  object-fit: contain !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

/* Loading shimmer animation for uploaded image */
.tryon-image-container.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.1) 0%,
      rgba(255, 255, 255, 0.3) 50%,
      rgba(255, 255, 255, 0.1) 100%);
  border-radius: 16px;
  z-index: 1;
}

.tryon-image-container.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.6) 50%,
      rgba(255, 255, 255, 0) 100%);
  animation: shimmer-loading 2s infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes shimmer-loading {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* Loading state image styling - subtle pulse animation without blur */
.tryon-image-container.loading img,
#wearai-loading-preview {
  filter: brightness(0.98);
  animation: pulseRotate 3s ease-in-out infinite;
  display: block !important;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  opacity: 1 !important;
}

@keyframes pulseRotate {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    filter: brightness(0.98);
  }

  50% {
    transform: scale(1.02) rotate(0.5deg);
    filter: brightness(1);
  }
}

/* Upload button inside dropzone */
.wearai-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--wearai-brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(77, 77, 227, 0.25);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.wearai-upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(77, 77, 227, 0.35);
}

/* Icon Toggle Styling - Button Group */
.icon-toggle-group {
  display: flex;
  gap: 0;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(77, 77, 227, 0.15);
  width: fit-content;
  margin: 0 auto;
}

.icon-toggle-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  background-color: #fff;
  transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  border-radius: 0;
  margin: 0;
}

.icon-toggle-button:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.icon-toggle-button:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-left: none;
}

.icon-toggle-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(77, 77, 227, 0.2);
  z-index: 1;
}

.icon-toggle-button.active {
  background: var(--wearai-brand);
  border-color: var(--wearai-brand);
  box-shadow: none;
  z-index: 2;
}

.icon-toggle-button.active .icon-toggle-svg {
  stroke: #fff;
}

.icon-toggle-button.active .icon-toggle-label {
  color: #fff;
}

.icon-toggle-button.inactive {
  background-color: #fff;
  border-color: rgba(77, 77, 227, 0.15);
}

.icon-toggle-button.inactive .icon-toggle-svg {
  stroke: #6B7280;
}

.icon-toggle-button.inactive .icon-toggle-label {
  color: #6B7280;
}

.icon-toggle-svg {
  width: 14px;
  height: 14px;
  transition: stroke .2s ease-in-out;
}

.icon-toggle-label {
  font-size: 11px;
  font-weight: 600;
  transition: color .2s ease-in-out;
}

/* Custom animation for scrolling blur text - with emojis */
@keyframes blur-scroll {
  0% {
    filter: blur(4px);
    transform: translateY(0);
    opacity: 0.5;
  }

  25% {
    filter: blur(2px);
    opacity: 1;
  }

  75% {
    filter: blur(2px);
    opacity: 1;
  }

  100% {
    filter: blur(4px);
    transform: translateY(-100%);
    opacity: 0;
  }
}

.blur-text-animate {
  animation: blur-scroll 2.5s infinite ease-in-out;
}

.blur-text-item {
  margin: 6px 0;
}

/* Popup Content Wrapper - Constrained Container */
#wearai-popup-content {
  max-width: 448px !important;
  /* Fixed pixel width for consistency across all themes (28rem = 448px) */
  width: 100% !important;
  max-height: 95vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* Scrollable content area inside popup */
#wearai-popup-content>div[style*="overflow-y"] {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#wearai-popup-content>div[style*="overflow-y"]::-webkit-scrollbar {
  width: 6px;
}

#wearai-popup-content>div[style*="overflow-y"]::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

#wearai-popup-content>div[style*="overflow-y"]::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

#wearai-popup-content>div[style*="overflow-y"]::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modal Backdrop - Legacy support */
.wearai-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wearai-modal-content {
  position: relative;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
}

/* Close Button - Square Container */
#wearai-close-btn {
  position: absolute !important;
  top: 16px !important;
  right: 16px !important;
  left: auto !important;
  border: none;
  transition: all 0.2s ease;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  aspect-ratio: 1 / 1 !important;
  z-index: 1000 !important;
}

#wearai-close-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  border: none !important;
  transform: rotate(90deg);
}

/* Main Content Area */
.wearai-main-content {
  padding: 32px !important;
}

/* Mode Toggle */
.wearai-mode-toggle {
  display: flex;
  gap: 2px;
  padding: 2px;
  background-color: #f1f5f9;
  border-radius: 6px;
  margin-bottom: 20px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.wearai-mode-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
}

.wearai-mode-btn.active {
  background-color: white;
  color: var(--wearai-brand);
  box-shadow: 0 1px 3px rgba(77, 77, 227, 0.2);
}

.wearai-mode-btn.inactive {
  color: #64748b;
  background-color: transparent;
}

.wearai-mode-btn.inactive:hover {
  transform: translateY(-1px);
}

/* Camera Container - Same size as try-on container */
.wearai-camera-container {
  position: relative;
  background: #f8fafc;
  border-radius: 20px !important;
  overflow: hidden !important;
  width: 100% !important;
  height: 500px !important;
  min-height: 500px !important;
  max-height: 70vh !important;
  margin-bottom: 20px;
  border: 1px solid rgba(77, 77, 227, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
}

.wearai-camera-video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  transform: scale(1.1) !important;
  border-radius: 0.75rem;
  /* Match parent rounded-xl */
  display: block !important;
  background: #000;
  position: absolute;
  top: 0;
  left: 0;
}

/* Upload Area */
.wearai-upload-area {
  border: 1px dashed rgba(77, 77, 227, 0.25);
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #f8fafc;
  aspect-ratio: 4/3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wearai-upload-area:hover {
  border-color: var(--wearai-brand);
  background-color: var(--wearai-brand-light);
}

.wearai-upload-area.dragover {
  border-color: var(--wearai-brand);
  background-color: var(--wearai-brand-light);
}

.wearai-upload-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  background: #e0e7ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wearai-upload-title {
  font-size: 16px;
  font-weight: 600;
  color: #334155;
  margin: 0 0 6px 0;
}

.wearai-upload-desc {
  color: #64748b;
  font-size: 13px;
  margin: 0 0 4px 0;
}

.wearai-upload-formats {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}

/* Terms */
.wearai-terms {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(77, 77, 227, 0.15);
}

.wearai-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--wearai-brand);
  margin-top: 2px;
}

.wearai-terms-text {
  flex: 1;
}

.wearai-terms-label {
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin: 0 0 2px 0;
  line-height: 1.4;
}

.wearai-terms-privacy {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.3;
}

.wearai-terms-link {
  color: var(--wearai-brand);
  text-decoration: underline;
  font-weight: 500;
}

.wearai-terms-link:hover {
  color: #6d28d9;
}

/* Primary Button */
.wearai-btn-primary {
  padding: 12px 24px;
  background: var(--wearai-brand);
  color: white;
  font-weight: 500;
  font-size: 14px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(77, 77, 227, 0.25);
  transform: scale(1);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wearai-btn-primary:hover {
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.35);
  transform: translateY(-1px);
}

.wearai-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(1);
  background: #94a3b8;
}

/* Result Container */
.wearai-result-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .wearai-result-container {
    grid-template-columns: 1fr 1fr;
  }
}

.wearai-image-container {
  width: 100% !important;
  height: 500px !important;
  max-height: 60vh !important;
  margin: 24px 0 !important;
  padding: 8px !important;
  background: #000 !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.wearai-image {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  transition: transform 0.3s ease;
}

.wearai-image-container:hover .wearai-image {
  transform: scale(1.02);
}

.wearai-image-label {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
  text-align: center;
}

/* Coupon Container */
.wearai-coupon-container {
  display: flex !important;
  width: 100% !important;
  margin: 20px 0 !important;
  background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 50%, #fef3c7 100%) !important;
  background-size: 200% 200% !important;
  animation: golden-shimmer 3s ease infinite !important;
  border: 1px solid rgba(217, 119, 6, 0.3) !important;
  padding: 16px 20px !important;
  gap: 0 !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.2) !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: space-between !important;
}

@keyframes golden-shimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.wearai-coupon-container::after {
  content: '✨' !important;
  position: absolute !important;
  right: 10px !important;
  top: 10px !important;
  font-size: 12px !important;
  animation: sparkle 2s infinite !important;
}

@keyframes sparkle {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.wearai-coupon-container:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-1px) !important;
}

/* Coupon Header Section */
.wearai-coupon-container .flex.items-center.gap-2.mb-1 {
  margin-bottom: 4px !important;
  /* Reduced gap between title and subtitle */
}

/* Coupon Icon */
.wearai-coupon-icon {
  color: var(--wearai-brand) !important;
  stroke: var(--wearai-brand) !important;
  width: 16px !important;
  height: 16px !important;
}

/* Coupon Title */
.wearai-coupon-container h5 {
  font-size: 17px !important;
  font-weight: 700 !important;
  color: #1f2937 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

/* Coupon Subtitle */
.wearai-coupon-container p {
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #6b7280 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}

/* Coupon Code and Button Container */
.wearai-coupon-container .flex.items-center.gap-3 {
  gap: 12px !important;
  /* Consistent spacing */
  align-items: center !important;
}

/* Coupon Code Styling */
.wearai-coupon-code {
  background: white !important;
  border: 2px dashed var(--wearai-brand) !important;
  color: #1f2937 !important;
  padding: 10px 16px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  line-height: 1 !important;
  height: auto !important;
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.2s ease !important;
  cursor: text !important;
  user-select: all !important;
}

.wearai-coupon-code:hover {
  transform: scale(1.02) !important;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.15) !important;
  border-color: var(--wearai-brand-dark, #4f46e5) !important;
}

/* Copy Coupon Button */
.wearai-copy-btn {
  background: var(--wearai-brand) !important;
  color: white !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding: 10px 18px !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  height: auto !important;
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-width: 90px !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.25) !important;
}

.wearai-copy-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(77, 77, 227, 0.4) !important;
  background: var(--wearai-brand-dark, #4f46e5) !important;
}

.wearai-copy-btn:active {
  transform: translateY(0) scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(77, 77, 227, 0.3) !important;
}

/* Copy button icon */
.wearai-copy-btn svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0 !important;
}

/* Generic Brand Button */
.wearai-brand-btn {
  background: var(--wearai-brand) !important;
  color: white !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
}

.wearai-brand-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.3) !important;
}

/* Initial State Content - Reduce spacing from header */
#wearai-initial-state .p-6.pt-2,
#wearai-camera-view.p-6.pt-2 {
  padding-top: 0.5rem !important;
  /* Reduced from pt-2 (0.5rem) to 0.5rem */
  padding-bottom: 1rem !important;
  /* Reduced from p-6 (1.5rem) */
}

#wearai-initial-state>div:first-child {
  padding-top: 0.75rem !important;
  /* Reduce spacing of toggle buttons from header */
  padding-bottom: 0.75rem !important;
}

/* Result State - No Scrollbar */
#wearai-result-state {
  overflow: hidden !important;
  -ms-overflow-style: none !important;
  /* IE and Edge */
  scrollbar-width: none !important;
  /* Firefox */
}

#wearai-result-state::-webkit-scrollbar {
  display: none !important;
  /* Chrome, Safari and Opera */
}

/* Action Buttons Container - Equal width buttons */
#wearai-result-state .flex.items-center.justify-center.gap-6.mt-4 {
  margin-top: 16px !important;
  display: flex !important;
  width: 100% !important;
  gap: 12px !important;
  justify-content: space-between !important;
}

/* Clean Action Buttons - Download, Share, Try Again */
#wearai-download,
#wearai-share,
#wearai-try-again {
  flex: 1 !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  border-radius: 12px !important;
  backdrop-filter: blur(5px) !important;
}

#wearai-download {
  color: #10b981 !important;
  /* Emerald */
  border-color: rgba(16, 185, 129, 0.2) !important;
}

#wearai-share {
  color: #3b82f6 !important;
  /* Blue */
  border-color: rgba(59, 130, 246, 0.2) !important;
}

#wearai-try-again {
  color: #f59e0b !important;
  /* Amber */
  border-color: rgba(245, 158, 11, 0.2) !important;
}

#wearai-download:hover {
  background: rgba(16, 185, 129, 0.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

#wearai-share:hover {
  background: rgba(59, 130, 246, 0.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2) !important;
}

#wearai-try-again:hover {
  background: rgba(245, 158, 11, 0.1) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2) !important;
}

#wearai-download:hover,
#wearai-share:hover,
#wearai-try-again:hover {
  color: var(--wearai-brand) !important;
  transform: translateY(-1px) !important;
}

#wearai-download svg,
#wearai-share svg,
#wearai-try-again svg {
  width: 14px !important;
  height: 14px !important;
  transition: color 0.2s ease !important;
}

/* Add to Cart Button */
/* Add to Cart Button */
.wearai-add-to-cart-btn {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  color: white !important;
  font-weight: 800 !important;
  font-size: 18px !important;
  padding: 20px 24px !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.5) !important;
  transform: scale(1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: pulse-glow 2s infinite !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  }

  50% {
    box-shadow: 0 4px 25px rgba(168, 85, 247, 0.6);
  }

  100% {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  }
}

.wearai-add-to-cart-btn:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5) !important;
  filter: brightness(1.1) !important;
}

.wearai-add-to-cart-btn:active {
  transform: translateY(0) scale(0.98) !important;
}

.wearai-add-to-cart-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.3) !important;
  color: white !important;
}

.wearai-add-to-cart-btn span {
  color: white !important;
}


/* Trust Message */
.wearai-trust-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  background-color: #f1f5f9;
  border-radius: 20px;
  padding: 6px 12px;
  margin-top: 16px;
}


/* Loading States */
.wearai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #64748b;
}

.wearai-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid var(--wearai-brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* Try It On Button */
.wearai-wrapper {
  margin: 15px 0;
}

.wearai-button {
  background: var(--wearai-brand);
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.3);
  position: relative;
  overflow: hidden;
}

.wearai-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(77, 77, 227, 0.4);
}

.wearai-button:active {
  transform: translateY(0);
}

.wearai-arrow {
  transition: transform 0.2s;
}

.wearai-button:hover .wearai-arrow {
  transform: translateX(2px);
}

/* Camera Enable Container - Copies dropzone CSS styling only */
#wearai-upload-view,
#wearai-camera-view {
  /* Ensure both views are centered */
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.dropzone,
.wearai-camera-enable-container {
  /* Both containers should have identical sizing */
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.wearai-camera-enable-container {
  /* Layout */
  position: relative !important;
  /* Essential for video wrapper positioning */
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 2rem !important;
  text-align: center !important;

  /* Behavior - NOT clickable (buttons inside are clickable) */
  cursor: default;
}

.wearai-camera-enable-container>* {
  flex-shrink: 0;
  /* Prevent content from shrinking */
}

.wearai-camera-enable-container * {
  pointer-events: auto;
  /* Child elements (buttons, video) are interactive */
}

/* Video wrapper inside camera enable container */
#wearai-video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
  /* Match parent rounded-xl */
  overflow: hidden;
  background: #000;
  z-index: 10;
}

/* Give Permission Button - Now uses same styling as upload button via wearai-upload-btn class */

/* Capture Photo Button */
.wearai-capture-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--wearai-brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wearai-capture-btn:hover {
  /* Don't change background on hover - keep same brand color */
  background: var(--wearai-brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(77, 77, 227, 0.4);
}

.wearai-capture-btn:active {
  transform: translateY(0);
}

.wearai-capture-btn svg {
  flex-shrink: 0;
}

/* Switch Camera Button - Overlay on Video (Mobile Only) */
#wearai-switch-camera {
  display: none !important;
}

/* Show switch camera button only on mobile/tablet devices */
@media (max-width: 768px),
(hover: none) and (pointer: coarse) {
  #wearai-switch-camera {
    display: flex !important;
  }
}

#wearai-switch-camera:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
  background: rgba(255, 255, 255, 1) !important;
}

#wearai-switch-camera:active {
  transform: scale(0.98);
}

/* Powered By */
.wearai-powered-by {
  display: flex;
  align-items: center;
  margin-top: 10px;
  gap: 6px;
}

.wearai-powered-by span {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.wearai-powered-by a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.wearai-powered-by a:hover {
  opacity: 0.7;
}

.wearai-powered-by img {
  height: 18px;
  width: auto;
  display: block;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

@media (max-width: 640px) {
  .wearai-powered-by {
    justify-content: flex-start;
  }
}


/* Responsive */
@media (max-width: 640px) {
  .wearai-modal-backdrop {
    padding: 4px;
  }

  .wearai-modal-content {
    max-width: 100%;
    max-height: 95vh;
    padding: 20px 24px !important;
    border-radius: 20px !important;
  }

  /* Mobile Coupon Block - Professional centered layout */
  .wearai-coupon-container {
    padding: 16px 20px !important;
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 50%, #fef3c7 100%) !important;
    border: 1px solid rgba(217, 119, 6, 0.3) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    margin: 0 0 16px 0 !important;
    border-radius: 12px !important;
  }

  .wearai-coupon-container .flex.items-center.justify-between {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    text-align: left !important;
  }

  .wearai-coupon-container .flex-1 {
    width: auto !important;
    flex: 0 1 auto !important;
  }

  /* Header section compact on mobile */
  .wearai-coupon-container .flex.items-center.gap-2.mb-1 {
    justify-content: flex-start !important;
    margin-bottom: 2px !important;
    gap: 6px !important;
  }

  /* Mobile Coupon Title */
  .wearai-coupon-container h5 {
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  /* Mobile Coupon Subtitle */
  .wearai-coupon-container p {
    font-size: 11px !important;
    text-align: left !important;
  }

  /* Code and button container - horizontal on mobile */
  .wearai-coupon-container>div>div:last-child {
    width: auto !important;
    flex-direction: row !important;
    gap: 8px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  /* Mobile Coupon Code - Compact */
  .wearai-coupon-code {
    font-size: 12px !important;
    padding: 8px 12px !important;
    height: 32px !important;
    width: auto !important;
    min-width: 80px !important;
    text-align: center !important;
    letter-spacing: 0.8px !important;
    font-weight: 700 !important;
    background: white !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    border: 2px dashed var(--wearai-brand) !important;
    display: flex !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  /* Mobile Copy Button - Compact */
  .wearai-copy-btn {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 8px 12px !important;
    height: 32px !important;
    min-height: 32px !important;
    width: auto !important;
    min-width: 70px !important;
    gap: 4px !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(77, 77, 227, 0.2) !important;
    border-radius: 8px !important;
  }

  .wearai-copy-btn svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* Icon styling on mobile */
  .wearai-coupon-icon {
    width: 14px !important;
    height: 14px !important;
  }

  /* Mobile Action Buttons - Equal width */
  #wearai-download,
  #wearai-share,
  #wearai-try-again {
    flex: 1 !important;
    font-size: 0.75rem !important;
    padding: 10px 8px !important;
    gap: 4px !important;
    white-space: nowrap !important;
    justify-content: center !important;
    border-radius: 10px !important;
  }

  #wearai-download svg,
  #wearai-share svg,
  #wearai-try-again svg {
    width: 12px !important;
    height: 12px !important;
  }

  /* Mobile Action Buttons Container - Equal width */
  .flex.items-center.justify-center.gap-6 {
    gap: 8px !important;
    flex-wrap: nowrap !important;
    padding: 0 !important;
    width: 100% !important;
    display: flex !important;
    margin-top: 16px !important;
  }

  .wearai-main-content {
    padding: 20px 24px;
  }

  .wearai-mode-toggle {
    flex-direction: column;
    max-width: 100%;
  }

  .wearai-mode-btn {
    justify-content: center;
    padding: 10px 16px;
  }

  /* Responsive container on mobile - Fixed size */
  .tryon-image-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
    border-radius: 16px !important;
  }

  .tryon-image-container img {
    max-width: 90% !important;
    max-height: 90% !important;
    object-fit: contain !important;
  }

  /* Camera container same size as try-on container on mobile */
  .wearai-camera-container {
    width: 100% !important;
    height: 60vh !important;
    min-height: 400px !important;
    max-height: 60vh !important;
    border-radius: 16px !important;
  }

  .wearai-camera-video {
    object-fit: contain !important;
    background: #000 !important;
  }

  /* Camera enable container same size as try-on container on mobile */
  .wearai-camera-enable-container {
    height: 240px;
    min-height: 240px;
    max-height: 240px;
  }

  .wearai-powered-by {
    justify-content: center !important;
    margin-top: 16px !important;
  }
}


/* ========================================
   FUTURISTIC GLOSSY FROSTED GLASS EFFECT
   ======================================== */

#wearai-popup {
  background: rgba(3, 7, 18, 0.5) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

#wearai-popup-content {
  max-width: 480px !important;
  width: 90% !important;
  margin: 0 auto !important;
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(25px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 24px !important;
}

/* Header Area Styling */
#wearai-popup-content>div:first-child {
  background: rgba(0, 0, 0, 0.2) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(5px) !important;
  padding-top: 40px !important;
  padding-bottom: 32px !important;
  padding-left: 32px !important;
  padding-right: 32px !important;
  text-align: center !important;
}

.wearai-loading-header,
.wearai-result-header {
  text-align: center !important;
  margin-bottom: 16px !important;
  padding: 16px 32px 0 32px !important;
}

.wearai-loading-header h3,
.wearai-result-header h4 {
  font-size: 24px !important;
  font-weight: 700 !important;
  margin: 0 0 24px 0 !important;
  letter-spacing: -0.02em !important;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
  text-align: center !important;
}

.wearai-result-title {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  text-align: center !important;
  margin: 24px 0 !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  animation: none !important;
}

@keyframes shine-text {
  to {
    background-position: 200% center;
  }
}

.wearai-result-title span {
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.8) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.8) !important;
}

/* Glossy Shine Effect */
#wearai-popup-content::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 50% !important;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0.02) 40%,
      rgba(255, 255, 255, 0) 100%) !important;
  pointer-events: none !important;
  z-index: 1 !important;
}

/* Ensure content stays above the shine */
#wearai-popup-content>* {
  position: relative !important;
  z-index: 2 !important;
}

/* Tab Toggle Clarity */
.icon-toggle-group {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 4px !important;
}

.icon-toggle-button {
  transition: all 0.3s ease !important;
  border-radius: 6px !important;
}

.icon-toggle-button.active {
  background: var(--wearai-brand) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(77, 77, 227, 0.3) !important;
}

.icon-toggle-button.inactive {
  background: transparent !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

.icon-toggle-button.inactive:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Refined Image Container */
.tryon-image-container {
  background: #000 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 16px !important;
}

.tryon-image-container img {
  object-fit: contain !important;
  max-height: 90% !important;
  max-width: 90% !important;
}

/* Futuristic Button Glow */
.wearai-upload-btn,
#wearai-add-to-cart,
#wearai-capture,
button[id*="wearai-"] {
  background: var(--wearai-brand) !important;
  box-shadow: 0 0 15px rgba(67, 56, 202, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.wearai-upload-btn:hover,
#wearai-add-to-cart:hover,
#wearai-capture:hover,
button[id*="wearai-"]:hover {
  box-shadow: 0 0 25px rgba(164, 27, 238, 0.5) !important;
  transform: translateY(-2px) scale(1.02) !important;
  background: var(--wearai-brand-hover) !important;
}

/* Text Visibility Enhancements */
#wearai-popup-header {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5) !important;
  font-weight: 700 !important;
}

#wearai-popup-subheader {
  color: rgba(255, 255, 255, 0.6) !important;
  font-weight: 400 !important;
}

/* Close Button Visibility */
#wearai-close-btn {
  color: rgba(255, 255, 255, 0.8) !important;
}

#wearai-close-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Loading and Status Text Visibility */
.wearai-loading-header p,
.wearai-status-message,
.wearai-progress-message,
.loader-message,
.loading-status,
#wearai-loading-state p,
#wearai-loading-state div[class*="text"],
.tryon-image-container+p,
.wearai-result-header p {
  color: #f9fafb !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}

/* Ensure all sections have breathing room */
.wearai-result-container,
.wearai-terms,
.wearai-action-buttons,
#wearai-result-state>div,
#wearai-initial-state>div {
  margin-bottom: 24px !important;
}