/* ============================================================
   D.S AIRLINES — AR Baggage Sizer Styles
   ============================================================ */

.ar-baggage-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: #0a0e1e;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.ar-baggage-overlay.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

/* ── Header ── */
.ar-baggage-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 14, 30, 0.95);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  flex-shrink: 0;
}
.ar-close-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ar-close-btn:hover { background: rgba(255,255,255,0.1); }
.ar-header-title {
  display: flex; align-items: center; gap: 8px;
  color: #c9a84c;
  font-weight: 700;
  font-size: 1rem;
}
.ar-bag-type {
  margin-left: auto;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  background: rgba(201,168,76,0.1);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(201,168,76,0.2);
}

/* ── Camera Container ── */
.ar-camera-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}
#arVideo {
  width: 100%; height: 100%;
  object-fit: cover;
}
#arCanvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ── Calibration Overlay ── */
.ar-calibration-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}
.ar-calibration-card {
  position: relative;
  width: 240px; height: 152px; /* Approx credit card ratio */
}
.ar-card-outline {
  width: 100%; height: 100%;
  border: 2px dashed rgba(201,168,76,0.8);
  border-radius: 12px;
  position: relative;
  animation: arCardPulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(201,168,76,0.2), inset 0 0 20px rgba(201,168,76,0.05);
}
.ar-card-outline::after {
  content: '💳';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0.4;
}
@keyframes arCardPulse {
  0%, 100% { border-color: rgba(201,168,76,0.4); }
  50% { border-color: rgba(201,168,76,0.9); }
}
.ar-calibration-text {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 20px;
  padding: 0 20px;
}
.ar-calibrate-btn {
  margin-top: 16px;
  background: linear-gradient(135deg, #c9a84c, #e8d48b);
  color: #0a0e1e;
  border: none;
  border-radius: 14px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(201,168,76,0.3);
}
.ar-calibrate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,168,76,0.5);
}

/* ── Measurement Overlay ── */
.ar-measure-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ar-dimension-guide {
  position: relative;
  border: 2px solid rgba(74, 222, 128, 0.6);
  border-radius: 8px;
  background: rgba(74, 222, 128, 0.05);
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.15), inset 0 0 30px rgba(74, 222, 128, 0.05);
  animation: arGuideGlow 2s ease-in-out infinite;
  transition: all 0.5s ease;
}
@keyframes arGuideGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(74,222,128,0.1); }
  50% { box-shadow: 0 0 40px rgba(74,222,128,0.25), inset 0 0 20px rgba(74,222,128,0.08); }
}
.ar-guide-width {
  position: absolute;
  bottom: -28px; left: 0; right: 0;
  text-align: center;
}
.ar-guide-width span, .ar-guide-height span {
  background: rgba(10,14,30,0.85);
  color: #4ade80;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(74,222,128,0.3);
}
.ar-guide-height {
  position: absolute;
  right: -48px; top: 50%;
  transform: translateY(-50%) rotate(90deg);
}
.ar-measure-hint {
  position: absolute;
  bottom: 40px;
  background: rgba(10,14,30,0.85);
  color: rgba(255,255,255,0.7);
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}
.ar-pulse-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: arDotPulse 1.5s ease-in-out infinite;
}
@keyframes arDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}

/* ── Result Panel ── */
.ar-result-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(10,14,30,0.98), rgba(10,14,30,0.9));
  backdrop-filter: blur(20px);
  padding: 32px 24px;
  border-top: 1px solid rgba(201,168,76,0.2);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: arSlideUp 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes arSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.ar-result-icon { font-size: 3rem; }
.ar-result-icon.ar-pass { animation: arBounce 0.6s ease; }
.ar-result-icon.ar-fail { animation: arShake 0.5s ease; }
@keyframes arBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
@keyframes arShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.ar-result-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
}
.ar-result-desc {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}
.ar-result-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #c9a84c, #e8d48b);
  color: #0a0e1e;
  border: none;
  border-radius: 14px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}
.ar-result-btn:hover { transform: translateY(-2px); }

/* ── Manual Fallback ── */
.ar-manual-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 16px;
}
.ar-manual-title {
  color: #c9a84c;
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
}
.ar-manual-desc {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  text-align: center;
}
.ar-manual-inputs {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 360px;
}
.ar-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ar-input-group label {
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ar-input-group input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}
.ar-input-group input:focus {
  border-color: rgba(201,168,76,0.5);
}
.ar-manual-check-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #c9a84c, #e8d48b);
  color: #0a0e1e;
  border: none;
  border-radius: 14px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  max-width: 360px;
  transition: all 0.3s;
}
