:root {
  line-height: 1.5;
}

h1, h2, h3, h4, h5, figure, p, ol, ul {
  margin: 0;
}

ol[role="list"], ul[role="list"] {
  list-style: none;
  padding-inline: 0;
}

h1, h2, h3, h4, h5 {
  font-size: inherit;
  font-weight: inherit;
}

img {
  display: block;
  max-inline-size: 100%;
}
/*This is for "moder-normalize"*/

body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #ffffff;
  color: #222;
  display: flex;
  flex-direction: column;
  align-items: center; /* Optional, to center horizontally */
}

.title {
  margin-top: 40px;
  margin-bottom: 30px;
  font-size: 2em;
  text-align: center;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px; /* 👈 add space at the bottom */
  width: 100%;
  max-width: 100vw; /* Make container take full viewport width */
  box-sizing: border-box;
}

.controls {
  display: flex;
  justify-content: space-between;
  width: 600px;
  max-width: 95vw; /* Add this */
  margin-bottom: 10px;
  gap: 10px; /* Add a gap for spacing */
}

button {
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: background 0.2s;
  margin-bottom: 20px; /* 👈 this creates spacing below the button */
}

button:hover {
  background: #ddd;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#reset {
  background: #f8d7da;
  border-color: #f5c2c7;
  color: #a94442;
}

#reset:hover {
  background: #f1b0b7;
}

.main-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px; /* spacing between scale sheet and clock */
}

.scale-sheet {
  display: none;
  flex-direction: column;
  margin: 0 auto;
  width: auto;
  max-width: 100vw;
  overflow-x: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", sans-serif;
}

.scale-label {
  flex: 0 0 400px; /* fixed width */
  background: #ddd;
  text-align: center;
  padding: 12px 4px;
  font-weight: bold;
  border-right: 1px solid #ccc;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scale-row {
  display: flex;
  width: 100%;
  min-width: 1200px;
  max-width: 1600px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.degree {
  flex: 1;
  min-width: 40px;
  text-align: center;
  padding: 12px 0;
  border-right: 1px solid #ccc;
  background: #fdfdfd;
  font-weight: bold;
  font-size: 1rem;
  box-sizing: border-box;
}

.degree:last-child {
  border-right: none;
}

.degree.highlight {
  background-color: #c87c68;
  color: white; /*Add a Highlight Class to CSS*/
}

/* Clock*/
.clock {
  position: relative;
  width: 90vw;
  height: 90vw;
  max-width: 600px;
  max-height: 600px;
  aspect-ratio: 1/1;   /* ensures perfect square */
  border: 2px solid #000000;
  border-radius: 50%;
  margin-bottom: 40px;
  overflow: visible;
}
#connections {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/*This is the notes on the circle*/
.note {
  background: #333;
  color: white;
  transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  position: absolute;
  width: 50px;
  height: 50px;
  text-align: center;
  line-height: 50px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  user-select: none;
  will-change: transform;
}

.note:hover {
  background: #666;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.note:active {
  transform: translate(-50%, -50%) scale(0.95);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.note.selected {
  background: #c87c68;
  color: black;
}

.footer {
  height: 80px; /* creates spacing */
  width: 100%;
}

@media (max-width: 700px) {
  .note {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 1em; /* optional, adjust if you want text smaller too */
  }

  .scale-sheet {
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    width: 100vw;
    max-width: unset;
  }

  .scale-row {
    min-width: 800px;
    max-width: unset;
  }

  .scale-label {
    flex: 0 1 200px;           /* allow it to shrink and grow */
    font-size: 0.9em;
    padding: 10px 2px;
    white-space: normal;       /* allow wrapping! */
    overflow: visible;
    text-overflow: unset;      /* remove ellipsis */
    min-width: 100px;          /* optional: to avoid too skinny columns */
    max-width: 300px;          /* optional: or remove this to allow unlimited width */
    text-align: left;          /* optional: left-align for readability on mobile */
  }

  .container {
    width: 100vw;
    padding: 0;
  }

  .controls {
    flex-direction: row; /* Stack buttons vertically on small screens */
    width: 100vw;
    max-width: 100vw;
    align-items: center;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
  }

  button {
    font-size: 1em;
    padding:8px 10px;
    border-radius: 10px;
    min-width: unset;
    width: auto;
    box-sizing: border-box;
    margin-bottom: 20px;
  }
}
