/* Custom styles layered on top of the active Bootswatch theme.
   Loaded as a constant <link> after the swappable theme stylesheet
   (static/css/main.css or dark.css), so these rules win on equal specificity. */

/* Playlist */
.playlist-item {
    transition: all 0.2s ease-in-out;
}

.playlist-artwork {
    /* float: left; */
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
}

.tag-space {
    margin-right: 3px;
}

.tag-click {
    cursor: pointer;
    transition: 400ms;
}

.tag-unclicked {
    opacity: 0.6;
}

.tag-clicked {
    box-shadow: 2px 4px 10px #777777;
    transform: scale(1.2);
    opacity: 1;
    margin: 5px;
}

.library-item {
    display: flex;
    padding: .5rem .5rem .5rem 0;
    height: 72px;
    transition: ease-in-out 200ms;
}

.library-thumb-img {
    width: 70px;
    height: 70px;
    border-radius: 5px;
}

.library-thumb-col {
    position: relative;
    padding-left: 0;
    overflow: hidden;
    margin: -0.5rem 1rem -0.5rem 0;
}

.library-thumb-grp {
    position: absolute;
    top: 0;
    left: -95px;
    width: 70px;
    margin-left: 15px;
    transition: left 300ms;
    border-radius: 5px;
    opacity: 0.7;
    font-weight: 300;
}

.library-thumb-grp-hover {
    left: -15px;
}

.library-thumb-btn-up {
    position: absolute !important;
    top: 0;
    height: 70px;
    font-size: 2em;
    padding-top: 10px;
}

.library-btn-svg {
    width: 1rem;
    fill: currentColor;
}

.library-info-col {
    margin-right: 1rem;
    padding: 3px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
}

.library-info-col .small {
    font-weight: 300;
}

.library-action {
    margin-left: auto;
}

.library-info-col .path {
    font-style: italic !important;
    font-weight: 300;
}

/* Theme changer and player button */
.floating-button {
    width: 50px;
    height: 50px;
    background-color: #aaaaaa40;
    border-radius: 50%;
    box-shadow: 0 6px 10px 0 #66666647;
    transition: all 0.1s ease-in-out;
    font-size: 25px;
    color: #9896967a;
    text-align: center;
    line-height: 52px;
    position: fixed;
    right: 50px;
}

.floating-button:hover {
    background-color: hsl(0, 0%, 43%);
    color: white;
}

#volume-slider {
    margin-top: 4px;
    margin-right: 5px;
}

.dropdown {
    display: inline-block;
}

.volume-popover-wrapper {
    position: relative;
    display: inline-block;
}

#volume-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    font-size: 20px;
    border-radius: 4px;
    display: none;
    z-index: 1000;
    white-space: nowrap;

    &[data-show] {
        display: flex;
    }

    a {
        cursor: pointer;
    }

    &::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #333;
    }
}

#playerToast {
    position: fixed;
    right: 20px;
    top: 20px;
    max-width: 800px;
}

#playerContainer {
    display: flex;
    height: 105px;
}

#playerArtwork {
    width: 80px;
    height: 80px;
    border-radius: 5px;
}

#playerArtworkIdle {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    margin: auto;
    padding: 15px;
}

#playerInfo {
    position: relative;
    padding-top: 6px;
    margin-left: 10px;
    height: 80px;
    font-size: 15px;
}

#playerTitle {
    display: block;
    white-space: nowrap;
}

#playerArtist {
    display: block;
    white-space: nowrap;
    min-height: 20px;
}

#playerActionBox {
    margin-top: 5px;
    display: flex;
    float: right;
}

#playerBarBox {
    margin-top: 5px;
    height: 15px;
    width: 100%;
    cursor: pointer;
}

.scrolling {
    animation: scrolling 8s linear infinite;
}

@keyframes scrolling {
    0% {
        transform: translateX(100%);
        opacity: 1;
    }

    95% {
        transform: translateX(-90%);
        opacity: 1;
    }

    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

h3 {
    font-size: 1.25rem;
}

legend {
    font-size: 1rem;
}

/* Light theme uses a soft grey page background rather than flatly's pure
   white. Scoped to the body element (not the --bs-body-bg variable) so cards,
   modals, inputs and other surfaces keep their white background; and to the
   light-theme hook so the dark theme is unaffected. */
[data-bs-theme="light"] body {
    background-color: #e9ecef;
}

.toast {
    max-width: 700px;
}

/* SVG icon sprite */
.svg-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    display: inline-block;
}

/* Native dialog modals */
dialog {
    border: none;
    border-radius: 0.375rem;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);

    &::backdrop {
        background: rgba(0, 0, 0, 0.5);
    }
}

/* CSS hover for library thumbnail action buttons (replaces JS hover binding) */
.library-item:hover .library-thumb-grp {
    left: -15px;
}
