/* ==========================================================================
   JB AtlaZZ | Version 210 | css/viewer.css
   Created by Dean Senecal and Sparky
   Purpose: Song display, performance controls and responsive viewer
   Documentation updated: 2026-10-20
   Original creation date: not independently verified
   Maintenance: edit the named sections; keep change history in README_VERSION_210.txt
   ========================================================================== */

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #1c1b1f;
  background: #ffffff;
}

* {
  box-sizing: border-box;
}

html, body, #jb-app {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  overflow: hidden;
}

button, select {
  font: inherit;
}

button {
  cursor: pointer;
}

#jb-app {
  display: flex;
  background: #ffffff;
}


/* --- Viewer shell and display ---
   Maintenance: Controls the song-viewing interface; keep song content scaling separate from controls.
*/
/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
#viewer-sidebar {
  flex: 0 0 80px;
  width: 80px;
  height: 100vh;
  overflow-y: auto;
  background: #e5e5e5;
  padding: 20px 5px 12px;
  text-align: center;
  scrollbar-width: thin;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.side-button {
  width: 60px;
  min-height: 30px;
  margin: 0 auto 5px;
  border: 0;
  border-radius: 7px;
  background: #555;
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.side-button:hover {
  filter: brightness(.9);
}

.side-button.primary {
  background: #3b8ed0;
}

.settings-button {
  width: 40px;
  height: 40px;
  margin: 0 auto 5px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #555;
  font-size: 22px;
}

.settings-button:hover {
  background: #ccc;
}

.side-section-label {
  margin: 20px 0 5px;
  color: #888;
  font-size: 10px;
  font-weight: 700;
}

.tool-button {
  height: 50px;
  margin-bottom: 10px;
  line-height: 1.05;
}

.tool-button span, .tool-button small {
  display: block;
}

.tool-button small {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
}

.tool-button.active {
  outline: 3px solid rgba(0,0,0,.2);
  filter: brightness(1.2);
}

.audio-button {
  background: #4a90e2;
}

.zoom-group {
  margin-top: 10px;
}

.zoom-button {
  height: 35px;
  background: #777;
  font-size: 12px;
  margin-bottom: 2px;
}

.util-label {
  margin-top: 20px;
}

.find-button {
  background: #2e7d32;
  height: 45px;
}

.save-button {
  background: #e67e22;
  height: 45px;
}

.flow-button {
  background: #673ab7;
  height: 45px;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
#viewer-main {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  background: #ffffff;
}

.viewer-header {
  min-height: 115px;
  margin: 5px 10px 0;
  padding: 10px;
  border-radius: 7px;
  background: #ffffff;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px,1fr) auto 65px;
  column-gap: 24px;
  align-items: start;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.header-left, .header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.header-left {
  flex: 1 1 auto;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.header-controls {
  flex: 0 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-select {
  width: 110px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: #3b8ed0;
  color: white;
  font-weight: 600;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.key-select {
  width: 85px;
  margin: 0 10px;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.song-title {
  font-size: 18px;
  font-weight: 700;
}

.song-meta {
  margin-top: 3px;
  font-size: 11px;
}

.song-config {
  margin-top: 4px;
  color: #2e7d32;
  font: 700 11px Consolas, monospace;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.switch-control, .format-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 10px;
}

.format-control {
  font-size: 11px;
}

.switch-control input, .format-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.switch-track {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: #aaa;
  transition: .15s;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  transition: .15s;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.switch-control input:checked + .switch-track, .format-control input:checked + .switch-track {
  background: #3b8ed0;
}

.switch-control input:checked + .switch-track .switch-knob, .format-control input:checked + .switch-track .switch-knob {
  transform: translateX(18px);
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.library-button {
  width: 45px;
  height: 45px;
  border: 0;
  border-radius: 7px;
  background: #3b8ed0;
  color: white;
  font-size: 20px;
  font-weight: 700;
  flex: 0 0 auto;
  grid-column: 3;
  justify-self: end;
  margin: 0;
  align-self: start;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-workspace {
  position: absolute;
  inset: 125px 0 0 0;
  overflow: hidden;
  background: #ffffff;
  z-index: 1;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.song-content {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 18px 24px;
  outline: none;
  font: 18px Consolas, monospace;
  color: #1c1b1f;
  white-space: normal;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-status {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 10px);
  padding: 8px 14px;
  border-radius: 7px;
  background: rgba(30,30,30,.86);
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .15s;
}

.viewer-status.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.song-dependent.is-hidden {
  display: none !important;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
#select-prompt {
  position: absolute;
  top: 0;
  right: 0;
  width: 520px;
  height: 360px;
  z-index: 50;
  pointer-events: none;
}

#select-prompt.is-hidden {
  display: none;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.performance-controls {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
  font-size: 10px;
  grid-column: 2;
  margin: 0;
  align-self: start;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.performance-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.performance-row label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.shape-readout {
  min-width: 70px;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-col-row {
  font-family: Consolas,monospace;
  white-space: pre;
  margin: 0 0 3px;
}

.viewer-chords,.viewer-lyrics {
  white-space: pre;
  min-height: 1em;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.chord-highlight {
  display: inline;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-section-heading {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  white-space: pre;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.section-indent {
  margin-left: 30px;
}

.section-indent-half {
  margin-left: 15px;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-cpro {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.cpro-view {
  white-space: normal;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
#viewer-main,.viewer-header,.viewer-workspace,.song-content {
  background: #fff;
}

.viewer-cpro-line {
  white-space: pre;
  min-height: 1em;
  font-family: Consolas,monospace;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.cpro-chord-token {
  display: inline;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.find-result {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: minmax(0, 1fr) 110px 55px 220px !important;
  overflow: hidden !important;
}

.find-result > * {
  min-width: 0 !important;
}

.find-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  width: 220px !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.find-actions button {
  box-sizing: border-box !important;
  max-width: 105px !important;
  white-space: normal !important;
  line-height: 1.05 !important;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-header.viewer-empty .song-info {
  position: absolute;
  right: 10px;
  top: 8px;
  min-width: 0;
  text-align: center;
  width: 110px;
}

.viewer-header.viewer-empty .song-title {
  font-size: 18px;
  white-space: nowrap;
}

.viewer-header.viewer-empty .library-button {
  margin-top: 34px;
  margin-left: auto;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.song-info {
  grid-column: 1;
  align-self: center;
  min-width: 0;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-song-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 12px;
  min-height: 30px;
}

.viewer-song-tags:empty {
  display: none;
}

.viewer-song-tags .jb-tag-badge {
  transform: scale(.85);
  margin: -2px;
}

.viewer-header:not(.viewer-empty) .viewer-song-tags {
  min-height: 22px;
  margin-top: 12px !important;
}

.viewer-header:not(.viewer-empty) {
  display: grid !important;
  grid-template-columns: minmax(280px,1fr) 440px 65px !important;
  column-gap: 28px !important;
  align-items: start !important;
}

.viewer-header:not(.viewer-empty) .song-info {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-self: start !important;
  padding-top: 8px !important;
}

.viewer-header:not(.viewer-empty) .performance-controls {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: start !important;
  align-items: flex-start !important;
  margin: 0 !important;
}

.viewer-header:not(.viewer-empty) .library-button {
  grid-column: 3 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  margin: 0 !important;
}


/* --- Responsive Viewer ---
   Maintenance: Viewport adjustments for smaller screens.
*/
/* --- Responsive layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
@media (max-width: 1100px) {
/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-header {
  align-items: flex-start;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.header-left {
  align-items: flex-start;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.header-controls {
  gap: 6px;
}

/* --- Song display and chord styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.song-info {
  min-width: 210px;
}
}

/* --- Responsive layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
@media (max-width: 900px) {
/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.find-result {
  grid-template-columns: minmax(0,1fr) !important;
}

.find-actions {
  width: 100% !important;
  justify-content: flex-start !important;
}
}

/* --- Responsive layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
@media (max-width:850px) {
/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-header {
  grid-template-columns: minmax(160px,1fr) 65px;
  gap: 8px;
  min-height: 170px;
}

/* --- Controls and metadata ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.performance-controls {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: end;
}

/* --- Additional component styles ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.library-button {
  grid-column: 2;
  grid-row: 1;
}

/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-workspace {
  top: 180px;
}
}

/* --- Responsive layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
@media (max-width:950px) {
/* --- Viewer frame and layout ---
   Maintenance: selectors below control this part of the viewer interface.
   Change dimensions/colors here; check media-query overrides before adjusting widths.
*/
.viewer-header:not(.viewer-empty) {
  grid-template-columns: minmax(200px,1fr) 65px !important;
  gap: 10px !important;
}

.viewer-header:not(.viewer-empty) .performance-controls {
  grid-column: 1/-1 !important;
  grid-row: 2 !important;
  justify-self: end !important;
}

.viewer-header:not(.viewer-empty) .library-button {
  grid-column: 2 !important;
  grid-row: 1 !important;
}
}
