/* Fonts */
@font-face {
    font-family: 'HeadingNowVariable';
    font-style: normal;
    font-stretch: normal;
    font-display: swap;
    src: url('../fonts/HeadingNowVariable.woff2') format('woff2');
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'HeadingNowVariable', Arial, sans-serif;
    font-variation-settings: "wdth" 668, "wght" 500;
    background-color: #121212;
    color: #fff;
    overflow-x: hidden;
    user-select: none;
}

body.modal-open {
    overflow: hidden;
}

h2, p {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: white;
    border-radius: 10px;
    border: 2px solid transparent;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: rgba(0, 0, 0, .8);
    color: white;
    padding: 10px 20px;
    width: 100%;
    z-index: 100;
    position: fixed;
    top: 0;
    backdrop-filter: blur(20px);
}

.header-info {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    background-color: rgba(34, 34, 34, .8);
    color: white;
    width: 100%;
    z-index: 100;
    position: fixed;
    top: 65px;
    backdrop-filter: blur(20px);
}

.header-info .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    width: 100%;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header img {
    max-height: 45px;
    cursor: pointer;
}

.search-wrapper {
    display: flex;
    align-items: center;
}

.header input[type="search"] {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #222;
    color: white;
    outline: none;
    font: inherit;
    font-size: 14px;
    width: 200px;
    max-width: 600px;
    transition: width 0.3s ease-in-out;
}

.header input[type="search"]::placeholder {
    color: #777;
}

.header input[type="search"]:focus {
    border-color: rgba(145, 152, 229, .8);
    box-shadow: 0 0 0 2px rgba(145, 152, 229, .8);
}

@media (min-width: 993px) {
    .header input[type="search"] {
        margin-right: 10px;
    }

    .header input[type="search"]:focus {
        width: 300px;
    }
}

.track-count {
    font-size: 14px;
    color: #aaa;
}

.countdown {
    font-size: 14px;
    color: #aaa;
}

.header .links a {
    color: white;
    text-decoration: none;
    outline: 0 solid transparent;
    outline-offset: .5rem;
    padding: 4px 8px;
    border-radius: 5px;
    transition: outline .15s, outline-offset .15s ease-out;
}

.header .links a:hover {
    text-decoration: none;
    outline: .15rem solid #fffc;
    outline-offset: .1875rem;
}

/* Content */
main {
    margin-top: 125px;
}

.content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    transition: opacity 0.25s ease-in-out;
}

.jam-track {
    width: 270px;
    margin: 10px;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-color: rgba(236, 237, 238, .1);
    display: flex;
    align-items: center;
    color: white;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    outline: 0 solid transparent;
    outline-offset: .5rem;
    transition: outline .15s, outline-offset .15s ease-out;
}

.jam-track h2 {
    font-size: 16px;
    line-height: 1.2em;
}

.jam-track img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 10px;
    margin-right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.jam-track img.loaded {
    opacity: 1;
}

.jam-track:hover {
    outline: .15rem solid #fffc;
    outline-offset: .1875rem;
}

.jam-track p {
    color: #888;
}

/* Label Container */
.label-container {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

/* Labels */
.featured-label,
.new-label {
    background-color: rgba(255, 215, 0, 0.9);
    padding: 2px 6px;
    border-radius: 8px;
    transform: skewX(-14deg);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-label svg,
.new-label svg {
    fill: #000;
}

.new-label {
    background-color: rgba(0, 150, 255, 0.9);
}

/* Mobile */
@media (max-width: 992px) {
    .header {
        position: relative;
    }

    .header .container {
        flex-direction: column;
        align-items: center;
    }

    .header img {
        margin-bottom: 10px;
    }

    .search-wrapper {
        width: 100%;
        flex-direction: column;
    }

    .header input[type="search"] {
        width: 100%;
    }

    .header-info {
        position: relative;
        top: 0;
        backdrop-filter: none;
    }

    .header-info .container {
        flex-direction: column;
        align-items: center;
    }

    main {
        margin-top: 10px;
    }

    .content {
        flex-direction: column;
        align-items: center;
    }

    .jam-track {
        width: 100%;
        max-width: 600px;
        margin: 5px 0;
        padding: 10px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1000;
    cursor: pointer;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2a2a2a;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    cursor: auto;
}

.modal-close {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 50px;
    color: #cccccc;
    cursor: pointer;
    line-height: 1;
    padding: 0px 10px;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-header img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background-color: rgba(236, 237, 238, .1);
}

.track-info {
    flex-grow: 1;
}

.play-button {
    display: none;
}

.mute-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    margin-left: auto;
}

.mute-icon,
.unmute-icon {
    fill: white;
    width: 32px;
    height: 32px;
}

.unmute-icon {
    display: none;
}

.mute-button {
    background-color: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
}

.modal-body {
    margin-top: 20px;
}

.modal-details,
.modal-difficulties {
    padding: 15px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.modal-difficulties {
    display: flex;
    flex-shrink: 0;
    width: fit-content;
    flex-wrap: wrap;
    gap: 10px;
}

/* Difficulties */
.difficulty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-right: 5px;
}

.instrument-icon {
    width: 30px;
    height: 30px;
    background-image: url('../images/instrument-icons.png');
    background-repeat: no-repeat;
    margin-right: 10px;
}

.guitar { background-position: 0 0; }
.drums { background-position: -30px 0; }
.bass { background-position: -60px 0; }
.vocals { background-position: -90px 0; }
.plastic-guitar { background-position: -120px 0; }
.plastic-drums { background-position: -150px 0; }
.plastic-bass { background-position: -180px 0; }

.difficulty-bars {
    display: flex;
    align-items: center;
}

.difficulty-bar {
    height: 22px;
}

.difficulty-bar span {
    display: inline-block;
    width: 8px;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    transform-origin: left;
    transform: skewX(-8deg);
    margin-right: 5px;
    border-radius: 2px;
}
.active { background-color: white !important; }

.filter-wrapper {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.custom-select {
    font: inherit;
    font-size: 16px;
    background-color: rgba(236, 237, 238, .1);
    color: white;
    border: none;
    padding: 8px 35px 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    outline: 0 solid transparent;
    outline-offset: .5rem;
    transition: outline .15s, outline-offset .15s ease-out;
}

.custom-select option {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #2a2a2a;
    padding: 8px;
}

.custom-select:hover {
    outline: .15rem solid #fffc;
    outline-offset: .1875rem;
}

@media (max-width: 992px) {
    .filter-wrapper {
        padding: 0 15px;
    }

    .custom-select {
        width: 100%;
        max-width: 600px;
    }
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.modal-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

@media (max-width: 768px) {
    .modal-nav {
        width: 32px;
        height: 32px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }
}

/* Loading Spinner */
.loading-spinner {
    min-width: 80px;
    min-height: 80px;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 10px;
    background-color: rgba(236, 237, 238, .1);
    position: relative;
    margin-right: 10px;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
