/* ── Astrophy Shared Styles ── */
/* Extracted from landing.html — single source of truth for all lightweight web pages */

/*
  GOOGLE ADS GTAG: included automatically via api.js initPage().
  If you need to add it manually to a page that doesn't use api.js:
  <script async src="https://www.googletagmanager.com/gtag/js?id=AW-18061169373"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'AW-18061169373');
  </script>
*/

/*
  INSTALL BANNER TEMPLATE — copy this HTML into any page body (or let api.js inject it):
  <div class="install-banner" id="installBanner">
    <span class="install-banner-text"><strong>Learn on the go</strong> — Download Astrophy Free</span>
    <a href="https://play.google.com/store/apps/details?id=com.sg.astrophy" class="btn-install" target="_blank" rel="noopener">
      <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M3.609 1.814L13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893l2.302 2.302-10.937 6.333 8.635-8.635zm3.199-3.198l2.807 1.626a1 1 0 0 1 0 1.73l-2.808 1.626L15.206 12l2.492-2.491zM5.864 2.658L16.8 8.99l-2.3 2.3-8.636-8.632z"/></svg>
      Google Play
    </a>
    <button class="btn-dismiss" onclick="dismissInstallBanner()" aria-label="Dismiss">&times;</button>
  </div>
*/

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

/* ── CSS Variables ── */
:root {
  --bg-primary: #0A0E21;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --accent-blue: #1565C0;
  --accent-light: #42a5f5;
  --gold: #FFD700;
  --text-primary: #f5f5f5;
  --text-secondary: #b0bec5;
  --aurora-green: #00e676;
  --aurora-purple: #533483;
  --aurora-pink: #e94560;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Exo 2', sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--gold);
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Orbitron', sans-serif;
  color: var(--text-primary);
  line-height: 1.3;
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 16px;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ── Starfield Background ── */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.stars::before,
.stars::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 15% 85%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 55% 55%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 80% 15%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 65% 90%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 40% 5%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 5% 50%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 45% 75%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,255,0.4), transparent);
  animation: drift 60s linear infinite;
}

.stars::after {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 35% 45%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 80% 90%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 10% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 50% 20%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90% 50%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 70% 10%, rgba(255,255,255,0.6), transparent);
  animation: drift 90s linear infinite reverse;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

/* ── Page Container ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Navbar ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(10, 14, 33, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--gold);
}

.nav-links a.active {
  color: var(--gold);
}

.nav-cta {
  display: inline-block;
  background: var(--accent-blue);
  color: white !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.nav-auth-link {
  opacity: 0.8;
  font-size: 0.9rem;
}
.nav-auth-link:hover { opacity: 1; }

/* ── Nav Dropdown ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Exo 2', sans-serif;
  padding: 0;
  transition: color 0.2s;
}

.nav-dropdown-toggle:hover {
  color: var(--gold);
}

.nav-dropdown-toggle .chevron {
  font-size: 0.6rem;
  transition: transform 0.2s;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 170px;
  background: rgba(10, 14, 33, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px 0;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 110;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu a:hover {
  background: rgba(255,255,255,0.04);
  color: var(--gold);
}

.nav-dropdown-menu a.active {
  color: var(--gold);
}

/* Desktop: show on hover */
@media (min-width: 601px) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown:hover .chevron {
    transform: rotate(180deg);
  }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile nav overlay */
.nav-links.show {
  display: flex !important;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: rgba(10, 14, 33, 0.97);
  backdrop-filter: blur(16px);
  padding: 20px 24px;
  gap: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-links.show li {
  width: 100%;
}

.nav-links.show a {
  display: block;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
}

.nav-links.show a:hover {
  background: rgba(255,255,255,0.04);
}

.nav-links.show .nav-cta {
  text-align: center;
  margin-top: 4px;
  padding: 12px 16px;
}

/* Mobile dropdown: inline accordion */
.nav-links.show .nav-dropdown-toggle {
  display: flex;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
}

.nav-links.show .nav-dropdown-toggle:hover {
  background: rgba(255,255,255,0.04);
}

.nav-links.show .nav-dropdown-menu {
  position: static;
  transform: none;
  background: transparent;
  backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0 0 0 16px;
  min-width: 0;
}

.nav-links.show .nav-dropdown-menu::before {
  display: none;
}

.nav-links.show .nav-dropdown-menu a {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.nav-links.show .nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-links.show .nav-dropdown.open .chevron {
  transform: rotate(180deg);
}

/* ── Footer ── */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

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

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

.footer-copy {
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
}

.footer-play-badge {
  display: inline-block;
  margin-top: 8px;
}

.footer-play-badge img {
  height: 40px;
}

/* ── Card Component ── */
.card {
  background: rgba(22, 33, 62, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 32px 24px;
  transition: border-color 0.3s, transform 0.3s;
}

.card:hover {
  border-color: rgba(21, 101, 192, 0.3);
  transform: translateY(-4px);
}

/* ── Grid Layouts ── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ── Badge Component ── */
.badge-beginner {
  display: inline-block;
  background: rgba(0, 230, 118, 0.12);
  color: var(--aurora-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-intermediate {
  display: inline-block;
  background: rgba(66, 165, 245, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(66, 165, 245, 0.3);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-advanced {
  display: inline-block;
  background: rgba(83, 52, 131, 0.2);
  color: #ce93d8;
  border: 1px solid rgba(156, 39, 176, 0.3);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── CTA Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--aurora-green), #00c853);
  color: #0A0E21;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 230, 118, 0.45);
  color: #0A0E21;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  padding: 14px 24px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* btn-cta: alias for green download CTA — same as btn-primary but explicit name */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--aurora-green), #00c853);
  color: #0A0E21;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 230, 118, 0.3);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 230, 118, 0.45);
  color: #0A0E21;
}

/* ── Page Content Area ── */
/* Use .page-content to get proper top padding below the fixed navbar */
.page-content {
  padding-top: 80px;
  min-height: calc(100vh - 120px);
  position: relative;
  z-index: 1;
}

/* ── Section Header ── */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Loading Spinner ── */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 80px auto;
}

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

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-title {
  height: 22px;
  margin-bottom: 12px;
  width: 80%;
  border-radius: 6px;
}

.skeleton-card {
  background: rgba(22, 33, 62, 0.5);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 32px 24px;
}

.skeleton-badge {
  height: 24px;
  width: 90px;
  border-radius: 100px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Error State ── */
.error-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}

.error-state p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.error-state button {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.error-state button:hover {
  background: var(--accent-light);
}

/* ── Install Banner (sticky bottom, dismissible) ── */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(10, 14, 33, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.install-banner.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.install-banner-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.install-banner-text strong {
  color: var(--text-primary);
}

.install-banner .btn-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--aurora-green);
  color: #0A0E21;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.install-banner .btn-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
  color: #0A0E21;
}

.install-banner .btn-dismiss {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.install-banner .btn-dismiss:hover {
  color: var(--text-primary);
}

/* ── Breadcrumbs ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

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

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb .separator {
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Responsive Breakpoints ── */
@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }

  .section-title { font-size: 1.6rem; }
}

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }

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

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

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }

  .section-title { font-size: 1.4rem; }
  .section-subtitle { font-size: 0.9rem; }

  .page-content {
    padding-top: 72px;
  }

  .page-container {
    padding: 0 16px;
  }

  .container {
    padding: 0 16px;
  }

  .btn-primary,
  .btn-cta {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .install-banner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }

  .install-banner-text {
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  h1 { font-size: 1.3rem; }

  .page-container,
  .container {
    padding: 0 12px;
  }
}
