/**
 * Application Gallery - Microsoft Fluent Design 2 & Windows 11 Theme
 * Responsive, Ultra-smooth, SEO & Retina optimized
 */

:root {
  /* Color Palette - Clean Fluent White (Default) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-acrylic: rgba(255, 255, 255, 0.85);
  --bg-surface: #f1f5f9;
  --bg-input: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-blue: #0078d4;
  --accent-blue-hover: #005a9e;
  --accent-cyan: #0284c7;
  --accent-gradient: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
  --accent-glow: rgba(0, 120, 212, 0.25);

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.1);
  --border-focus: #0078d4;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 35px -5px rgba(0, 0, 0, 0.12), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 35px var(--accent-glow);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  /* Color Palette - Windows 11 Fluent Dark Mode */
  --bg-primary: #0b0f17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-acrylic: rgba(15, 23, 42, 0.85);
  --bg-surface: #1e293b;
  --bg-input: #0f172a;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #0078d4;
  --accent-blue-hover: #106ebe;
  --accent-cyan: #00a4ef;
  --accent-gradient: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
  --accent-glow: rgba(0, 120, 212, 0.4);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-focus: #0078d4;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 35px -5px rgba(0, 0, 0, 0.5), 0 10px 15px -5px rgba(0, 0, 0, 0.3);
}

/* Base Reset & Fonts */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  color-scheme: dark light;
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

/* Background Ambient Glow Gradients */
.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb-1 {
  position: absolute;
  top: -150px;
  left: 20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 120, 212, 0.15) 0%, rgba(0, 120, 212, 0) 70%);
  filter: blur(80px);
}

.glow-orb-2 {
  position: absolute;
  top: 30%;
  right: -100px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0) 70%);
  filter: blur(90px);
}

.glow-orb-3 {
  position: absolute;
  bottom: -100px;
  left: 10%;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0) 70%);
  filter: blur(80px);
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-acrylic);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-smooth);
  padding-top: env(safe-area-inset-top, 0px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 60px;
}

.nav-logo img, .nav-logo svg {
  height: 56px;
  width: auto;
  max-height: 60px;
}

/* Light / Dark Logo Switching */
.logo-dark {
  display: none !important;
}
.logo-light {
  display: block !important;
}

[data-theme="dark"] .logo-light {
  display: none !important;
}
[data-theme="dark"] .logo-dark {
  display: block !important;
  filter: drop-shadow(0 0 10px rgba(96, 205, 255, 0.45));
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--border-subtle);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-smooth);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 120, 212, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #106ebe 0%, #0078d4 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 120, 212, 0.45);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-card);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-card);
}

.btn-outline:hover {
  background: var(--border-subtle);
  border-color: var(--text-secondary);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon-only {
  padding: 0.6rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-icon-only:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-card);
}

/* Store Badge Buttons */
.store-badge-btn {
  display: inline-block;
  transition: transform var(--transition-smooth), filter var(--transition-smooth);
  text-decoration: none;
  line-height: 0;
}

.store-badge-btn img, .store-badge-btn svg {
  height: 52px;
  width: auto;
  border-radius: 10px;
}

.store-badge-btn:hover {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 8px 18px rgba(0, 120, 212, 0.3));
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

/* Hero Section */
.hero {
  padding: 1.5rem 0 1rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  background: rgba(0, 120, 212, 0.12);
  border: 1px solid rgba(0, 120, 212, 0.3);
  color: var(--accent-cyan);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-powered-by {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding: 0.5rem 1.35rem;
  border-radius: var(--radius-full);
  background: rgba(0, 120, 212, 0.08);
  border: 1px solid rgba(0, 120, 212, 0.2);
  letter-spacing: 0.02em;
}

.hero-powered-by strong {
  color: var(--accent-blue);
  font-weight: 800;
}

[data-theme="dark"] .hero-powered-by {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: #cbd5e1;
}

[data-theme="dark"] .hero-powered-by strong {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.hero-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.65rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #60cdff 0%, #0078d4 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.02rem;
  color: var(--text-secondary);
  max-width: 950px;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}

/* Hero Metrics / Trust Badges */
.hero-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

.hero-badge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.hero-badge-item svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}

/* Search & Filter Toolbar */
.toolbar-section {
  padding: 1.2rem 0;
  position: sticky;
  top: 88px;
  z-index: 90;
  background: var(--bg-acrylic);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  scroll-margin-top: 96px;
}

.toolbar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Search Input */
.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 450px;
}

.search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Platform Filter Pills */
.platform-filter {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.platform-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.platform-btn.active, .pricing-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.pricing-btn {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pricing-btn:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

/* Category Filter Chips */
.category-chips {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.category-chips::-webkit-scrollbar {
  height: 4px;
}

.chip {
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

.chip.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
  font-weight: 700;
}

/* App Gallery Grid */
#apps, #appsGallery, .apps-grid {
  scroll-margin-top: 235px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.75rem;
  margin-bottom: 4rem;
}

/* App Card (Fluent Mica Card) */
.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.app-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 120, 212, 0.4);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  background: var(--bg-card-hover);
}

.app-card:hover::before {
  opacity: 1;
}

/* Card Header */
.app-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.app-card-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-spring);
}

.app-card:hover .app-card-icon {
  transform: scale(1.06);
}

.app-card-icon img, .app-card-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.app-card-badge-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.42rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
  line-height: 1.1;
  display: inline-flex;
  align-items: center;
}

.tag-badge-accent {
  background: rgba(0, 120, 212, 0.2);
  color: #60cdff;
  border: 1px solid rgba(0, 120, 212, 0.3);
}

.tag-badge-category {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.tag-badge-windows {
  background: rgba(0, 120, 212, 0.12);
  color: #0078d4;
  border: 1px solid rgba(0, 120, 212, 0.25);
}
[data-theme="dark"] .tag-badge-windows {
  background: rgba(0, 120, 212, 0.25);
  color: #60cdff;
  border-color: rgba(96, 205, 255, 0.4);
}

.tag-badge-android {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
[data-theme="dark"] .tag-badge-android {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.4);
}

.tag-badge-web {
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .tag-badge-web {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border-color: rgba(165, 180, 252, 0.4);
}

.tag-badge-free {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .tag-badge-free {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
}

.tag-badge-premium {
  background: rgba(168, 85, 247, 0.14);
  color: #7c3aed;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
[data-theme="dark"] .tag-badge-premium {
  background: rgba(168, 85, 247, 0.28);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.45);
}

.app-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.app-card-tagline {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Metrics Row (Ratings, Downloads, Version) */
.app-card-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 0;
  margin-bottom: 1rem;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-item .star {
  color: #fbbf24;
}

/* Card Feature Bullets */
.app-card-features {
  list-style: none;
  margin-bottom: 1.25rem;
  flex: 1;
}

.app-card-features li {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.app-card-features li svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 0.18rem;
}

.app-card-features li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.app-card-features .app-card-more-features {
  margin-top: -0.15rem;
  margin-bottom: 0;
  padding-left: 1.35rem;
}

.app-card-more-dots {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  line-height: 1;
}

/* Card Actions */
.app-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.app-card-actions .btn {
  flex: 1;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 5rem 1rem;
  grid-column: 1 / -1;
}

.empty-state svg {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Feature Spotlight / Value Props */
.section-features {
  padding: 5rem 0;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: 96px;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition-smooth), border-color var(--transition-smooth);
}

.feature-box:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(0, 120, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.feature-box h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.feature-box p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ==========================================================================
   APP DETAIL PAGE (app.html)
   ========================================================================== */

.breadcrumb-nav {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.breadcrumb-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.app-hero-section {
  padding: 2rem 0 3.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.app-hero-grid {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.app-hero-icon {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.app-hero-icon img, .app-hero-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-hero-info h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.app-hero-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.app-hero-badges {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.app-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: stretch;
  min-width: 240px;
}

/* Detail Tabs Navigation */
.detail-tabs-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin: 2.5rem 0 2rem;
  overflow-x: auto;
}

.detail-tab {
  padding: 0.85rem 0.5rem;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.detail-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* Screenshot Carousel / Gallery */
.screenshots-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.screenshot-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.screenshot-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-blue);
}

.screenshot-item img, .screenshot-item svg {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-caption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
}

/* YouTube Video Guide Container */
.video-guide-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3.5rem;
}

.video-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.video-guide-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.video-aspect-ratio {
  position: relative;
  width: 75%;
  max-width: 850px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-lg);
}

@supports not (aspect-ratio: 16 / 9) {
  .video-aspect-ratio {
    padding-bottom: 42.1875%; /* (75% * 56.25%) */
  }
}

.video-aspect-ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 768px) {
  .video-aspect-ratio {
    width: 100%;
  }
  @supports not (aspect-ratio: 16 / 9) {
    .video-aspect-ratio {
      padding-bottom: 56.25%;
    }
  }
}

/* Combined Features & Manual Section */
.features-manual-section {
  margin-bottom: 3.5rem;
}

.features-bullet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.features-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.feature-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.feature-bullet-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.feature-bullet-content {
  flex: 1;
}

.feature-bullet-title {
  color: var(--text-primary);
  font-weight: 600;
  margin-right: 0.35rem;
}

.feature-bullet-desc {
  color: var(--text-secondary);
}

/* User Manual PDF Download Box */
.manual-download-card {
  margin-top: 1.75rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0%, rgba(0, 120, 212, 0.05) 100%), var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  transition: border-color var(--transition-fast);
}

.manual-download-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

.manual-card-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 260px;
}

.manual-pdf-badge {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.manual-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.manual-card-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.download-manual-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .features-bullet-card {
    padding: 1.25rem 1.25rem;
  }
  .manual-download-card {
    padding: 1.25rem;
    flex-direction: column;
    align-items: stretch;
  }
  .manual-card-right {
    width: 100%;
  }
  .download-manual-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Key Features Section */
.app-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.app-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  transition: transform var(--transition-fast);
}

.app-feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
}

.app-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(0, 120, 212, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.app-feature-content h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.app-feature-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Documentation / User Manual Center */
.manual-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3.5rem;
}

.manual-sidebar {
  border-right: 1px solid var(--border-subtle);
  padding-right: 1.5rem;
}

.manual-sidebar h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.manual-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.manual-nav-item {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.manual-nav-item:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

.manual-nav-item.active {
  color: var(--accent-cyan);
  background: rgba(0, 120, 212, 0.15);
  font-weight: 600;
}

.manual-content-view {
  min-height: 350px;
}

.manual-content-view h4 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.manual-content-view h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--accent-cyan);
}

.manual-content-view p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.manual-content-view ol, .manual-content-view ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.manual-content-view li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  border-left: 4px solid var(--accent-blue);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.92rem;
}

.callout-info {
  border-left-color: #0078d4;
  background: rgba(0, 120, 212, 0.1);
}

kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

code {
  font-family: Consolas, 'Fira Code', monospace;
  font-size: 0.88rem;
  background: var(--bg-surface);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: #f472b6;
}

.table-spec {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.table-spec th, .table-spec td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.table-spec th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.table-spec td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  width: 35%;
}

.table-spec td:last-child {
  color: var(--text-secondary);
}

/* System Requirements & Specifications */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.spec-card h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img, .lightbox-content svg {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================================================
   APP GENERATOR / MANAGEMENT TOOL (manage.html)
   ========================================================================== */

.manage-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 3.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group label span {
  color: var(--text-muted);
  font-weight: 400;
}

.form-control {
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.code-output-container {
  margin-top: 2rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  color: #c9d1d9;
  font-size: 0.85rem;
  font-weight: 600;
}

.code-output-body {
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  font-family: Consolas, 'Fira Code', monospace;
  font-size: 0.88rem;
  color: #58a6ff;
  white-space: pre;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand img {
  height: 54px;
  width: auto;
  max-width: 280px;
}

.footer-powered-by {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.footer-powered-by strong {
  color: var(--accent-blue);
  font-weight: 800;
}

[data-theme="dark"] .footer-powered-by strong {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin: 0.75rem 0 1.5rem;
  max-width: 380px;
  line-height: 1.65;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .app-hero-grid {
    grid-template-columns: 120px 1fr;
  }
  .app-hero-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-container {
    height: 70px;
  }

  .nav-logo {
    height: 48px;
  }

  .nav-logo img, .nav-logo svg {
    height: 44px;
  }

  /* Solid full-screen overlay backdrop */
  .nav-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth);
  }

  .nav-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* 100% Opaque Mobile Navigation Drawer */
  .nav-menu {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top, 0px));
    left: 0;
    width: 100%;
    background: var(--bg-secondary) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 2px solid var(--border-card);
    flex-direction: column;
    padding: 1.25rem 1.25rem 2rem;
    gap: 0.65rem;
    transform: translateY(-160%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    z-index: 99999;
    max-height: calc(100vh - 70px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
  }

  .nav-menu.active {
    transform: translateY(0);
  }

  .nav-menu li {
    width: 100%;
    list-style: none;
  }

  .nav-menu .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: all var(--transition-fast);
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
  }

  .mobile-nav-toggle {
    display: block;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
  }

  .hero {
    padding: 1.25rem 0 0.75rem;
  }

  .hero-title {
    font-size: 1.55rem;
    margin-bottom: 0.5rem;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    margin-bottom: 1rem;
    line-height: 1.45;
  }

  .hero-badges {
    gap: 1.25rem;
    margin-top: 1rem;
    padding-top: 1rem;
  }

  html {
    scroll-padding-top: 76px;
  }

  #apps, #appsGallery, .apps-grid {
    scroll-margin-top: 200px;
  }

  .toolbar-section {
    top: calc(70px + env(safe-area-inset-top, 0px));
    scroll-margin-top: 76px;
  }

  .section-features {
    scroll-margin-top: 82px;
  }

  .toolbar-top {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

  .platform-filter {
    justify-content: center;
  }

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

  .manual-container {
    grid-template-columns: 1fr;
  }

  .manual-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 1.5rem;
  }

  .app-hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .app-hero-icon {
    margin: 0 auto;
  }

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

  .app-hero-actions {
    flex-direction: column;
  }

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