/* Custom styling for Auto Key Shop */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark-bg: #090d16;
  --card-bg: rgba(17, 24, 39, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
}

html {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  overscroll-behavior-x: none !important;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--dark-bg);
  color: #f3f4f6;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  overscroll-behavior-x: none !important;
  touch-action: pan-y manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ===== CHỐNG RUNG LẮC NGANG / HORIZONTAL SHAKING FIX =====
   overflow-x: hidden trên html/body không chặn được fixed elements.
   Wrapper này là lớp chắn thực sự duy nhất hiệu quả trên mobile. */
#app-wrapper {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  min-height: 100vh;
}

/* Clip preloader-grid không tràn sang trái/phải */
#page-preloader {
  overflow: hidden !important;
}

/* Giới hạn product slide-in không tạo scroll ngang & Tăng tốc phần cứng GPU */
.product-animate-slide-right {
  opacity: 0;
  transform: translate3d(20px, 0, 0);
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--item-delay, 0) * 0.05s);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.product-animate-slide-right.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* Chống iOS Safari tự ý phóng to màn hình khi bấm vào ô nhập liệu */
@media (max-width: 768px) {
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  input[type="search"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0b1120;
}
::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #374151;
}

/* Glassmorphism */
.glass-card {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
}

.glass-nav {
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-modal {
  background: rgba(13, 19, 33, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Glowing text & border */
.glow-primary {
  box-shadow: 0 0 25px -5px rgba(99, 102, 241, 0.35);
}

.glow-accent {
  box-shadow: 0 0 25px -5px rgba(6, 182, 212, 0.35);
}

.glow-success {
  box-shadow: 0 0 25px -5px rgba(16, 185, 129, 0.35);
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Subtle background animated gradient */
.hero-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 92vw);
  max-width: 92vw;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.08) 45%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Shimmer animation for key delivery */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-key {
  background: linear-gradient(90deg, #111827 25%, #1e293b 50%, #111827 75%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

/* Pulse animation for Live Badges */
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.97); }
}

.pulse-badge {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Product Card Hover effects */
.product-card {
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.25);
}

/* Toast container */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Celebration Modal Pop-in Animation */
@keyframes celebrationPopIn {
  0% {
    transform: scale(0.85) translateY(20px);
    opacity: 0;
  }
  70% {
    transform: scale(1.03) translateY(-4px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.animate-celebration-pop {
  animation: celebrationPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =========================================================
   Product Slide-in From Right Animation - dùng translateX nhỏ để KHÔNG gây scroll ngang
   (Định nghĩa chính nằm ở #app-wrapper section phía trên)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .product-animate-slide-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Live Customer Reviews Stream (Thông báo đánh giá góc trái)
   ========================================================= */
@keyframes reviewSlideInUp {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes reviewSlideOutFade {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    max-height: 140px;
    margin-bottom: 10px;
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
    max-height: 0px;
    margin-bottom: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
  }
}

.review-item-enter {
  animation: reviewSlideInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.review-item-exit {
  animation: reviewSlideOutFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.review-glass-card {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 15px -3px rgba(99, 102, 241, 0.2);
  transition: all 0.3s ease;
}

.review-glass-card:hover {
  background: rgba(20, 29, 52, 0.95);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.6), 0 0 20px -2px rgba(99, 102, 241, 0.35);
}

/* =========================================================
   Live Purchase Floating Ticker (Khách vừa mua file)
   - Luôn nằm TRÊN CÙNG, tự động đẩy lên cao khi đánh giá dâng lên
   ========================================================= */
#live-ticker {
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.35s ease;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  overflow: hidden;
  margin-bottom: 0;
  pointer-events: none;
  width: 100%;
}

#live-ticker.is-active {
  max-height: 120px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 8px;
  pointer-events: auto;
}

/* =========================================================
   Continuous Running Marquee Announcement Bar (Thanh Chạy Chữ)
   - Chạy ngang liên tục từ phải sang trái
   - Tự động lặp vô tận (infinite seamless loop)
   ========================================================= */
@keyframes marqueeContinuousScroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.marquee-stream-wrapper {
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.marquee-stream-track {
  display: flex;
  white-space: nowrap;
  width: max-content;
  animation: marqueeContinuousScroll var(--marquee-speed, 25s) linear infinite;
  will-change: transform;
}

.marquee-stream-track.is-pause-hover:hover {
  animation-play-state: paused;
}

/* Các Theme Màu của Marquee */
.marquee-theme-fire {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), rgba(249, 115, 22, 0.22), rgba(239, 68, 68, 0.16));
  border-color: rgba(239, 68, 68, 0.4);
  color: #fef08a;
}
.marquee-theme-fire .marquee-badge {
  background: linear-gradient(135deg, #ef4444, #ea580c);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.55);
}

.marquee-theme-cyan {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.16), rgba(59, 130, 246, 0.22), rgba(6, 182, 212, 0.16));
  border-color: rgba(6, 182, 212, 0.4);
  color: #a5f3fc;
}
.marquee-theme-cyan .marquee-badge {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.55);
}

.marquee-theme-emerald {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.16), rgba(20, 184, 166, 0.22), rgba(16, 185, 129, 0.16));
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}
.marquee-theme-emerald .marquee-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.55);
}

.marquee-theme-purple {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.16), rgba(236, 72, 153, 0.22), rgba(168, 85, 247, 0.16));
  border-color: rgba(168, 85, 247, 0.4);
  color: #f5d0fe;
}
.marquee-theme-purple .marquee-badge {
  background: linear-gradient(135deg, #a855f7, #db2777);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.55);
}

.marquee-theme-amber {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(234, 88, 12, 0.22), rgba(245, 158, 11, 0.16));
  border-color: rgba(245, 158, 11, 0.4);
  color: #fef3c7;
}
.marquee-theme-amber .marquee-badge {
  background: linear-gradient(135deg, #f59e0b, #c2410c);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.55);
}

/* ================= 3D GAMING CUBE PAGE PRELOADER ================= */
#page-preloader {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: radial-gradient(circle at 50% 45%, #0e162e 0%, #060913 70%, #020307 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  user-select: none;
}

#page-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.06);
  pointer-events: none;
}

/* Background Cyber Grid & Scanline Effect */
.preloader-grid {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(600px) rotateX(60deg) translateY(-20%);
  animation: preloaderGridScroll 10s linear infinite;
  pointer-events: none;
}

@keyframes preloaderGridScroll {
  0% { transform: perspective(600px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(600px) rotateX(60deg) translateY(40px); }
}

.preloader-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.35) 51%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.6;
}

/* 3D Scene Wrapper */
.game-cube-scene {
  width: 140px;
  height: 140px;
  perspective: 1000px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

/* 3D Cube Container */
.game-cube {
  width: 76px;
  height: 76px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateGameCube 5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

@keyframes rotateGameCube {
  0% {
    transform: rotateX(-22deg) rotateY(0deg) rotateZ(0deg);
  }
  33% {
    transform: rotateX(25deg) rotateY(120deg) rotateZ(-10deg);
  }
  66% {
    transform: rotateX(-15deg) rotateY(240deg) rotateZ(15deg);
  }
  100% {
    transform: rotateX(-22deg) rotateY(360deg) rotateZ(0deg);
  }
}

/* 6 Cube Faces */
.cube-face {
  position: absolute;
  width: 76px;
  height: 76px;
  background: rgba(6, 182, 212, 0.08);
  border: 1.5px solid rgba(6, 220, 255, 0.85);
  box-shadow: 
    inset 0 0 16px rgba(6, 182, 212, 0.25),
    0 0 15px rgba(6, 182, 212, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background-image: 
    linear-gradient(rgba(6, 182, 212, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.15) 1px, transparent 1px);
  background-size: 15px 15px;
}

/* High-tech Corner Brackets for Each Face */
.cube-face::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
}

.cube-face::after {
  content: '';
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid #00f3ff;
  border-right: 2px solid #00f3ff;
}

/* 3D Face Positions (half of 76px = 38px) */
.face-front  { transform: translateZ(38px); }
.face-back   { transform: rotateY(180deg) translateZ(38px); border-color: rgba(99, 102, 241, 0.9); }
.face-right  { transform: rotateY(90deg) translateZ(38px); border-color: rgba(16, 185, 129, 0.9); }
.face-left   { transform: rotateY(-90deg) translateZ(38px); border-color: rgba(236, 72, 153, 0.9); }
.face-top    { transform: rotateX(90deg) translateZ(38px); border-color: rgba(245, 158, 11, 0.9); }
.face-bottom { transform: rotateX(-90deg) translateZ(38px); border-color: rgba(6, 182, 212, 0.9); }

/* Inner Pulsing Core */
.cube-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  margin-left: -13px;
  background: radial-gradient(circle, #ffffff 10%, #00f3ff 50%, #6366f1 90%);
  border-radius: 6px;
  transform-style: preserve-3d;
  box-shadow: 
    0 0 25px #00f3ff,
    0 0 45px #6366f1,
    0 0 70px rgba(6, 182, 212, 0.6);
  animation: corePulse 1.8s ease-in-out infinite alternate;
}

@keyframes corePulse {
  0% { transform: scale(0.7) rotate(0deg); opacity: 0.8; }
  100% { transform: scale(1.15) rotate(180deg); opacity: 1; }
}

/* Holographic Rotating Orbit Ring */
.cube-orbit {
  position: absolute;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  border: 1.5px dashed rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
  transform: rotateX(68deg) rotateY(15deg);
  animation: orbitSpin 6s linear infinite;
  pointer-events: none;
}

@keyframes orbitSpin {
  0% { transform: rotateX(68deg) rotateY(15deg) rotateZ(0deg); }
  100% { transform: rotateX(68deg) rotateY(15deg) rotateZ(360deg); }
}

/* 3D Floor Shadow */
.cube-shadow {
  position: absolute;
  bottom: -35px;
  left: 50%;
  width: 100px;
  height: 35px;
  margin-left: -50px;
  background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.45) 0%, rgba(99, 102, 241, 0.2) 40%, transparent 75%);
  border-radius: 50%;
  filter: blur(6px);
  animation: shadowPulse 2.5s ease-in-out infinite alternate;
}

@keyframes shadowPulse {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 0.85; }
}

/* =======================================================
   NABATISTORE ENTERPRISE SECURITY & ANTI-COPY STYLES
   ======================================================= */
/* Bảo vệ mã nguồn & hình ảnh khỏi bị kéo thả hoặc bôi đen trộm */
img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Cho phép bôi đen & sao chép bình thường ở các ô nhập liệu, số tiền, STK */
input, textarea, select, .allow-select, .copy-text, [data-copyable], .font-mono {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Hiệu ứng hào quang đỏ cho Security Modal */
#security-alert-box {
  animation: securityBoxGlow 3s ease-in-out infinite alternate;
}

@keyframes securityBoxGlow {
  0% {
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.25), 0 0 50px rgba(245, 158, 11, 0.15);
  }
  100% {
    box-shadow: 0 0 45px rgba(239, 68, 68, 0.45), 0 0 80px rgba(245, 158, 11, 0.3);
  }
}






