/* ==========================================================================
   AIRISH WEBAR (AUGMENTED REALITY) PREVIEW SYSTEM
   Real Camera Wall Projection + 3D Virtual Room Wall Simulator
   ========================================================================== */

.ar-modal {
  position: fixed;
  inset: 0;
  z-index: 10000005;
  background: #000000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  transition: opacity var(--transition-smooth);
}

.ar-modal::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.ar-modal.active {
  opacity: 1;
  pointer-events: auto;
}

body.ar-modal-open {
  overflow: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

body.ar-modal-open::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Viewport Area (Camera feed or Virtual Room) */
.ar-viewport {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0f17;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

#arCameraVideo {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

#arVirtualRoomBg {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* AR Wall Projection Canvas/Card */
.ar-artwork-container {
  position: absolute;
  z-index: 10;
  cursor: grab;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow var(--transition-fast);
}

.ar-artwork-container:active {
  cursor: grabbing;
}

.ar-artwork-frame {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 25px 30px rgba(0, 0, 0, 0.25), 0 5px 15px rgba(0, 0, 0, 0.5);
  transition: border var(--transition-fast), padding var(--transition-fast);
}

/* Frame Styles */
.ar-artwork-frame.frame-black {
  border: 12px solid #141414;
  padding: 10px;
  background: #fafafa;
}

.ar-artwork-frame.frame-wood {
  border: 14px solid #442e28;
  padding: 12px;
  background: #fdfbf7;
}

.ar-artwork-frame.frame-glass {
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 0;
  background: transparent;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.ar-artwork-img {
  display: block;
  width: 220px;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  pointer-events: none;
}

.ar-dimension-tag {
  margin-top: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  pointer-events: none;
  opacity: .3;
}

.ar-hint-tag {
  margin-top: 0;
  margin-bottom: 3px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.ar-hint-tag i {
  font-size: 0.85rem;
  line-height: 1;
}

.ar-artwork-container:active .ar-hint-tag {
  opacity: 0.2;
}

/* AR Top Bar */
.ar-top-bar {
  position: absolute;
  top: max(16px, calc(10px + env(safe-area-inset-top, 16px)));
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.ar-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ar-btn-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background var(--transition-fast);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  font-size: 17px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ar-btn-circle:hover {
  transform: scale(1.06);
}

.ar-btn-circle:active {
  transform: scale(0.94);
}

#arSwitchCamBtn {
  display: none;
  /* Only visible when camera mode is active */
}

#arSwitchCamBtn i {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ar-mode-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  font-size: var(--text-xs);
  font-weight: 600;
  background: rgb(0 0 0 / 15%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgb(160 160 160 / 40%);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.ar-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {

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

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

/* AR Bottom Controls Panel */
.ar-bottom-panel {
  position: absolute;
  bottom: max(20px, calc(12px + env(safe-area-inset-bottom, 20px)));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: rgb(20 20 20 / 68%);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

/* View Mode Selector Tabs */
.ar-tabs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ar-tabs-row::-webkit-scrollbar {
  display: none;
}

.ar-tab-btn {
  flex: 1;
  padding: 8px 15px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.ar-tab-btn.active {
  background: rgb(0 0 0 / 15%);
  color: #ffffff;
  border-color: #ffffff;
}

/* Scale & Frame Controls */
.ar-tools-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ar-scale-tool {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ar-scale-label {
  font-size: 0.7rem;
  font-weight: 600;
  accent-color: #ffffff;
  white-space: nowrap;
}

.ar-scale-slider {
  flex: 1;
  accent-color: #ffffff;
  height: 4px;
}

.ar-frames-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.frame-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.frame-swatch.active {
  border-color: #ffffff;
  transform: scale(1.15);
}

.frame-swatch-black {
  background: #1a1a1a;
  border: 1px solid #333;
}

.frame-swatch-wood {
  background: #583f38;
}

.frame-swatch-glass {
  background: rgba(255, 255, 255, 0.6);
}

/* AR Action Buttons */
.ar-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#arRentDirectBtn {
  position: relative;
  width: 100%;
  padding: 15px 30px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  border-radius: var(--radius-full);
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  z-index: 2;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  box-shadow: none;
}

/* Single-Beam White Rotating Borderspin (True Circle, No Distortion) */
#arRentDirectBtn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(250%, 700px);
  height: max(250%, 700px);
  background: conic-gradient(from 0deg,
      transparent 0deg,
      transparent 300deg,
      rgba(255, 255, 255, 0.2) 330deg,
      rgba(255, 255, 255, 0.7) 350deg,
      #ffffff 360deg);
  transform: translate(-50%, -50%) rotate(0deg);
  animation: webarBorderSpin 3.2s linear infinite;
  z-index: 0;
  pointer-events: none;
}

/* Inner Mask to reveal crisp 1.5px single border stroke */
#arRentDirectBtn::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: rgba(12, 16, 24, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-full);
  z-index: 1;
  pointer-events: none;
}

#arRentDirectBtn>* {
  position: relative;
  z-index: 2;
}

#arRentDirectBtn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.2);
}

#arRentDirectBtn:hover::before {
  animation-duration: 1.8s;
}

#arRentDirectBtn:hover::after {
  background: rgba(18, 24, 38, 0.92);
}

#arRentDirectBtn i {
  font-size: 18px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Luxury Dark Rotating Borderspin CTA Button for Rental Bars (matches #arRentDirectBtn) */
#btnOpenRentalSheet,
#btnDetailOpenRentalSheet {
  position: relative;
  padding: 12px 22px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  border-radius: var(--radius-full);
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  z-index: 2;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  box-shadow: none;
}

/* Single-Beam White Rotating Borderspin */
#btnOpenRentalSheet::before,
#btnDetailOpenRentalSheet::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(250%, 600px);
  height: max(250%, 600px);
  background: conic-gradient(from 0deg,
      transparent 0deg,
      transparent 300deg,
      rgba(255, 255, 255, 0.2) 330deg,
      rgba(255, 255, 255, 0.7) 350deg,
      #ffffff 360deg);
  transform: translate(-50%, -50%) rotate(0deg);
  animation: webarBorderSpin 3.2s linear infinite;
  z-index: 0;
  pointer-events: none;
}

/* Inner Mask to reveal crisp 1.5px single border stroke */
#btnOpenRentalSheet::after,
#btnDetailOpenRentalSheet::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: rgba(12, 16, 24, 0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-full);
  z-index: 1;
  pointer-events: none;
}

#btnOpenRentalSheet>*,
#btnDetailOpenRentalSheet>* {
  position: relative;
  z-index: 2;
}

#btnOpenRentalSheet:hover,
#btnDetailOpenRentalSheet:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: scale(1.02);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 255, 255, 0.2);
}

#btnOpenRentalSheet:hover::before,
#btnDetailOpenRentalSheet:hover::before {
  animation-duration: 1.8s;
}

#btnOpenRentalSheet:hover::after,
#btnDetailOpenRentalSheet:hover::after {
  background: rgba(18, 24, 38, 0.92);
}

#btnOpenRentalSheet i,
#btnDetailOpenRentalSheet i {
  font-size: 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes webarBorderSpin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.btn-snap {
  width: 50px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Flash Snapshot Effect */
.ar-snapshot-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.ar-snapshot-flash.flash {
  opacity: 0.9;
}

/* Mobile Optimization for AR Simulator */
@media (max-width: 640px) {
  .ar-bottom-panel {
    bottom: 16px;
    width: calc(100% - 24px);
    padding: 12px 14px;
    gap: 20px;
    border-radius: var(--radius-md);
  }

  .ar-tab-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .ar-artwork-img {
    width: 180px;
    max-height: 270px;
  }

  .ar-tools-row {
    gap: 8px;
  }

  .ar-scale-tool {
    gap: 6px;
  }

  .ar-scale-label {
    font-size: 13px
  }

  .frame-swatch {
    width: 24px;
    height: 24px;
  }

  #arRentDirectBtn {
    padding: 13px 20px;
    font-size: 12.5px;
    letter-spacing: 1.1px;
  }

  .ar-top-bar {
    top: 12px;
    left: 12px;
    right: 12px;
  }
}