/* Mobile overrides for SJ Djembe Editor */

body {
    padding-bottom: 140px; /* Room for a taller/wrapped bottom bar */
}

#title {
    font-size: 2.5em;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 0 10px;
}

#description {
    font-size: 14px;
}

/* Allow the main song container to scroll horizontally */
#song {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding-bottom: 30px;
}

/* Flex layout for each row to keep everything aligned on a single line that scrolls */
.song-row {
    display: flex;
    align-items: flex-end;
    width: max-content;
    min-width: 100%;
    padding: 15px 15px 30px 15px;
    box-sizing: border-box;
    border-bottom: 1px solid #f0f0f0;
    gap: 0;
}

/* Reset floated items inside flex container */
.shift-buttons {
    float: none;
    margin-top: 0;
    margin-right: 15px;
    margin-bottom: 5px;
    flex-direction: column;
}

.shift-up-button, .shift-down-button {
    padding: 8px;
    font-size: 1.5em;
}

.phrase-label {
    float: none;
    margin-top: 0;
    margin-bottom: 5px;
    width: 80px;
    font-size: 1.2em;
    word-wrap: break-word;
    flex-shrink: 0;
}

.instrument-select {
    float: none;
    margin-top: 0;
    margin-bottom: 5px;
    margin-right: 10px;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

#author {
    margin: -10px 0 20px 0;
    font-size: 1em;
}

#notes {
    max-width: 100%;
    padding: 0 15px;
    font-size: 14px;
}

.phrase {
    margin-top: 0;
    flex-shrink: 0;
}

/* Absolute pixel widths instead of viewport widths for readable touch targets */
.four-bar-svg {
    width: 720px; /* 4 bars * 180px */
    background-size: 180px;
}

.three-bar-svg {
    width: 720px;
    background-size: 180px;
}

.six-bar-svg {
    width: 1440px;
    background-size: 180px;
}

.four-four-width {
    width: 45px; /* 180px / 4 notes */
}

.three-four-width {
    width: 60px; /* 180px / 3 notes */
}

.six-four-width {
    width: 60px;
}

/* Action buttons on the right side of each phrase */
.remove-button, .copy-button, .play-button, .play-from-here-button, .repeat-button {
    float: none;
    margin-top: 0;
    margin-left: 0;
    margin-bottom: 5px;
    width: 45px;
    height: 45px;
    font-size: 18px;
    flex-shrink: 0;
}

.phrase-actions {
    width: 250px;
    flex-shrink: 0;
    margin-left: 15px;
}

.phrase-actions label {
    font-size: 16px;
    padding: 4px;
}

.hand-label {
    font-size: 14px;
    line-height: 22px;
}

/* Ensure the note touch target is a bit taller and easier to tap */
.note::before {
    width: 40px;
    height: 40px;
}

/* Bottom Bar fixes for wrapping on smaller screens */
#bottom-bar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 5px;
}

#bottom-bar .action-button {
    font-size: 22px;
    padding: 10px 15px;
    margin: 4px;
}

#bottom-bar label[for="bpmDropdown"],
#bpmDropdown {
    font-size: 18px !important;
    margin: 4px;
}

/* Make progress bar stretch across full width on a new line */
#progressBar {
    flex-basis: 100%;
    margin-top: 15px;
    margin-bottom: 5px;
}

/* Redesign the note selector dropdown to be a large grid for easy tapping */
.custom-dropdown {
    width: 280px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.custom-option {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid #eee;
    margin: 4px;
    border-radius: 8px;
    padding: 0;
    background-color: #fafafa;
}

.custom-option:active {
    background-color: #007bff;
    color: white;
}

.instrument-dropdown {
    width: max-content;
    flex-direction: column;
    flex-wrap: nowrap;
}

.instrument-option {
    width: auto;
    height: 50px;
    justify-content: flex-start;
}

/* Disable hover tooltips on mobile since they get stuck and overlap UI */
.instant-tooltip {
    display: none !important;
}
