/* =============================================================
   layout.css — Navbar, Hero, Sections, Footer, Responsive
   AQCore © 2026
   ============================================================= */

/* ── NAVBAR ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 25, 47, 0.96);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .navbar.scrolled {
  background: rgba(240, 244, 248, 0.96);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.logo-text span {
  color: var(--accent);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  font-size: 1rem;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-nav {
  background: var(--accent);
  color: #0A192F;
  padding: 0.45rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-nav:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
}

/* Hamburger + Mobile menu */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.hamburger:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 1.5rem;
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.mobile-menu a:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 3rem) 2rem 4rem;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.hero-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #38BDF8, transparent);
  top: -200px;
  right: -100px;
}

.hero-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #0EA5E9, transparent);
  bottom: 0;
  left: -100px;
}

.hero-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #7C3AED, transparent);
  top: 40%;
  left: 20%;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-content {
  text-align: center;
  max-width: 820px;
  width: 100%;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.8s ease both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--border-hover);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -1.5px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent), #7C3AED, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.75;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Search bar */
.search-wrapper {
  max-width: 580px;
  margin: 0 auto 2rem;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  gap: 0.75rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1), 0 4px 24px rgba(0, 0, 0, 0.25);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.btn-search {
  background: var(--accent);
  color: #0A192F;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-search:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Hero buttons */
.hero-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #0A192F;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.btn-outline {
  background: none;
  color: var(--text-primary);
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-hover);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Stats row */
.hero-stats {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── SECTION COMMONS ── */
.section {
  padding: 5rem 2rem;
}

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  font-size: 0.74rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Specific section backgrounds */
.categories    { background: var(--bg-secondary); }
.apps-section  { background: var(--bg-primary); }
.updates-section { background: var(--bg-secondary); }

/* ── FOOTER ── */
footer {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

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

.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 0.75rem;
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.social-btn:hover {
  background: var(--accent);
  color: #0A192F;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.28rem 0;
  transition: color 0.2s, padding-left 0.2s;
}

.footer-col a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── BACK TO TOP ── */
#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #0A192F;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-accent);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  z-index: 900;
  pointer-events: none;
}

#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#backToTop:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-links,
  .btn-nav { display: none; }

  .hamburger { display: block; }

  .hero h1  { font-size: 2rem; }
  .hero p   { font-size: 0.92rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero-stats  { gap: 1.5rem; }
  .section     { padding: 3.5rem 1.5rem; }
}

@media (max-width: 480px) {
  .navbar  { padding: 0 1rem; }
  .section { padding: 3rem 1rem; }
  .hero-btns { flex-direction: column; align-items: center; }

  .btn-primary,
  .btn-outline { width: 100%; justify-content: center; }

  .hero-stats { gap: 1rem; }
}
