.planets {
  padding-top: calc(var(--nav-height) + 1.5rem);
}

.planets__toolbar {
  margin-bottom: 1.5rem;
}

#planetSearch {
  width: 100%;
  max-width: 380px;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(4, 6, 30, 0.95);
  color: var(--text-main);
}

.planets__grid {
  margin-top: 1rem;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1rem !important;
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planet-card {
  padding: 1.4rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(10, 14, 48, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 200px;
}

.planet-card__name {
  font-family: "Orbitron", sans-serif;
}

.planet-card__meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.planet-card__actions {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
}

/* Enhanced Planet Modal Styles */
.planet-details,
.planet-facts,
.planet-exploration {
  margin: 1.5rem 0;
}

.planet-details h3,
.planet-facts h3,
.planet-exploration h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #7f5cff;
  margin-bottom: 1rem;
  font-family: 'Orbitron', sans-serif;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.detail-item {
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  font-size: 0.9rem;
}

.detail-item strong {
  color: #26ffe6;
  font-weight: 500;
}

.planet-facts ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.planet-facts li {
  padding: 0.5rem 0.75rem;
  background: rgba(127, 92, 255, 0.1);
  border-left: 3px solid #7f5cff;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.planet-exploration p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: rgba(38, 255, 230, 0.05);
  padding: 0.75rem;
  border-radius: 6px;
  border-left: 3px solid #26ffe6;
}

.planet-card__fav {
  background: none;
  border: none;
  color: #ffdd55;
  cursor: pointer;
}

.planets__table-title {
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
}

.planets__table-wrapper {
  overflow-x: auto;
}

.planets__table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(4, 6, 30, 0.9);
  border-radius: 16px;
  overflow: hidden;
}

.planets__table th,
.planets__table td {
  padding: 0.7rem 0.8rem;
  font-size: 0.9rem;
}

.planets__table thead {
  background: rgba(12, 16, 54, 0.98);
}

.planets__table tbody tr:nth-child(even) {
  background: rgba(8, 10, 38, 0.95);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.modal--open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.modal__dialog {
  position: relative;
  max-width: 540px;
  width: calc(100% - 2.5rem);
  z-index: 1;
}

.modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  border: none;
  background: none;
  color: var(--text-main);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal__content h2 {
  font-family: "Orbitron", sans-serif;
  margin-bottom: 0.5rem;
}

.modal__content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 960px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid--4 {
    grid-template-columns: 1fr;
  }
}
