/* ==========================================================
   shared.css — SolarExplorer Common Styles
   Loaded by every planet/sun subpage BEFORE the page-
   specific styles.css override file.
   ========================================================== */

/* ---- 1. Reset & Base ---- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: url(../Media/Space.cur), auto;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: #e9f2ff;
  background-color: #0b1020;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin-bottom: 1rem;
}

h1, h2, h3 {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  color: #fff;
}

/* ---- 2. Background Layers (common z-index stack) ---- */
#vanta-bg,
#stars,
#halo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#vanta-bg  { z-index: -5; }
#stars     { z-index: -4; }
#halo      { z-index: -3; }

/* Planet-specific particle layer (id varies per page — handled by each styles.css) */
.planet-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -2;
}

/* Planet globe wrapper */
.planet-globe-wrapper {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 3. Container ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/* ---- 4. Header ---- */
.main-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  background: linear-gradient(180deg, rgba(3, 4, 10, 0.7) 0%, rgba(3, 4, 10, 0) 100%);
}

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

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand .logo-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  /* accent gradient defined per planet in styles.css */
  background: linear-gradient(135deg, #6de3ff, #9b7bff);
}

.header-brand .logo-icon i {
  font-size: 22px;
  color: #0b1020;
}

.header-brand .brand-text h1 {
  font-size: 1.2rem;
  margin: 0;
  color: #fff;
}

.main-nav-links a {
  padding: 8px 16px;
  color: #fff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
}

.main-nav-links a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Mobile Nav Drawer */
#nav-toggle { display: none; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  cursor: pointer;
  z-index: 200;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(3, 4, 10, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 80px 24px 32px;
  flex-direction: column;
  gap: 12px;
  z-index: 150;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(-100%);
  transition: transform 0.35s ease;
}

.mobile-nav a {
  color: #a9b2c7;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.mobile-nav a:hover {
  color: #6de3ff;
  padding-left: 6px;
}

#nav-toggle:checked ~ .mobile-nav {
  transform: translateY(0);
}

#nav-toggle:checked ~ label.hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

#nav-toggle:checked ~ label.hamburger span:nth-child(2) {
  opacity: 0;
}

#nav-toggle:checked ~ label.hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}


/* ---- 5. Planet Hero ---- */
.planet-hero {
  min-height: 50vh;
  padding: 120px 0 60px;
  display: flex;
  align-items: flex-end;
  position: relative;
  background: transparent;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
}

.planet-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  /* Colors overridden per planet in styles.css */
  background: linear-gradient(135deg, #6de3ff, #9b7bff);
  color: #0b1020;
  box-shadow: 0 0 10px rgba(109, 227, 255, 0.4);
}

.planet-hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  /* Gradient overridden per planet in styles.css */
  background: linear-gradient(90deg, #6de3ff, #9b7bff, #6de3ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}

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

.hero-content p {
  font-size: 1.1rem;
  color: #a9b2c7;
  max-width: 60ch;
}

/* ---- 6. Planet Info Section ---- */
.planet-info {
  padding: 40px 0 80px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 60px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.stat-card .icon {
  font-size: 22px;
  /* Color defined per planet in styles.css */
  color: #6de3ff;
  margin-bottom: 10px;
}

.stat-card h3 {
  font-size: 0.82rem;
  color: #a9b2c7;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-card p {
  font-size: 1.15rem;
  color: #fff;
  font-weight: 600;
  margin: 0;
}

/* Structure Section */
.structure-section {
  margin-bottom: 56px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(109, 227, 255, 0.08);
}

.structure-section h2 {
  font-size: 1.8rem;
  margin-bottom: 16px;
  padding-left: 16px;
  border-left: 4px solid #6de3ff;
  color: #6de3ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.structure-section p {
  color: #a9b2c7;
  max-width: 80ch;
  line-height: 1.75;
  margin-bottom: 0;
}

/* ---- Composition & Matrix Cards ---- */
.composition-section,
.matrix-section {
  margin-bottom: 56px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border-radius: 16px;
}

.composition-section h2,
.matrix-section h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  padding-left: 16px;
  border-left: 4px solid var(--accent, #6de3ff);
  color: var(--accent, #6de3ff);
  display: flex;
  align-items: center;
  gap: 8px;
}

.composition-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.bar-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 600;
  color: #a9b2c7;
}

.bar-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent, #6de3ff), var(--accent-2, #9b7bff));
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.matrix-card {
  background: rgba(255, 255, 255, 0.04);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.matrix-card .matrix-num {
  font-family: "Orbitron", sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin: 6px 0 2px;
}

.matrix-card .matrix-lbl {
  font-size: 0.85rem;
  color: #a9b2c7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Discoveries Section */
.discoveries-section h2 {
  font-size: 1.8rem;
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 4px solid #9b7bff;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.discoveries-list {
  list-style: none;
  counter-reset: discoveries-counter;
}

.discovery-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 18px 24px 18px 68px;
  border-radius: 12px;
  margin-bottom: 14px;
  position: relative;
  font-size: 1rem;
  color: #a9b2c7;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.discovery-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.discovery-item::before {
  content: counter(discoveries-counter);
  counter-increment: discoveries-counter;
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6de3ff, #9b7bff);
  color: #0b1020;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Orbitron", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---- 7. Planet Navigation ---- */
.planet-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 48px 0 24px;
  flex-wrap: wrap;
}

.planet-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #a9b2c7;
  font-weight: 600;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.planet-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(109, 227, 255, 0.3);
  color: #fff;
  transform: translateY(-2px);
}

.planet-nav-link.planet-nav-home {
  background: rgba(109, 227, 255, 0.08);
  border-color: rgba(109, 227, 255, 0.2);
  color: #6de3ff;
}

.planet-nav-link.planet-nav-home:hover {
  background: rgba(109, 227, 255, 0.15);
  color: #fff;
}

/* ---- 8. Footer ---- */
.main-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(3, 4, 10, 0.5);
  text-align: center;
}

.main-footer p {
  color: #a9b2c7;
  font-size: 0.9rem;
}

.main-footer a i {
  transition: color 0.3s ease, filter 0.3s ease;
}

.main-footer a:hover i {
  color: #6de3ff;
  filter: drop-shadow(0 0 6px #6de3ff);
}

/* ---- 9. Scrollbar ---- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #03040a; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6de3ff, #9b7bff);
  border-radius: 6px;
  border: 2px solid #03040a;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #9b7bff, #6de3ff);
  box-shadow: 0 0 10px #6de3ff;
}
* { scrollbar-width: thin; scrollbar-color: #6de3ff #03040a; }

/* ---- 11. Responsive ---- */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav-links { display: none; }
  .planet-hero h1 { font-size: clamp(2.2rem, 10vw, 3.5rem); }
  .planet-nav { gap: 10px; }
  .planet-nav-link { padding: 8px 14px; font-size: 0.82rem; }
  .header-brand .brand-text h1 { font-size: 1rem; }
  .hamburger { display: flex; }
  .mobile-nav { display: flex; }
  .globe { box-shadow: none !important; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .discovery-item { padding-left: 58px; }
}

/* ---- 12. CSS Scroll-Reveal ---- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stat-card {
      animation: fadeSlideUp 0.5s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }

    .structure-section,
    .discoveries-section {
      animation: fadeSlideUp 0.6s ease both;
      animation-timeline: view();
      animation-range: entry 0% entry 30%;
    }
  }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { background-position: 0 0; }
  to   { background-position: -200% 0; }
}

