/* 1. Set the base font and background for the document */
html {
    font-family: "Zen Dots";
    src: url("./fonts/ZenDots-Regular.ttf") format("truetype");
    font-style: normal;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    background-image: url("/planets-data-mdn/img/space-background.jpg");
    background-color: black;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
}

/* 2. Hyperlink color rules */
a,
a:active { color: yellow; }
a:hover { color: cyan; }

/* 3. Style for the Title, Table and its Text */
table {
  border-collapse: collapse;
  border: 5px solid orange;
  box-shadow: 0 0 30px cyan;
  letter-spacing: 1px;
  font-size: 0.9rem;
  background: transparent;
  color: cyan;
}

h1 {
  font-optical-sizing: auto;
  font-size: 50px;
  text-align: center;
  margin-bottom: 40px;
  color: yellow;
  text-shadow: 4px 4px 10px cyan;
}

/* 4. Style Table Cells and Headers */
td, th {
  border: 3px solid orange;
  padding: 10px 20px;
  color: cyan;
}

/* 5. Style Table Headers */
th {
  background: transparent;
  color: blue;
}

/* 6. Center text in Table Cells */
td {
  text-align: center;
}

/* 7. Style the Table Caption */
caption {
  padding: 10px;
}

/* 8. Footer */
footer {
  color: cyan;
  position: static;
  left: 0;
  bottom: 0;
  width: 100%;
  font-size: 16px;
  margin-top: 40px;
  margin-bottom: 0px;
  text-align: center;
  text-shadow: 4px 4px 20px darkblue;
  z-index: 10;
  background: transparent;
  padding-bottom: 0;
  max-height: none;
  overflow: visible;
  display: block;
  clear: both;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* 9. Background Music Button */
#toggle-music {
  display: flex;
  position: fixed;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  bottom: 2vh;
  right: 2vw;
  width: 60px;
  height: 60px;
  margin: 0.5em;
  background-color: rgba(139, 0, 139, 0);
  border-radius: 50%;
  border: 4px solid rgb(19, 155, 233);
  transition: background-color 0.3s ease;
  z-index: 1000;
}

#toggle-music:hover {
  cursor: pointer;
  transform: scale(1.5);
  filter: drop-shadow(0 0 0.75rem darkorange) drop-shadow(0 0 0.75em darkblue);
  transition: 0.3s;
}

/* 10. Ensures elements adjust based on screen width */
@media (max-width: 900px) {
    footer {
        position: static;
        bottom: 0;
        height: auto;
        padding: 10px 0 2em 0;
        max-height: none;
        overflow: visible;
        display: block;
        clear: both;
        flex-shrink: 0;
        box-sizing: border-box;
    }
}

/* 11. Responsive adjustments for mobile devices */
/* Table horizontal scroll is handled by .table-container */
@media (max-width: 600px) {
  button {
    font-size: 6vw;
    width: 16vw;
    height: 16vw;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 8px;
  }

  .title {
    font-size: 7vw;
    margin-bottom: 4vw;
  }
  
  footer {
    font-size: 3vw;
    padding: 2vw 0 2vw 0;
  }

  #toggle-music {
    width: 14vw;
    height: 14vw;
    font-size: 7vw;
    min-width: 44px;
    min-height: 44px;
    bottom: 2vw;
    right: 2vw;
  }
}

/* 12. Orientation-specific adjustments for Table and H1 */
@media (orientation: portrait) {
  table { font-size: 0.8rem; }
  h1 { font-size: 3vw; }
}

@media (orientation: landscape) {
  table { font-size: 1rem; }
  h1 { font-size: 3vw; }
}

/* 13. Table container for horizontal scrolling on small screens */
.table-container {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: content-box;
  box-sizing: border-box;
  margin: 0 auto;
  padding-right: 16px;
  padding-left: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: orange cyan;
}

/* 14. Flexible images and tables */
img {
  max-width: 100%;
  height: auto;
}