/* TechPicks Review - Next-Gen Cyber-Obsidian & Hyper-Cyan Aesthetic */
/* High-Tech Editorial, Lab Benchmarks & Verified Intelligence */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600&family=Outfit:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Space+Grotesk:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Outfit', 'Be Vietnam Pro', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-vi: 'Plus Jakarta Sans', 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-zh: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  
  /* Cyber-Cyan & Tech Titanium Theme Tokens */
  --cyan-neon: #00F0FF;
  --cyan-glow: rgba(0, 240, 255, 0.35);
  --cyan-glow-bright: rgba(56, 189, 248, 0.6);
  --blue-electric: #2563eb;
  --emerald-neon: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --amber-solar: #f59e0b;
  --obsidian-bg: #07080e;
  --carbon-surface: #11141f;
  --carbon-surface-2: #161a29;
  --border-cyan-subtle: rgba(56, 189, 248, 0.18);
  --border-titanium: rgba(255, 255, 255, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: #f8fafc;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
html.dark {
  background-color: #07080e;
}

body {
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-main);
  scroll-behavior: smooth;
  opacity: 1;
  
  background-color: #f8fafc;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 100% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 45%),
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

html.dark body, body.dark {
  background-color: #07080e !important;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.16) 0%, transparent 65%),
    radial-gradient(circle at 85% 15%, rgba(37, 99, 235, 0.14) 0%, transparent 45%),
    linear-gradient(to right, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.04) 1px, transparent 1px) !important;
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px !important;
}

#hero-pinned-card {
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08) !important;
  background: #ffffff !important;
  backdrop-filter: blur(20px) !important;
}

html.dark #hero-pinned-card, body.dark #hero-pinned-card {
  border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 0 50px -10px rgba(6, 182, 212, 0.28), 0 25px 60px -15px rgba(2, 132, 199, 0.25) !important;
  background: rgba(14, 18, 29, 0.95) !important;
  backdrop-filter: blur(20px) !important;
}

main, section, header, nav, footer {
  max-width: 100%;
}

/* Horizontal Scroll without visible scrollbar */
.no-scrollbar, [class*="overflow-x-auto"] {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
  min-width: 0;
}
.no-scrollbar::-webkit-scrollbar, [class*="overflow-x-auto"]::-webkit-scrollbar {
  display: none;
}

/* =========================================================
   Ultra-Smooth Page Transitions
   ========================================================= */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: 140ms cubic-bezier(0.4, 0, 1, 1) both pageViewFadeOut;
}

::view-transition-new(root) {
  animation: 220ms cubic-bezier(0.16, 1, 0.3, 1) both pageViewFadeIn;
}

@keyframes pageViewFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes pageViewFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

main {
  /* Instant solid rendering on reload, zero stutter / no layout shift */
  opacity: 1;
  transform: none;
}

body.page-is-exiting {
  opacity: 0.95 !important;
  transition: opacity 0.08s ease-out !important;
}

/* Top Slim Neon Cyber Progress Bar */
#page-transition-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2.5px;
  background: linear-gradient(90deg, #00f0ff 0%, #38bdf8 50%, #10b981 100%);
  z-index: 999999;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.9), 0 0 20px rgba(56, 189, 248, 0.6);
  pointer-events: none;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  opacity: 0;
}

#page-transition-bar.animating {
  opacity: 1;
}

@keyframes contentGlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-content-in {
  animation: contentGlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  body,
  body.page-is-exiting,
  .animate-content-in,
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* =========================================================
   Typography
   ========================================================= */
html[lang="vi"],
html[lang="vi"] body,
html[lang="vi"] button,
html[lang="vi"] input,
html[lang="vi"] textarea,
html[lang="vi"] select,
html[lang="vi"] h1,
html[lang="vi"] h2,
html[lang="vi"] h3,
html[lang="vi"] h4,
html[lang="vi"] h5,
html[lang="vi"] h6,
html[lang="vi"] p,
html[lang="vi"] span,
html[lang="vi"] a,
html[lang="vi"] li,
html[lang="vi"] div,
html[lang="vi"] label {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif !important;
}

html[lang="vi"] h1,
html[lang="vi"] h2,
html[lang="vi"] h3,
html[lang="vi"] h4,
html[lang="vi"] h5,
html[lang="vi"] h6,
html[lang="vi"] .font-display {
  font-family: 'Space Grotesk', 'Be Vietnam Pro', sans-serif !important;
  letter-spacing: -0.01em !important;
}

html[lang="zh"],
html[lang="zh"] body {
  font-family: var(--font-zh) !important;
}

html[lang="en"],
html[lang="en"] body {
  font-family: var(--font-main);
}
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="en"] h4,
html[lang="en"] .font-display {
  font-family: var(--font-display);
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
}

.font-mono, [class*="font-mono"] {
  font-family: var(--font-mono), monospace !important;
}

/* =========================================================
   Hero Cybernetic Backdrop
   ========================================================= */
.hero-glow-backdrop {
  position: relative;
  overflow: hidden;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(circle at 50% 12%, rgba(6, 182, 212, 0.10) 0%, rgba(37, 99, 235, 0.06) 38%, rgba(248, 250, 252, 0.95) 85%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.8) 0%, rgba(248, 250, 252, 1) 100%);
  background-size: 100% 100%, 100% 100%;
  background-position: center top;
}

.hero-glow-backdrop::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 650px;
  background: radial-gradient(
    ellipse at center,
    rgba(6, 182, 212, 0.18) 0%,
    rgba(14, 165, 233, 0.12) 30%,
    transparent 70%
  );
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

html.dark .hero-glow-backdrop, body.dark .hero-glow-backdrop {
  background-color: #07080e !important;
  background-image: 
    radial-gradient(circle at 50% 12%, rgba(6, 182, 212, 0.22) 0%, rgba(37, 99, 235, 0.20) 38%, rgba(7, 8, 14, 0.98) 85%),
    linear-gradient(180deg, rgba(7, 8, 14, 0.75) 0%, rgba(7, 8, 14, 0.98) 100%) !important;
}

html.dark .hero-glow-backdrop::before, body.dark .hero-glow-backdrop::before {
  background: radial-gradient(
    ellipse at center,
    rgba(6, 182, 212, 0.32) 0%,
    rgba(14, 165, 233, 0.25) 30%,
    rgba(16, 185, 129, 0.12) 60%,
    transparent 78%
  ) !important;
}

/* Ambient Cyber Glow behind cards */
.cosmic-card-glow, .cyber-card-glow {
  box-shadow: 0 15px 45px -12px rgba(6, 182, 212, 0.18);
}

.dark .cosmic-card-glow, .dark .cyber-card-glow {
  box-shadow: 0 20px 50px -15px rgba(6, 182, 212, 0.25);
}

/* High-Tech Terminal Pill Badge */
.glow-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #0284c7;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 15px -3px rgba(6, 182, 212, 0.25);
}

.dark .glow-pill-badge {
  background: rgba(8, 47, 73, 0.4);
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

/* Gradient Text Highlights - Electric Cyan to Arctic Sky */
/* High contrast ocean sapphire gradient in light mode, electric neon cyan in dark mode */
.text-gradient-purple, .text-gradient-cyan {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.dark .text-gradient-purple,
html.dark .text-gradient-cyan {
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 45%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #00f0ff, #38bdf8, #10b981);
  z-index: 100;
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.8);
}

/* Coupon Box Scissor Border with Cyan Accent */
.coupon-box {
  border: 2px dashed #06b6d4;
  position: relative;
  background: #f0fdfa;
}

.dark .coupon-box {
  background: rgba(6, 182, 212, 0.08);
  border-color: #06b6d4;
}

.coupon-box::before,
.coupon-box::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  transform: translateY(-50%);
}

.dark .coupon-box::before,
.dark .coupon-box::after {
  background-color: #07080e;
}

.coupon-box::before { left: -11px; }
.coupon-box::after { right: -11px; }

/* High-Performance Card Hover & Tactile Selection Elevation */
.card-hover {
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.22s ease !important;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px -8px rgba(6, 182, 212, 0.25), 0 0 20px -5px rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6) !important;
}

.card-hover:active {
  transform: scale(0.985) translateY(-2px);
  box-shadow: 0 8px 18px -4px rgba(6, 182, 212, 0.3);
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out !important;
}

/* Zero-Jank Fluid Grid Transition Classes */
.grid-transition-out {
  opacity: 0.15 !important;
  transform: translateY(-4px) scale(0.995) !important;
  transition: opacity 0.09s ease-out, transform 0.09s ease-out !important;
  pointer-events: none;
}

.grid-transition-in {
  animation: gridCardsGlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  will-change: opacity, transform;
}

@keyframes gridCardsGlideIn {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid-transition-in > article:nth-child(1), .grid-transition-in > div:nth-child(1) { animation-delay: 0ms; }
.grid-transition-in > article:nth-child(2), .grid-transition-in > div:nth-child(2) { animation-delay: 20ms; }
.grid-transition-in > article:nth-child(3), .grid-transition-in > div:nth-child(3) { animation-delay: 40ms; }
.grid-transition-in > article:nth-child(4), .grid-transition-in > div:nth-child(4) { animation-delay: 60ms; }
.grid-transition-in > article:nth-child(5), .grid-transition-in > div:nth-child(5) { animation-delay: 80ms; }
.grid-transition-in > article:nth-child(6), .grid-transition-in > div:nth-child(6) { animation-delay: 100ms; }

/* Interactive Tactile Pill and Button Click Feedback */
.cat-pill, .spotlight-filter-btn {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
  will-change: transform;
}
.cat-pill:active, .spotlight-filter-btn:active {
  transform: scale(0.94) !important;
  transition: transform 0.05s ease-out !important;
}

/* High-Converting Shimmer Button */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: rotate(30deg);
  animation: shimmer 3.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(30deg); }
  30% { transform: translateX(100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

/* Sticky Mobile CTA */
.sticky-mobile-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  box-shadow: 0 -4px 25px rgba(6, 182, 212, 0.2);
  transition: transform 0.3s ease;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Top Announcement Bar Continuous Smooth Marquee Ticker */
@keyframes tickerMarquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.animate-top-ticker {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: tickerMarquee 42s linear infinite;
}

.animate-top-ticker:hover {
  animation-play-state: paused;
}

.ticker-item {
  transition: all 0.2s ease;
}

.ticker-item:hover {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

/* Responsive Comparison Table */
.comparison-table-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 1.5rem;
}

.comparison-table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.comparison-table-wrapper::-webkit-scrollbar-track {
  background: rgba(6, 182, 212, 0.06);
  border-radius: 9999px;
}
.comparison-table-wrapper::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 9999px;
}
.comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.7);
}

.comparison-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th {
  padding: 0.9rem 1.2rem !important;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

.comparison-table td {
  padding: 1rem 1.2rem !important;
  font-size: 0.82rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
  line-height: 1.5;
}

.dark .comparison-table td {
  border-bottom: 1px solid rgba(56, 189, 248, 0.14);
}

.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.comparison-table tbody tr:hover {
  background-color: rgba(6, 182, 212, 0.04);
}

.dark .comparison-table tbody tr:hover {
  background-color: rgba(6, 182, 212, 0.1);
}

.comparison-table .comparison-highlight {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
}

.dark .comparison-table .comparison-highlight {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.14) 0%, rgba(37, 99, 235, 0.08) 100%);
}

/* Mega Menu Dropdown */
.catalogues-dropdown-container {
  position: relative;
}

.mega-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
  pointer-events: auto;
}

/* Tech Spec Pill */
.tech-spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-main);
  letter-spacing: -0.01em;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(8, 47, 73, 0.35);
  color: #38bdf8;
}

/* Human-Crafted Editorial Category Pills & Filters */
.cat-pill, .filter-btn {
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', system-ui, -apple-system, sans-serif !important;
  font-size: 0.8125rem !important; /* 13px clean human standard */
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  padding: 0.45rem 1rem !important;
  border-radius: 9999px !important; /* Smooth human pill */
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer !important;
  white-space: nowrap !important;
  user-select: none !important;
}

.cat-pill.hidden, .filter-btn.hidden,
button.cat-pill.hidden, button.filter-btn.hidden {
  display: none !important;
}

/* Light Mode: Wirecutter/Apple Style Clean Slate Pill */
.cat-pill, .filter-btn {
  background-color: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: none !important;
  transform: none !important;
}

.cat-pill:hover, .filter-btn:hover {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

.cat-pill.active, .filter-btn.active {
  background: #0f172a !important; /* Premium dark charcoal active pill in light mode */
  border-color: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18) !important;
  transform: none !important;
}

/* Dark Mode: Clean Obsidian & Crisp White Active Pill */
html.dark .cat-pill, html.dark .filter-btn,
body.dark .cat-pill, body.dark .filter-btn {
  background-color: #0e121d !important;
  border: 1px solid #1e293b !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  transform: none !important;
}

html.dark .cat-pill:hover, html.dark .filter-btn:hover,
body.dark .cat-pill:hover, body.dark .filter-btn:hover {
  background-color: #141926 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html.dark .cat-pill.active, html.dark .filter-btn.active,
body.dark .cat-pill.active, body.dark .filter-btn.active {
  background: #ffffff !important; /* Crisp white active pill in dark mode */
  border-color: #ffffff !important;
  color: #090b10 !important;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15) !important;
  transform: none !important;
}

/* Micro Telemetry Tags */
.telemetry-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Smooth Theme Transition only during explicit toggle */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease !important;
  transition-delay: 0s !important;
}
