/* ============================================
   APK Downloader — Custom Styles
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Dark Theme (Default) */
  --bg-primary: #0a0a12;
  --bg-secondary: #10101c;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(255, 255, 255, 0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
  --accent-gradient-reverse: linear-gradient(135deg, #06b6d4, #3b82f6);
  --success: #10b981;
  --success-hover: #059669;
  --error: #ef4444;
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
  --navbar-blur: 16px;
  --transition-speed: 0.18s;

  /* Custom Color Accents */
  --accent-blue-dim: rgba(79, 195, 247, 0.12);
  --accent-purple: #B388FF;
  --accent-purple-dim: rgba(179, 136, 255, 0.12);
  --accent-orange: #FFB74D;
  --accent-orange-dim: rgba(255, 183, 77, 0.12);
  --accent-cyan-dim: rgba(6, 182, 212, 0.12);
  --accent-pink: #FF80AB;
  --accent-pink-dim: rgba(255, 128, 171, 0.12);

  /* Spacing Tokens */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Transitions & Animation Eases */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 300ms;
  --duration-slow: 500ms;
  --duration-slower: 700ms;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 4rem;
}

.light {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --border-card: rgba(0, 0, 0, 0.08);
  --border-card-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.1);

  --accent-blue-dim: rgba(79, 195, 247, 0.1);
  --accent-purple-dim: rgba(179, 136, 255, 0.1);
  --accent-orange-dim: rgba(255, 183, 77, 0.1);
  --accent-cyan-dim: rgba(6, 182, 212, 0.1);
  --accent-pink-dim: rgba(255, 128, 171, 0.1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.5);
}

/* ---------- Animated Gradient Mesh Background (Hero) ---------- */
.hero-gradient-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-gradient-bg::before {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  top: -25%;
  left: -25%;
  background:
    radial-gradient(ellipse 600px 600px at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 70% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 700px 700px at 50% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 80% 70%, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  animation: gradientShift 15s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  33% {
    transform: translate(30px, -20px) rotate(1deg);
  }

  66% {
    transform: translate(-20px, 15px) rotate(-1deg);
  }

  100% {
    transform: translate(10px, -10px) rotate(0.5deg);
  }
}

/* Noise texture overlay for hero */
.hero-gradient-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- Floating Particles ---------- */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

.particle:nth-child(1) {
  left: 10%;
  animation-duration: 20s;
  animation-delay: 0s;
  width: 3px;
  height: 3px;
}

.particle:nth-child(2) {
  left: 25%;
  animation-duration: 25s;
  animation-delay: -5s;
  width: 5px;
  height: 5px;
  background: rgba(6, 182, 212, 0.2);
}

.particle:nth-child(3) {
  left: 40%;
  animation-duration: 18s;
  animation-delay: -3s;
}

.particle:nth-child(4) {
  left: 55%;
  animation-duration: 22s;
  animation-delay: -8s;
  width: 6px;
  height: 6px;
  background: rgba(99, 102, 241, 0.2);
}

.particle:nth-child(5) {
  left: 70%;
  animation-duration: 28s;
  animation-delay: -12s;
  width: 3px;
  height: 3px;
}

.particle:nth-child(6) {
  left: 85%;
  animation-duration: 19s;
  animation-delay: -6s;
  background: rgba(6, 182, 212, 0.25);
}

.particle:nth-child(7) {
  left: 15%;
  animation-duration: 24s;
  animation-delay: -10s;
  width: 5px;
  height: 5px;
}

.particle:nth-child(8) {
  left: 60%;
  animation-duration: 21s;
  animation-delay: -4s;
  width: 3px;
  height: 3px;
  background: rgba(99, 102, 241, 0.15);
}

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}

/* ---------- Glassmorphism ---------- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  transition: background var(--transition-speed) ease,
              border-color var(--transition-speed) ease,
              transform var(--transition-speed) ease,
              box-shadow var(--transition-speed) ease;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-glow);
}

.glass-nav {
  background: rgba(10, 10, 18, 0.75);
  backdrop-filter: blur(var(--navbar-blur));
  -webkit-backdrop-filter: blur(var(--navbar-blur));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.light .glass-nav {
  background: rgba(248, 250, 252, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.glass-search {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(59, 130, 246, 0.05);
}

.light .glass-search {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.08),
    0 0 40px rgba(59, 130, 246, 0.05);
}

/* ---------- Glow Effects ---------- */
.glow-border {
  position: relative;
  overflow: hidden;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0), rgba(6, 182, 212, 0));
  z-index: -1;
  transition: background var(--transition-speed) ease;
}

.glow-border:hover::before {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(6, 182, 212, 0.3));
}

.glow-button {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-speed) ease;
}

.glow-button::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.glow-button:hover::after {
  opacity: 1;
}

.glow-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

/* Pulsing glow on primary CTA */
.pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2), 0 0 30px rgba(59, 130, 246, 0.1);
  }

  50% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 50px rgba(59, 130, 246, 0.2);
  }
}

/* ---------- Scroll Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

.reveal-delay-5 {
  transition-delay: 0.5s;
}

.reveal-delay-6 {
  transition-delay: 0.6s;
}

/* ---------- Feature Cards ---------- */
.feature-card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  flex-shrink: 0;
  transition: transform var(--transition-speed) ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
}

/* ---------- How It Works Steps ---------- */
.step-connector {
  position: relative;
}

.step-connector::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), rgba(6, 182, 212, 0.4));
  background-size: 8px 2px;
  background-repeat: repeat-x;
  transform: translateY(-50%);
}

@media (max-width: 768px) {
  .step-connector::after {
    top: 100%;
    left: 50%;
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.4), rgba(6, 182, 212, 0.4));
    background-size: 2px 8px;
    background-repeat: repeat-y;
    transform: translateX(-50%);
  }
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--accent-gradient);
  color: white;
  position: relative;
  z-index: 2;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.step-number:hover {
  transform: scale(1.15);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
}

/* ---------- FAQ Accordion ---------- */
.faq-item {
  border-bottom: 1px solid var(--border-card);
  overflow: hidden;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition-speed) ease;
}

.faq-question:hover {
  color: var(--accent-blue);
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent-blue);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding-bottom: 1.25rem;
}

.faq-answer-text {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ---------- Search Input Styles ---------- */
.search-input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-speed) ease;
}

.light .search-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

.light #config-toggle {
  color: #6b7280;
}

.light #config-toggle:hover {
  color: #111827;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input:focus::placeholder {
  opacity: 0.6;
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--accent-gradient);
  color: #fff;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--success), #047857);
  color: #fff;
  transition: all var(--transition-speed) ease;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.btn-success:active {
  transform: scale(0.98);
}

/* ---------- App Result Card ---------- */
.app-result {
  display: none;
  animation: slideDown 0.4s ease forwards;
}

.app-result.visible {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-icon {
  width: 80px;
  height: 80px;
  border-radius: 20%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (min-width: 640px) {
  .app-icon-lg {
    width: 140px;
    height: 140px;
  }
}

.info-grid-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  flex-shrink: 0;
}

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Language Dropdown ---------- */
.lang-dropdown {
  position: relative;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}

.light .lang-dropdown-menu {
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.lang-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-align: left;
}

.lang-option:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}

.lang-option.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  font-weight: 500;
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  color: var(--text-secondary);
}

.light .theme-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

.theme-toggle:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover svg {
  transform: rotate(20deg);
}

/* ---------- Mobile Menu ---------- */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-card);
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    border-radius: 8px;
  }

  .nav-links a:hover {
    background: rgba(59, 130, 246, 0.1);
  }
}

/* ---------- Prose Content ---------- */
.prose-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose-content h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* ---------- Gradient Text ---------- */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Divider ---------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border-card);
  margin: 0;
  border: none;
}

/* ---------- Error Text ---------- */
.error-text {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: none;
}

.error-text.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ---------- RTL Overrides ---------- */
[dir="rtl"] .faq-question {
  text-align: right;
}

[dir="rtl"] .faq-chevron {
  transform: scaleX(-1);
}

[dir="rtl"] .faq-item.active .faq-chevron {
  transform: scaleX(-1) rotate(180deg);
}

[dir="rtl"] .step-connector::after {
  left: auto;
  right: 100%;
}

[dir="rtl"] .lang-dropdown-menu {
  right: auto;
  left: 0;
}

[dir="rtl"] .search-input {
  text-align: right;
}

[dir="rtl"] .search-input::placeholder {
  text-align: right;
}

[dir="rtl"] .nav-links {
  direction: rtl;
}

/* ---------- Selection Color ---------- */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* ---------- Download Sources Grid ---------- */
.download-sources-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
  animation: slideDown 0.4s ease forwards;
}

@media (min-width: 640px) {
  .download-sources-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.download-sources-title {
  grid-column: 1 / -1;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.source-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-family: var(--font-body);
  width: 100%;
  text-align: left;
  color: var(--text-primary);
}

.light .source-btn {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

.source-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: var(--accent-gradient);
  transition: width 0.25s ease;
}

[dir="rtl"] .source-btn::before {
  left: auto;
  right: 0;
  border-radius: 0 3px 3px 0;
}

.source-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.light .source-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.source-btn:hover:not(:disabled)::before {
  width: 4px;
}

.source-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.source-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.source-btn .source-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}

.light .source-btn .source-icon {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

.source-btn:hover:not(:disabled) .source-icon {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.source-btn .source-text {
  flex: 1;
  min-width: 0;
}

.source-btn .source-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.source-btn .source-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sources-section .download-sources-title {
  display: none;
}

.source-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 20px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.source-tag--direct {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.source-tag--available {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.source-tag--redirect {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.source-tag--unavailable {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
}

.source-tag--loading {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.source-btn .source-arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.25s ease;
}

.source-btn:hover:not(:disabled) .source-arrow {
  color: var(--text-primary);
  transform: translateX(2px);
}

[dir="rtl"] .source-btn:hover:not(:disabled) .source-arrow {
  transform: translateX(-2px) scaleX(-1);
}

[dir="rtl"] .source-btn .source-arrow {
  transform: scaleX(-1);
}

/* Source skeleton loading */
.source-btn--loading {
  pointer-events: none;
}

.source-btn--loading .source-icon,
.source-btn--loading .source-name,
.source-btn--loading .source-meta {
  position: relative;
  overflow: hidden;
}

.source-btn--loading .source-name::after,
.source-btn--loading .source-meta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.5s infinite;
}

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

  100% {
    transform: translateX(100%);
  }
}

/* Download all button (spans full width) */
.download-all-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0;
}

.download-all-divider::before,
.download-all-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-card);
}

.download-all-divider span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ---------- Transition Classes ---------- */
.transition-theme {
  transition: background-color var(--transition-speed) ease,
    color var(--transition-speed) ease,
    border-color var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

/* ---------- Search Dropdown (Phase 2) ---------- */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
  animation: dropdownSlide 0.2s ease;
}

.light .search-dropdown {
  background: #fff;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-dropdown-loading,
.search-dropdown-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
  text-align: left;
}

.search-result-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.search-result-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
}

.search-result-icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}

.search-result-info {
  min-width: 0;
  flex: 1;
}

.search-result-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-pkg {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Download Progress & States ---------- */
.source-btn--downloading {
  pointer-events: none;
  opacity: 0.9;
  border-color: rgba(59, 130, 246, 0.4) !important;
}

.source-btn--downloading .source-name {
  color: #60a5fa !important;
}

.source-btn--success {
  border-color: rgba(34, 197, 94, 0.4) !important;
}

.source-btn--success .source-name {
  color: #22c55e !important;
}

/* ========================================
   DOWNLOAD HISTORY
   ======================================== */
.download-history {
  margin-top: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.light .download-history {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.light .history-header {
  border-color: rgba(0, 0, 0, 0.06);
}

.history-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
  letter-spacing: 0.02em;
}

.history-clear-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.history-clear-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.light .history-item {
  border-color: rgba(0, 0, 0, 0.04);
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.light .history-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.history-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
}

.history-icon-placeholder {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.history-arrow {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s;
}

.history-item:hover .history-arrow {
  opacity: 1;
  transform: translateX(0);
}

.download-progress-bar {
  display: block;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.light .download-progress-bar {
  background: rgba(0, 0, 0, 0.08);
}

.download-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.download-progress-text {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- App Metadata Card (Phase 3) ---------- */
.app-meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: slideDown 0.4s ease forwards;
}

.app-meta-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.app-meta-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  flex-shrink: 0;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.app-meta-icon--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 1px solid var(--border-card);
}

.app-meta-info {
  min-width: 0;
  flex: 1;
}

.app-meta-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.125rem 0;
  color: var(--text-primary);
}

.app-meta-developer {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.app-meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.app-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.light .app-meta-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Custom category and rating badge colors removed to ensure consistency with standard metadata badge */

.app-meta-desc {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-card);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.app-meta-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-meta-link:hover {
  color: var(--accent-cyan);
}

@media (max-width: 480px) {
  .app-meta-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .app-meta-badges {
    justify-content: center;
  }
}

/* ---------- Screenshot Carousel ---------- */
.app-meta-screenshots {
  display: flex;
  gap: 0.625rem;
  overflow-x: auto;
  padding: 0.875rem 0;
  margin-top: 0.875rem;
  border-top: 1px solid var(--border-card);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.app-meta-screenshots::-webkit-scrollbar {
  height: 4px;
}

.app-meta-screenshots::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.light .app-meta-screenshots::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
}

.app-meta-screenshots img {
  height: 200px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  object-fit: cover;
}

/* ---------- What's New Section ---------- */
.app-meta-whatsnew {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--border-card);
}

.app-meta-whatsnew-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.app-meta-whatsnew-content {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: pre-line;
  max-height: 120px;
  overflow-y: auto;
}

/* ---------- File Size Badge ---------- */
.app-meta-badge--size {
  background: rgba(139, 92, 246, 0.1);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.2);
}

.light .app-meta-badge--size {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  border-color: rgba(124, 58, 237, 0.2);
}

/* ---------- App Catalog Category Section ---------- */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}

.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (max-width: 767.98px) {
  #category-selector-container {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  }
}

.cat-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  transition: all var(--transition-speed) ease;
}

.cat-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.cat-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.light .cat-btn.active {
  color: #ffffff !important;
}

.catalog-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  border-radius: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  transition: all var(--transition-speed) ease;
  cursor: pointer;
  text-decoration: none;
}

.catalog-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.catalog-skeleton {
  border-radius: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  height: 12rem;
}

/* ---------- Configuration Selects ---------- */
.config-select {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.light .config-select {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.config-select option {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}


/* ============================================================
   UPGRADED COMPONENTS (STEPS, FEATURES, FOOTER)
   ============================================================ */

/* ---------- How It Works (Steps) ---------- */
.steps__grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.steps__card {
  flex: 0 1 240px;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  position: relative;
}

.steps__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 800;
  margin-bottom: var(--space-5);
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

.steps__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  transition: border-color var(--duration-base) ease,
    color var(--duration-base) ease,
    background var(--duration-base) ease,
    transform var(--duration-base) var(--ease-spring),
    box-shadow var(--duration-base) ease;
}

.steps__card:hover .steps__icon {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 0 40px rgba(6, 182, 212, 0.25);
}

.steps__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.steps__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.steps__connector {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--space-8) + 36px + var(--space-5) + 24px);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---------- Features Section ---------- */
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.features__card {
  position: relative;
  padding: var(--space-8);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  transition: border-color var(--duration-base) ease,
    transform var(--duration-base) var(--ease-spring),
    box-shadow var(--duration-base) ease,
    opacity var(--duration-slow) ease;
  overflow: hidden;
}

.features__card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transition: transform var(--duration-base) ease;
}

.features__card:hover::before {
  transform: scaleX(1);
}

.features__card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.features__card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, currentColor 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration-slow) ease;
  pointer-events: none;
}

.features__card:hover .features__card-glow {
  opacity: 0.03;
}

.features__card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: var(--space-5);
  transition: transform var(--duration-base) var(--ease-spring);
  background: var(--accent-gradient);
  color: #ffffff;
}

.features__card:hover .features__card-icon {
  transform: scale(1.1);
}

.features__card h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.features__card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---------- Upgraded Footer ---------- */
.footer {
  padding: var(--space-16) 0 var(--space-8);
  border-top: 1px solid var(--border-card);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--border-card);
  margin-bottom: var(--space-8);
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: var(--space-4);
}

.footer__logo svg {
  color: var(--accent-cyan);
}

.footer__logo:hover {
  color: var(--text-primary);
}

.footer__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 320px;
}

.footer__col h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.footer__col a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--duration-fast) ease;
  text-decoration: none;
}

.footer__col a:hover {
  color: var(--accent-cyan);
}

.footer__bottom {
  text-align: center;
  margin-top: var(--space-8);
}

.footer__bottom p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.footer__disclaimer {
  font-size: var(--text-xs) !important;
  color: var(--text-muted) !important;
  opacity: 0.7;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.6;
}

.footer__safety {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.safety-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.safety-item svg {
  flex-shrink: 0;
}

.footer__trending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-card);
  font-size: var(--text-xs);
}

.footer__trending .trending-title {
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer__trending a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer__trending a:hover {
  color: var(--accent-cyan);
}

.footer__languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4) var(--space-6);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  margin-bottom: var(--space-6);
  border-top: 1px solid var(--border-card);
  font-size: var(--text-xs);
}

.footer__languages a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

.footer__languages a:hover {
  color: var(--accent-cyan);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 1024px) {
  .steps__grid {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .steps__connector {
    display: none;
  }

  .steps__card {
    flex: 0 1 calc(50% - var(--space-4));
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer__brand {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .steps__card {
    flex: 1 1 100%;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__brand {
    grid-column: span 1;
  }

  .hero__trust {
    flex-direction: column;
    gap: var(--space-3);
  }

  .hero__trust-divider {
    display: none;
  }
}

/* ---------- Trust Indicators & Ratings ---------- */
.hero__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.hero__trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.hero__trust-item svg {
  color: var(--accent-blue);
  flex-shrink: 0;
}

.hero__trust-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.hero__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.hero__stars {
  display: flex;
  gap: 2px;
  color: var(--accent-blue);
}

.hero__rating-text {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Version History Table ---------- */
.version-history-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.5rem;
}

.version-history-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}

.version-history-table th {
  text-align: left;
  padding: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.light .version-history-table th {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.version-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background-color 0.2s ease;
}

.light .version-row {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

.version-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.light .version-row:hover {
  background: rgba(0, 0, 0, 0.01);
}

.version-name-cell {
  padding: 0.625rem 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.version-code-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 0.35rem;
}

.light .version-code-tag {
  background: rgba(0, 0, 0, 0.04);
}

.version-date-cell {
  padding: 0.625rem 0.5rem;
  color: var(--text-secondary);
}

.version-action-cell {
  padding: 0.625rem 0.5rem;
  text-align: right;
}

.version-dl-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.version-dl-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ---------- APKs Installer Banner ---------- */
.apks-install-note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.apks-install-note-title {
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 0.15rem;
}

.apks-install-note svg {
  color: var(--accent-blue);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* Monochrome Catalog Cards (Light Mode Override) */
.light .catalog-card .cat-bg {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}
.light .catalog-card:hover .cat-bg {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.9);
}
.light .catalog-card .cat-badge {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.6);
}
.light .catalog-card:hover .cat-badge {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.9);
}