/* ============================================================
   Q-TIBA THEME (dikongsi oleh index.html, parent.html, scan.html)
   Glassmorphism + aksen neon cyan, serasi mod terang & gelap
   ============================================================ */

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

/* ---------- Glassmorphism card ---------- */
.glass-card {
  position: relative;
  background: rgba(255, 255, 255, 0.42);
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.14) 40%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    inset 0 -10px 24px rgba(255, 255, 255, 0.06),
    0 8px 32px 0 rgba(31, 38, 135, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dark .glass-card {
  background: rgba(20, 22, 30, 0.4);
  background-image:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.012) 100%),
    radial-gradient(120% 100% at 15% -10%, rgba(6, 182, 212, 0.2), transparent 55%),
    radial-gradient(120% 100% at 100% 110%, rgba(139, 92, 246, 0.18), transparent 58%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -20px 36px rgba(2, 6, 23, 0.42),
    0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

/* Fallback: pelayar tanpa backdrop-filter — pastikan teks masih terbaca */
@supports not (backdrop-filter: blur(1px)) {
  .glass-card { background: rgba(255, 255, 255, 0.88); }
  .dark .glass-card { background: rgba(28, 28, 30, 0.96); }
}

/* ---------- Tab aktif ---------- */
.tab-btn-active {
  background: #06b6d4 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.39);
}

/* ---------- Jadual boleh-urut ---------- */
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover {
  color: #06b6d4;
}

/* ============================================================
   Q-TIBA UI UPGRADE — animasi & kesan visual (maksium/berani)
   Dikongsi oleh index.html, scan.html, parent.html
   ============================================================ */

/* ---------- Hormati pengguna yang sensitif kepada gerakan ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Aurora animated gradient background ---------- */
.aurora-bg {
  position: relative;
}
.aurora-bg::before {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: -2;
  background:
    radial-gradient(38% 48% at 12% 18%, rgba(6, 182, 212, 0.42), transparent 60%),
    radial-gradient(42% 52% at 88% 12%, rgba(139, 92, 246, 0.4), transparent 60%),
    radial-gradient(40% 50% at 30% 78%, rgba(236, 72, 153, 0.3), transparent 60%),
    radial-gradient(42% 52% at 72% 30%, rgba(56, 189, 248, 0.32), transparent 60%),
    radial-gradient(52% 58% at 55% 90%, rgba(34, 211, 238, 0.35), transparent 62%);
  filter: blur(52px);
  animation: aurora-drift 22s ease-in-out infinite;
  pointer-events: none;
}
/* Blob warna hidup di belakang kad — memberikan "bahan" untuk kesan kaca */
.bg-blob {
  position: fixed;
  border-radius: 9999px;
  pointer-events: none;
  z-index: -1;
  filter: blur(70px);
  opacity: 0.9;
}
.bg-blob-primary {
  width: 46vmax;
  height: 46vmax;
  top: -12vmax;
  left: -10vmax;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.5), transparent 68%);
  animation: blob-drift-a 26s ease-in-out infinite;
}
.bg-blob-violet {
  width: 44vmax;
  height: 44vmax;
  top: 4vh;
  right: -12vmax;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.46), transparent 68%);
  animation: blob-drift-b 30s ease-in-out infinite;
}
.bg-blob-pink {
  width: 40vmax;
  height: 40vmax;
  bottom: -10vmax;
  left: 22vw;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.36), transparent 68%);
  animation: blob-drift-c 34s ease-in-out infinite;
}
.bg-blob-cyan {
  width: 42vmax;
  height: 42vmax;
  bottom: -8vmax;
  right: 16vw;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.42), transparent 68%);
  animation: blob-drift-d 24s ease-in-out infinite;
}
@keyframes blob-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(5vmax, 7vmax, 0); }
  66% { transform: translate3d(-3vmax, 3vmax, 0); }
}
@keyframes blob-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(-6vmax, -4vmax, 0); }
  66% { transform: translate3d(2vmax, -7vmax, 0); }
}
@keyframes blob-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(4vmax, -6vmax, 0); }
  66% { transform: translate3d(-5vmax, 2vmax, 0); }
}
@keyframes blob-drift-d {
  0%, 100% { transform: translate3d(0, 0, 0); }
  33% { transform: translate3d(-7vmax, 5vmax, 0); }
  66% { transform: translate3d(3vmax, -3vmax, 0); }
}
/* Gelap: blob sedikit lebih redup supaya tidak silau */
.dark .bg-blob { opacity: 0.75; }
.dark .bg-blob-primary { background: radial-gradient(circle, rgba(34, 211, 238, 0.42), transparent 68%); }
.dark .bg-blob-violet { background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 68%); }
.dark .bg-blob-pink { background: radial-gradient(circle, rgba(236, 72, 153, 0.3), transparent 68%); }
.dark .bg-blob-cyan { background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 68%); }
@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  33% { transform: translate3d(3%, -2%, 0) rotate(2deg); }
  66% { transform: translate3d(-3%, 2%, 0) rotate(-2deg); }
}

/* ---------- Glass-card hover lift + glow (peranti dengan tetikus) ---------- */
@media (hover: hover) and (pointer: fine) {
  .glass-card {
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.28s ease,
                border-color 0.28s ease;
    will-change: transform;
  }
  .glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.55) !important;
    box-shadow: 0 20px 44px -12px rgba(6, 182, 212, 0.5);
  }
}

/* ---------- Entrance reveal (staggered, dikawal JS) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
}
.reveal.is-visible {
  animation: qfade-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes qfade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Pulsa hidup (live pulse dot) ---------- */
.pulse-dot {
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: qpulse 2s infinite;
}
@keyframes qpulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- Skeleton loading shimmer ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.22);
  color: transparent !important;
  user-select: none;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: qshimmer 1.4s infinite;
}
@keyframes qshimmer {
  100% { transform: translateX(100%); }
}

/* ---------- Butang micro-interaction (tekan) ---------- */
.btn-mpress {
  transition: transform 0.12s ease;
}
.btn-mpress:active {
  transform: scale(0.96);
}

/* ---------- Tab peralihan (slide + fana) ---------- */
.tab-content {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.tab-content.tab-entering {
  animation: tab-slide-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes tab-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Teks berkilau (glow) pada tajuk ---------- */
.glow-title {
  text-shadow: 0 0 18px rgba(6, 182, 212, 0.4);
}

/* ---------- Gelembung menaik pada latar (decor) ---------- */
@keyframes qbubble-rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: 0.5; }
  100% { transform: translateY(-110vh) scale(1.4); opacity: 0; }
}

/* ---------- Konfeti (cuakan khas untuk imbasan berjaya) ---------- */
.confetti-piece {
  position: fixed;
  top: -24px;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  animation-name: qconfetti-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes qconfetti-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(720deg); opacity: 0.85; }
}

/* ---------- Kad "pop-in" sedia ada dinaiki taraf ---------- */
@keyframes qpop-in {
  0% { opacity: 0; transform: scale(0.85); }
  60% { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}
.pop-in {
  animation: qpop-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ============================================================
   Q-TIBA iOS 26 (Liquid Glass) — tab floating bawah + UX fon
   ============================================================ */

/* Font asli iOS (SF Pro / system), serasi dengan tema gelap */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}
.code-font {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", monospace !important;
}

/* ---------- Tab bar floating bawah (iOS) ---------- */
.ios-tabbar {
  position: fixed;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 560px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 6px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.18);
  z-index: 60;
}
.dark .ios-tabbar {
  background: rgba(24, 34, 56, 0.82);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Indicator kapsul tunggal — menggelongsor antara tab (liquid slide) */
.ios-tab-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  border-radius: 27px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  box-shadow: 0 10px 26px -10px rgba(6, 182, 212, 0.6),
              inset 0 0 1px rgba(255, 255, 255, 0.65);
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.35, 1),
              width 0.45s cubic-bezier(0.25, 1, 0.35, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
}
.dark .ios-tab-indicator {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(56, 189, 248, 0.22));
  box-shadow: 0 10px 26px -10px rgba(34, 211, 238, 0.55),
              inset 0 0 1px rgba(255, 255, 255, 0.25);
}

/* Item tab — besar untuk jari (min 56px tinggi) */
.ios-tab-item {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border-radius: 27px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(100, 116, 139, 0.9);
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
}
.dark .ios-tab-item { color: rgba(148, 163, 184, 0.9); }

/* Ikon dalam item (statik; ikon aktif membesar sedikit) */
.ios-tab-item .tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}
.ios-tab-item i {
  font-size: 20px;
  line-height: 1;
}
.ios-tab-item .tab-label { transition: color 0.25s ease, font-weight 0.25s ease; }

/* State aktif — ikon & label bertukar warna, ikon sedikit membesar */
.ios-tab-item.tab-btn-active .tab-icon,
.ios-tab-item.active .tab-icon { transform: scale(1.12); color: #0891b2; }
.ios-tab-item.tab-btn-active .tab-label,
.ios-tab-item.active .tab-label { color: #0891b2; font-weight: 800; }
.ios-tab-item.tab-btn-active,
.ios-tab-item.active { color: #0891b2; }

.dark .ios-tab-item.tab-btn-active .tab-icon,
.dark .ios-tab-item.active .tab-icon { color: #22d3ee; }
.dark .ios-tab-item.tab-btn-active .tab-label,
.dark .ios-tab-item.active .tab-label { color: #22d3ee; }
.dark .ios-tab-item.tab-btn-active,
.dark .ios-tab-item.active { color: #22d3ee; }

.ios-tab-item:active { transform: scale(0.96); }

/* Ruang bawah supaya tab floating tidak menutup kandungan */
.ios-bottom-space {
  padding-bottom: max(104px, calc(env(safe-area-inset-bottom, 0px) + 96px));
}

/* Butang iOS — kawasan sentuh selesa untuk jari */
.ios-btn {
  min-height: 44px;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   Q-TIBA DARK MODE — selesa untuk mata (gaya iOS 26)
   Kurangkan kontras keras: latar lembut + teks off-white
   (bukannya white tulen atas near-black)
   ============================================================ */

/* Latar badan — perang lembut gaya iOS systemBackground (#1c1c1e) */
.dark body {
  background: #1c1c1e !important;
  background-image: linear-gradient(145deg, #19191b 0%, #232328 55%, #1c1c1e 100%) !important;
  color-scheme: dark;
}

/* Glass-card lebih cerah sedikit daripada latar — kesan "elevated" iOS */
.dark .glass-card {
  background: rgba(20, 22, 30, 0.4);
  background-image:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 45%, rgba(255, 255, 255, 0.012) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -20px 36px rgba(2, 6, 23, 0.42),
    0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Teks putih tulen → off-white lembut (iOS mengelak #fff penuh) */
.dark .text-white {
  color: rgba(242, 244, 248, 0.92) !important;
}

.dark .text-slate-100 {
  color: rgba(231, 234, 243, 0.88) !important;
}

/* Auroral lembut sedikit dalam dark supaya tidak silau */
.dark .aurora-bg::before {
  opacity: 0.7;
  filter: blur(64px);
}
