@font-face {
    font-family: 'Elsie';
    src: url(../images/ElsieSwashCaps-Black.ttf) format('truetype');
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f4f4;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 120px;
    max-height: 120px;
    background: darkblue;
    color: #fb8e8e;
    padding: 1rem;
    z-index: 1001;
    box-sizing: border-box;
    justify-content: space-between;
}

header :is(h1, h2, h4) {
    font-family: Elsie;
    -webkit-text-stroke: 5px #592988;
    paint-order: stroke fill;
    overflow: auto;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
    margin: 0;
}

.hidden {
    display: none;
}

#list-view,
#detail-view,
#session-view,
#session-detail-view,
#selection-view,
#backup-view {
    padding-top: 120px;
    /* Adjust this value to match your header's height */
}

#song-list,
#session-list,
#session-songs-list,
#selection-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#song-list li,
#session-list li,
#session-songs-list li,
#selection-list li {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background: white;
    cursor: pointer;
    position: relative;
}

#song-list li:active,
#session-list li:active,
#session-songs-list li:active {
    background: #eee;
}

#detail-view,
#session-view {
    background: white;
    /* min-height: 100vh; */
    width: 100%;
    overflow-x: auto;
    /* Allows horizontal scrolling if content is too wide */
}

#lyric-content {
    background-color: white;
    width: max-content;
    /* Grows horizontally with the text */
    /* min-width: 100%; */
    padding: 20px;
    /* white-space: pre-wrap; */
    font-size: 0.7rem;
    line-height: 1.7;
    transition: font-size 0.3s ease-in-out;
}

#back-button,
#session-back-button,
#session-detail-back-button,
#selection-back-button,
#backup-back-button {
    border: none;
    margin-right: auto;
    padding: 0;
    background-image: url(../images/back_arrow.avif);
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    width: 40px;
    height: 28px;
    cursor: pointer;
    filter: drop-shadow(0px 0px 4px #fd54cc);
}

#font-size {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 10px;
    bottom: 10px;
    right: 10px;
    z-index: 1000;
    /* Stays above the lyric text */
}

#font-size .font-btn {
    width: 50px;
    height: 50px;
    background-color: darkblue;
    border: 0;
    border-radius: 25px;
    color: #dfdfff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

#font-up {
    padding: 0px 0px 2px 0px;
}

#font-down {
    padding: 0px 0px 5px 0px;
}

#button-set {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

#button-set .btn-set {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0;
}

#selection-all-btn,
#backup-all-btn {
    border: none;
    padding: 0;
    background-image: url(../images/select_all.avif);
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

#selection-none-btn,
#backup-none-btn {
    border: none;
    padding: 0;
    background-image: url(../images/select_none.avif);
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    width: 25px;
    height: 25px;
    cursor: pointer;
}

#autoscroll-down-button {
    border: none;
    padding: 0;
    background-image: url(../images/autoscroll_down.avif);
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    width: 25px;
    height: 25px;
    cursor: pointer;
    transition: filter 0.2s ease;
}

#autoscroll-down-button.active-autoscroll-btn {
    filter: drop-shadow(0px 0px 4px #4bff4b);
}

#autoscroll-speed-slider {
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    flex-grow: 1;
    height: 8px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
    margin: 0 10px;
    filter: drop-shadow(0px 0px 4px #fd54cc);
}

#autoscroll-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: darkblue;
    cursor: pointer;
}

#autoscroll-speed-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: darkblue;
    cursor: pointer;
}

#add-session-btn {
    color: #20ff0014;
    text-shadow: 0px 0px 1px #00d500;
}

.song-category,
.session-datetime {
    position: absolute;
    top: 3px;
    right: 15px;
    font-size: 0.65rem;
    color: #888;
}

#category-menu {
    position: fixed;
    top: 65px;
    right: 15px;
    background: rgba(0, 0, 54, 0.9);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1002;
    padding: 8px 0;
    min-width: 160px;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

#category-menu.hidden {
    display: block;
    /* Overrides the generic .hidden { display: none } to allow transitions */
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    visibility: hidden;
    pointer-events: none;
}

.category-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1rem;
    color: wheat;
    border-bottom: 1px solid #eee;
}

.category-item.selected {
    background: #1a1a4b;
    font-weight: bold;
    color: gold;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:active {
    background: #f0f0f0;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-actions {
    position: absolute;
    top: 20px;
    right: 15px;
}

.session-action-btn {
    cursor: pointer;
    font-size: 0.7rem;
    padding-left: 1px;
    border-radius: 8px;
    width: 22px;
    height: 22px;
    margin-left: 5px;
    padding: 0;
}

.session-edit-btn {
    background: #d9d900;
    border: 2px outset yellow;
}

.session-delete-btn {
    background: #c80000;
    border: 2px outset red;
}

.song-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

#session-detail-headers,
#selection-edit-headers,
#backup-headers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}

.session-song-item {
    padding-right: 22px !important;
}

.sort-actions {
    position: absolute;
    right: 0px;
    top: 60%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #bd0000;
    line-height: 12px;
}

/* Custom Dialog Styles */
dialog {
    border: 1px solid white;
    border-radius: 12px;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: #00003a;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

dialog h3 {
    margin-top: 0;
    color: white;
}

dialog p {
    color: white;
    margin: 15px 0;
    line-height: 1.5;
}

#prompt-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.prompt-actions button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

#prompt-confirm {
    background-color: white;
    color: darkblue;
}

#prompt-cancel {
    background: darkblue;
    color: white;
}

#backup-selection-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#backup-selection-list li {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
}