/* ===========================================
   Solar System Component Styles - 3D Perspective
   Interactive solar system with tilted elliptical orbits
   =========================================== */

/* ===== Container ===== */
#solar-system-container {
  position: absolute;
  top: 50%;
  left: 39%;
  transform: translate(-50%, -80%);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}

.solar-system-3d {
  position: relative;
  width: 1400px;
  height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  pointer-events: none;
}

.solar-system-3d * {
  pointer-events: auto;
}

/* ===== Stars Background - Now transparent ===== */
.stars-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
  background: transparent;
}

.star {
  position: absolute;
  background: var(--color-text-primary, #ffffff);
  border-radius: 50%;
  opacity: var(--star-opacity, 0.3);
  animation: starTwinkle 3s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: calc(var(--star-opacity, 0.3) * 0.3);
    transform: scale(0.8);
  }
  50% {
    opacity: var(--star-opacity, 0.3);
    transform: scale(1);
  }
}

/* ===== SVG Orbit Layer ===== */
.orbit-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
}

/* Enable pointer events only on interactive elements */
.orbit-svg .planet-group,
.orbit-svg .sun-svg {
  pointer-events: auto;
  cursor: pointer;
}

.orbit-svg .orbit-ellipse {
  pointer-events: none;
}

.orbit-ellipse {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 1;
  transition: stroke 0.3s ease, stroke-width 0.3s ease, opacity 0.3s ease;
}

.orbit-ellipse.orbit-back {
  stroke: rgba(255, 255, 255, 0.12);
}

.orbit-ellipse.orbit-front {
  stroke: rgba(255, 255, 255, 0.2);
}

.orbit-ellipse.highlighted {
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 2;
}

.orbit-ellipse.dimmed {
  opacity: 0.3;
}

/* ===== SVG Planet Styles ===== */
.planet-group {
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.planet-group.highlighted .planet-svg {
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.6));
  transform-origin: center;
}

.planet-group.dimmed {
  opacity: 0.4;
  filter: grayscale(30%) brightness(0.7);
}

.sun-svg {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.sun-svg.highlighted {
  filter: url(#glow) drop-shadow(0 0 20px rgba(253, 184, 19, 0.8));
}

.sun-svg.dimmed {
  opacity: 0.4;
  filter: grayscale(30%) brightness(0.7);
}

/* ===== Planets Container ===== */
.planets-container {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

/* ===== Pause/Play Control ===== */
.solar-control {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.3s ease;
  opacity: 0.6;
  backdrop-filter: blur(4px);
}

.solar-control:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.solar-control svg {
  width: 14px;
  height: 14px;
  color: #ffffff;
}

.solar-control .play-icon {
  display: none;
}

.solar-control .pause-icon {
  display: block;
}

.solar-system.paused .solar-control .play-icon {
  display: block;
}

.solar-system.paused .solar-control .pause-icon {
  display: none;
}

/* ===== Sun - 3D Style ===== */
.sun-3d {
  position: absolute;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sun-3d:hover,
.sun-3d:focus {
  transform: translate(-50%, -50%) scale(1.1);
  outline: none;
}

.sun-core-3d {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    #FFF 0%,
    #FFE082 20%,
    #FDB813 50%,
    #F5A623 80%,
    #E65100 100%
  );
  box-shadow:
    0 0 30px rgba(253, 184, 19, 0.9),
    0 0 60px rgba(253, 184, 19, 0.7),
    0 0 90px rgba(253, 184, 19, 0.5),
    0 0 120px rgba(253, 184, 19, 0.3),
    inset -5px -5px 20px rgba(230, 81, 0, 0.5);
  z-index: 2;
}

.sun-glow-3d {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180%;
  height: 180%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(253, 184, 19, 0.4) 0%,
    rgba(253, 184, 19, 0.2) 30%,
    rgba(253, 184, 19, 0.1) 50%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: 1;
  animation: sunPulse3d 4s ease-in-out infinite;
  pointer-events: none;
}

.sun-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(253, 184, 19, 0.1) 10deg,
    transparent 20deg,
    rgba(253, 184, 19, 0.08) 30deg,
    transparent 40deg,
    rgba(253, 184, 19, 0.1) 50deg,
    transparent 60deg,
    rgba(253, 184, 19, 0.08) 70deg,
    transparent 80deg,
    rgba(253, 184, 19, 0.1) 90deg,
    transparent 100deg,
    rgba(253, 184, 19, 0.08) 110deg,
    transparent 120deg
  );
  border-radius: 50%;
  z-index: 0;
  animation: sunRaysRotate 60s linear infinite;
  pointer-events: none;
}

@keyframes sunPulse3d {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

@keyframes sunRaysRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===== Planets - 3D Style ===== */
.planet-3d {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: filter 0.3s ease;
}

.planet-3d:focus {
  outline: none;
}

.planet-3d:focus-visible .planet-body {
  box-shadow: 0 0 0 3px var(--color-accent-primary, #FFF6AE);
}

.planet-body {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  /* 3D lighting effect - light from top-left */
  box-shadow:
    inset -3px -3px 10px rgba(0, 0, 0, 0.4),
    inset 2px 2px 8px rgba(255, 255, 255, 0.2);
}

.planet-3d.highlighted .planet-body {
  transform: scale(1.4);
  box-shadow:
    0 0 25px rgba(255, 255, 255, 0.6),
    inset -3px -3px 10px rgba(0, 0, 0, 0.4),
    inset 2px 2px 8px rgba(255, 255, 255, 0.3);
}

.planet-3d.dimmed {
  opacity: 0.4;
  filter: grayscale(30%) brightness(0.7);
}

.planet-shadow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 80%;
  height: 20%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
}

/* ===== Earth Special Styling ===== */
.earth-continent {
  position: absolute;
  width: 60%;
  height: 40%;
  top: 25%;
  left: 15%;
  background: radial-gradient(ellipse, #4CAF50 0%, #2E7D32 100%);
  border-radius: 50% 60% 40% 50%;
  opacity: 0.7;
  transform: rotate(-15deg);
}

/* ===== Jupiter Stripes ===== */
.planet-stripes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0.4;
}

.planet-stripes::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 0;
  width: 100%;
  height: 12%;
  background: rgba(139, 90, 43, 0.6);
}

.planet-stripes::after {
  content: '';
  position: absolute;
  top: 45%;
  left: 0;
  width: 100%;
  height: 15%;
  background: rgba(139, 90, 43, 0.5);
}

/* ===== Saturn's Rings ===== */
.saturn-ring-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220%;
  height: 60%;
  transform: translate(-50%, -50%) rotateX(75deg);
  pointer-events: none;
}

.saturn-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.saturn-ring-outer {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(210, 180, 140, 0.7);
  box-shadow:
    0 0 3px rgba(210, 180, 140, 0.5),
    inset 0 0 10px rgba(210, 180, 140, 0.3);
}

.saturn-ring-inner {
  width: 75%;
  height: 75%;
  border: 3px solid rgba(210, 180, 140, 0.5);
}

/* ===== Tooltip ===== */
.solar-tooltip {
  position: fixed;
  background: rgba(13, 27, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  min-width: 200px;
  max-width: 280px;
  opacity: 0;
  transform: scale(0.95) translateY(10px);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.solar-tooltip.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tooltip-planet-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.tooltip-name {
  font-family: var(--font-instrument, 'Georgia', serif);
  font-size: 18px;
  font-weight: 500;
  color: #ffffff;
}

.tooltip-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 8px 0 12px;
}

.tooltip-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-inter, 'Arial', sans-serif);
  font-size: 12px;
}

.tooltip-label {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
}

.tooltip-row span:last-child {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-align: right;
}

.tooltip-fact {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-family: var(--font-inter, 'Arial', sans-serif);
  font-size: 11px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
}

/* ===== Responsive Design ===== */

/* Large screens */
@media (min-width: 1440px) {
  .solar-system-3d {
    width: 1400px;
    height: 700px;
  }
}

/* Desktop */
@media (max-width: 1440px) {
  .solar-system-3d {
    width: 1400px;
    height: 700px;
    transform: scale(0.9);
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .solar-system-3d {
    width: 1000px;
    height: 500px;
    transform: scale(0.85);
  }
}

/* Tablet portrait */
@media (max-width: 900px) {
  .solar-system-3d {
    width: 900px;
    height: 450px;
    transform: scale(0.7);
  }

  .solar-tooltip {
    min-width: 180px;
    max-width: 240px;
    padding: 12px;
  }

  .tooltip-name {
    font-size: 16px;
  }
}

/* Mobile landscape */
@media (max-width: 768px) {
  .solar-system-3d {
    width: 800px;
    height: 400px;
    transform: scale(0.6);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .solar-system-3d {
    width: 700px;
    height: 350px;
    transform: scale(0.5);
  }

  .solar-control {
    width: 30px;
    height: 30px;
    top: 10px;
    right: 10px;
  }

  .solar-control svg {
    width: 12px;
    height: 12px;
  }

  .solar-tooltip {
    min-width: 160px;
    max-width: 200px;
    padding: 10px;
    font-size: 10px;
  }

  .tooltip-name {
    font-size: 14px;
  }

  .tooltip-row {
    font-size: 10px;
  }

  .tooltip-fact {
    font-size: 10px;
  }
}

/* ===== Hero Section Integration ===== */
/* Solar system is positioned as absolute background */
.hero-content-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-text-content {
  flex: 0 0 50%;
  max-width: 50%;
  position: relative;
  z-index: 2;
}

.hero-solar-system {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-30%, 80%);
  width: 100%;
  rotate: -1deg;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}

/* Responsive Hero Layout */
@media (max-width: 1200px) {
  .hero-text-content {
    flex: 0 0 55%;
    max-width: 55%;
  }

  .hero-solar-system {
    transform: translate(-25%, -50%);
  }
}

@media (max-width: 900px) {
  .hero-content-wrapper {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }

  .hero-text-content {
    flex: none;
    max-width: 100%;
  }

  .hero-solar-system {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    rotate: 0deg;
    width: 100%;
    height: auto;
    min-height: 400px;
    margin-top: 40px;
    opacity: 1;
    z-index: 1;
    overflow: visible;
  }

  #solar-system-container {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%;
    height: 400px;
  }

  .solar-system-3d {
    transform: scale(0.8);
    transform-origin: center center;
  }
}

@media (max-width: 480px) {
  .hero-solar-system {
    min-height: 350px;
    margin-top: 20px;
  }

  #solar-system-container {
    height: 350px;
  }

  .solar-system-3d {
    transform: scale(1.2);
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .star,
  .sun-glow-3d,
  .sun-rays {
    animation: none !important;
  }
}

.solar-system.reduced-motion .star,
.solar-system.reduced-motion .sun-glow-3d,
.solar-system.reduced-motion .sun-rays {
  animation: none !important;
}

/* ===== Theme Support ===== */
[data-theme="light"] .stars-container {
  background: transparent;
}

[data-theme="light"] .star {
  background: var(--color-text-muted, #888888);
  opacity: calc(var(--star-opacity, 0.3) * 0.5);
}

[data-theme="light"] .orbit-ellipse {
  stroke: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .orbit-ellipse.orbit-front {
  stroke: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .orbit-ellipse.highlighted {
  stroke: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .solar-tooltip {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

[data-theme="light"] .tooltip-name {
  color: #1a1a1a;
}

[data-theme="light"] .tooltip-label {
  color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .tooltip-row span:last-child {
  color: rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .tooltip-fact {
  color: rgba(0, 0, 0, 0.6);
  border-top-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tooltip-divider {
  background: rgba(0, 0, 0, 0.1);
}
