/* Global styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

html {
  font-size: 9px;
}

/* For small screens */
@media only screen and (max-width: 600px) {
  html {
    font-size: 3.78px;
  }
}
  
body {
  /*font-family: "Helvetica Neue", Arial, sans-serif;*/
  line-height: 1.6;
  margin: 4rem;
  background-color: #f5f5f5; /* light gray or off-white */
  font-family: Arial, sans-serif;
  color: #333;
}

/* Index page top bar */
.index-topbar,
.song-topbar {
  max-width: 700px;
  margin: 0 auto 2rem auto;
  padding: 0 3rem;
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.index-topbar-left,
.song-topbar-left {
  display: flex;
  align-items: center;
  padding-top: 2.3rem;
  gap: 0.8rem;
}

.index-topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
}

.index-filter-row {
  display: flex;
  align-items: center;
  gap: 2.4rem;
}

.index-tag-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.index-logo {
  height: 6.2rem;
  width: auto;
  display: block;
}

.index-by {
  height: 4.8rem;
  width: auto;
  display: block;
  margin: 0 0.4rem;
}

/* Neutralize old float/position behavior in the index topbar */
.index-topbar .button,
.index-topbar .button-text {
  float: none;
  position: static;
  top: auto;
  left: auto;
  margin: 0;
}

.index-topbar .button {
  background: transparent;
  border: 0.25rem solid #000000;
  color: #000000;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.index-topbar .button:hover {
  background: #dfdfdf;
}

.index-topbar .button.tags {
  font-size: 2.4rem;
  padding: 0.2rem 0.4rem;
}

.index-topbar .button.tags.active,
.index-topbar .button.tags.active:hover {
  background-color: #888888;
}

.search-input {
  width: 31rem;
  height: 3.2rem;
  max-width: 100%;
  background: transparent;
  border: 0.25rem solid #000000;
  color: #333;
  border-radius: 4px;
  font-size: 2rem;
  padding: 0.4rem 0.8rem;
  font-family: inherit;
}

.search-input::placeholder {
  color: #777;
  font-size: 2rem;
  opacity: 1;
}

/* Button (could be an <a>, <button>, etc.) */
.button {
  float: right;
  background: transparent;
  border: 0.25rem solid #000000;
  color: #000000;
  text-decoration: none;
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 0.4rem;
  position: relative;
  top: -3.6rem;
}

.button.tags {
  font-size: 2.4rem;
  padding: 0.2rem 0.4rem;
}
.button.tags.active {
  background-color: #888888;
}

.button-text {
  border: none;
  float: right;
  background: transparent;
  color: #000000;
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  font-size: 2rem;
  margin-right: 0.4rem;
  position: relative;
  top: -3.6rem;
}

/* Top bar */
/* Song page top bar */
.song-topbar-right {
  display: flex;
  align-items: flex-start;
}

.song-topbar-left {
  display: flex;
  align-items: center;
  padding-top: 2.3rem;
}

.song-logo {
  height: 6.2rem;
  width: auto;
  display: block;
  background: transparent;
}

/* Go back button on the left */
.song-back {
  font-size: 2.9rem;
  padding: 0.05rem 0.8rem;
}

.song-content-wrap {
  position: relative;
  max-width: 700px;
  margin: 0 auto 2rem auto;
}

/* Song back and randomize */
.song-content-wrap .song-back {
  position: absolute;
  top: 3.5rem;
  left: -6.5rem;
  float: none;
  margin: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.9rem;
  padding: 0.05rem 0.8rem;
}

/* Reset old global float/position styles inside the song header */
.song-topbar .button,
.song-topbar .button-text {
  float: none;
  position: static;
  top: auto;
  left: auto;
  margin: 0;
}

.song-topbar .button {
  border: 0.25rem solid #000000;
  background: transparent;
  color: #000000;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.transposition-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.transpose-label {
  height: 3.2rem;
  width: auto;
  display: block;
  opacity: 0.95;
}

.filter-label {
  height: 3.2rem;
  width: auto;
  display: block;
}

.transposition-controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.transposition-controls .button {
  font-size: 3rem;
  padding: 0.2rem 0.8rem;
  line-height: 1;
}

.transposition-controls .button-text {
  border: none;
  background: transparent;
  color: #000000;
  padding: 0.8rem 1.2rem;
  font-size: 2.4rem;
  line-height: 1;
}

/* Active accidental */
.transposition-controls .active,
.transposition-controls .button.active,
.transposition-controls .button.active:hover {
  background-color: #888888;
}

/* Hover effect for the button */
.button:hover {
  background: #dfdfdf;
}

.button:disabled {
  opacity: 1;
  cursor: default;
}

.transposition-block .button,
.transposition-block .button-text {
  margin: 0 0.6rem 0 0;
}
.transposition-block .transposition-controls > *:last-child {
  margin-right: 0;
}

/* Share button */
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-share {
  width: 2.1rem;
  height: 2.1rem;
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.logo {
  height: 6.2rem;
  float: left;
  background: transparent;
  top: -6.6rem;
  position: relative;
  margin-right: 0.6rem;
}

/* Title */
h1 {
  margin: 0;        /* remove default h1 margin */
  font-size: 2.6rem;
  flex: 1;          /* take up remaining space */
  text-align: center;
  margin-bottom: 4.8rem;
  display: flex;
  align-items: center;
}

h2 {
    margin: 0;        /* remove default h1 margin */
    font-size: 2rem;
    flex: 1;          /* take up remaining space */
    text-align: center;
    display: flex;
    align-items: center;
    margin-top: 4rem;   /* space before author heading */
    margin-bottom: 0px; /* small gap after heading */
    font-weight: normal;
    padding-bottom: 0px;        /* space between text and line */
  }

/* The list for songs under each author */
ul {
    list-style: none;      /* remove bullets */
    padding-left: 0;       /* remove default indent */
    margin-bottom: 3rem; /* space after the list */
    text-align: left;
}

/* Each list item - small vertical space */
li {
  margin: 0.6rem 0;
}

/* Links for each song */
li a {
  text-decoration: none;
  color: #007acc; /* nice link color */
  font-size: 1.75rem;
}

li a:hover {
  text-decoration: underline;
}

/* Divide the listing into 2 columns */
#listContainer {
  gap: 4rem;
  column-count: 2;
  column-gap: 3.4rem;
}

/* Divide display into 2 columns */
#songDoubleColumn {
  column-count: 2;
  column-gap: 3.4rem;
}

#songCount {
  float: right;
  color: #000000;
  padding: 0.8rem 1.6rem;
  font-size: 1.8rem;
  margin-right: 0.4rem;
  position: relative;
  top: -3.6rem;
}

/* Prevent groups from being split between columns */
.author-group {
  break-inside: avoid;
  margin-bottom: 2rem;
}

/* Main container that centers the "sheet" on the page */
.container {
  max-width: 700px;   /* how wide you want your "sheet" */
  margin: auto;  /* auto left/right => centered, 2rem top/bottom gap */
  background-color: #fff;   /* white "sheet" background */
  border-radius: 8px;       /* soften corners if you like */
  box-shadow: 0 0 10px rgba(0,0,0,0.1); /* subtle shadow */
  padding-top: 4.2rem;
  padding-right: 2.5rem;
  padding-bottom: 3.5rem;
  padding-left: 2.5rem;
}

/* A little spacing for paragraphs inside the container */
.container p {
  margin: 2rem 0;
  line-height: 1.6;
  font-size: 1.75rem;
}

.emptyContainer {
  max-width: 700px;   /* how wide you want your "sheet" */
  margin: auto;  /* auto left/right => centered, 2rem top/bottom gap */
  padding-top: 4rem;
  padding-right: 3rem;
  padding-bottom: 2rem;
  padding-left: 3rem;

}

.emptyContainer.small {
  padding-top: 2rem;
  padding-right: 3rem;
  padding-bottom: 1rem;
  padding-left: 3rem;
}

/* PARTS (verses, choruses, etc.) */
/* This class applies a margin after each part */
.part {
  margin-bottom: 4rem; /* space between parts */
  break-inside: avoid; /* for columns */
}
/* Verse styling */
.part.verse p {
  color: #000; /* black text */
  margin: 7px 0;
}
/* Chorus styling */
.part.chorus p {
  color: #9e1766;
  margin: 0.875rem 0;
}

.chord-block {
    display: inline-flex;   /* Let it flow inline with surrounding text */
    flex-direction: column-reverse;
    vertical-align: baseline; /* Align the table’s baseline with surrounding text */
    position: relative;
    top: -1.95rem;
    align-items: center;
    color: inherit;
    border-collapse: collapse; /* Remove extra cell spacing */
    margin-right: 0.6rem;     /* spacing after the pair */
    gap: 0.2rem; /* separate chord and lyric */
  }
.chord-block > * {
  margin: 0; 
  padding: 0; 
  line-height: 1; 
}
.chord-inline {
  display: inline-flex;
  flex-direction: row; /* horizontal layout */
  align-items: center;
  gap: 0.8rem; /* small gap between chords */
}

/* The chord goes in the first (top) row */
.chord {
  color: #1f78b4;
  font-weight: bold;
  line-height: 1;  /* so it doesn’t push the row’s height too large */
  font-size: 1.56rem;
  cursor: pointer; /* car clickable */
}

.chord:hover {
  text-decoration: underline;
}

.complement {
  color: #1f78b4;
  font-weight: bold;
  line-height: 1;  /* so it doesn’t push the row’s height too large */
  font-size: 1.28rem;
  position: relative;
  top: -0.6rem;  /* adjust this value as needed */
  /*
  vertical-align: super; /* or adjust as needed */
}

.bass{
  color: #30b34d;
  font-size: 1.38rem;
}

/* The lyric goes in the second (bottom) row */
.lyric {
  /* Usually inherits color (black or red) from the verse/chorus container */
  font-size: 1.75rem;
}

/* For parenthesized chords (C) */
.chord-block.optional .chord {
  /*color: gray; /* or a lighter weight, etc. */
  font-style: italic;
  font-size: 1.2rem;
}

/* Grey when italic */
igrey {
    font-style: italic;
    color: #6b6b6b
}
gpurple {
  color: #9e1766;
}

/* Loading spinner */
#loadingMsg::after {
  content: "";
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 0.25rem solid #333;
  border-top: 0.25rem solid transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 1rem;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Error message for 404 not found */
#errorBox,
.errorBox {
  max-width: 700px;
  margin: 80px auto 0;
  padding: 18px 20px;
  border: 2px solid #000;
  border-radius: 12px;
  text-align: center;
  font-size: 18px;
  line-height: 1.4;
}

.errorBox h1 {
  margin: 0 0 10px 0;
  font-size: 26px;
}

.errorBox p {
  margin: 6px 0;
}

.errorBox code {
  font-size: 0.95em;
}

/* Video integration */
#videoContainer {
  max-width: 700px;
  margin: 2rem auto 1rem auto;
}

.video-section-container {
  padding-top: 2.2rem;
  padding-bottom: 2.5rem;
}

.song-video-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid #d6d6d6;
}

.video-title {
  font-size: 1.7rem;
  margin-top: 1.8rem;
  margin-bottom: 1.4rem;
  color: #555;
  letter-spacing: 0.03em;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Chords Pop-Up */
/* For piano and guitar in popup-up */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: fit-content;
  max-width: min(92vw, 640px);
  max-height: 88vh;
  overflow: auto;
  background: transparent;
  z-index: 1000;
}

.hidden {
  display: none;
}

.popup-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 2rem;
  position: relative;
}

.popup-close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.4rem;
  border: none;
  background: transparent;
  font-size: 2.6rem;
  cursor: pointer;
  color: #666;
}

.popup-header {
  margin-bottom: 1.6rem;
}

.popup-chord-name {
  font-size: 2.4rem;
  font-weight: bold;
}

.popup-section {
  margin-top: 2rem;
}

.popup-section-title {
  font-size: 1.6rem;
  font-weight: bold;
  color: #666;
  margin-bottom: 1rem;
}

.popup-muted {
  font-size: 1.5rem;
  color: #666;
  margin-top: 1rem;
}

.popup-note-list {
  margin-top: 0.2rem;
  font-size: 1.5rem;
  color: #666;
}

/* Piano */
.piano-diagram {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 110px;
  margin-top: 0.8rem;
}

.piano-white-keys {
  display: grid;
  width: 100%;
  height: 100%;
}

.piano-key.white {
  border: 1px solid #bbb;
  background: #fff;
  position: relative;
}

.piano-key.white.active {
  background: #cfe8ff;
}

.piano-black-keys {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62%;
  pointer-events: none;
}

.piano-key.black {
  position: absolute;
  width: 9%;
  height: 100%;
  background: #222;
  border-radius: 0 0 4px 4px;
  transform: translateX(-50%);
}

.piano-key.black.active {
  background: #4b90d9;
}

.piano-note-label {
  position: absolute;
  bottom: 0.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: #666;
}

.piano-key.black .piano-note-label {
  bottom: 0.3rem;
  color: #fff;
}

/* Guitar */
.guitar-diagrams {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.guitar-diagram-block {
  min-width: 180px;
}

.guitar-shape-label {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
  color: #666;
}

.guitar-diagram-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.guitar-top-markers {
  width: 132px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-bottom: 0.4rem;
  font-size: 1.6rem;
  text-align: center;
}

.guitar-top-marker.muted {
  color: #888;
}

.guitar-main {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.guitar-fret-labels {
  display: grid;
  grid-template-rows: repeat(4, 24px);
  gap: 0;
  font-size: 1.2rem;
  color: #666;
  align-items: center;
  padding-top: 12px;
}

.guitar-fret-label {
  height: 24px;
  display: flex;
  align-items: center;
}

.guitar-grid {
  width: 132px;
  height: 108px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-left: 2px solid #444;
  border-right: 2px solid #444;
  position: relative;
}

.guitar-grid.with-nut {
  border-top: 4px solid #222;
}

.guitar-string-column {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  border-left: 1px solid #666;
}

.guitar-string-column:first-child {
  border-left: none;
}

.guitar-cell {
  border-top: 1px solid #666;
  position: relative;
}

.guitar-cell:first-child {
  border-top: none;
}

.guitar-dot {
  width: 12px;
  height: 12px;
  background: #2f7fd3;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* TIPS */
.bottom-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.footer-actions {
  padding-top: 0rem;
  padding-bottom: 1rem;
}

.bottom-actions .button,
.bottom-actions .button-text,
.bottom-actions #songCount {
  float: none;
  position: static;
  top: auto;
  left: auto;
  margin: 0;
}

.bottom-actions .button-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-decoration: none;
  min-width: 22rem;
}

.tip-label {
  height: 4.4rem;
  width: auto;
  display: block;
}

.tip-icon {
  height: 5.4rem;
  width: auto;
  display: block;
}