@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: clamp(1rem, 1.2vw + 0.5rem, 1.5rem);
    background: #0f0f0f;
}

body {
    background: #0f0f0f;
    font-family: 'Roboto', sans-serif;
    color: #aaaaaa;
    transition: background-color 0.3s, color 0.3s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}

@media (orientation: portrait) {
    .playlist-header {
        right: 10px;
        width: 90% !important;
    }
}

.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 35px;
    position: fixed;
    width: 45%;
    top: 5px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    padding-left: 20px;
    z-index: 5;
}

.dark-mode .playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 35px;
    position: fixed;
    width: 45%;
    background: rgba(0, 0, 0, 0.9);
    top: 5px;
    border-radius: 20px;
    border: 1px solid #555;
    padding-left: 20px;
}

.player-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.player {
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    top: 0;
    bottom: 0;
    height: 100%;
}

.player-header {
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px;
    z-index: 2;
}

.player-header-items {
    flex-direction: column;
    color: mediumpurple;
    font-weight: 400;
    display: flex;
    align-items: center;
    color: #311E56;
}

.player-header-items a {
    text-decoration: none;
    color: #311E56;
    cursor: pointer;
}

.player-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: #311E56;
    transition: color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-header ion-icon {
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaaaaa;
}

.player-controls {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    padding: 10px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url(bg-controls.jpg) no-repeat center center;
    background-size: cover;
    width: 100%;
    height: 50%;
    position: absolute;
    bottom: 0;
}

.gradient-overlay {
    top: 0;
    position: absolute;
    width: 100%;
    height: 50vh;
    /* Altura do gradiente */
    background: linear-gradient(to bottom, rgba(19, 5, 31, 0.99), rgba(19, 5, 31, 0.5), transparent 20%, transparent 85%, rgba(0, 0, 0, 0.63), rgba(0, 0, 0, 0.99));
    pointer-events: none;
}

#music-player {
    width: 100%;
    height: 50vh;
    /*pointer-events: none;*/
}

.info {
    align-items: center;
    display: flex;
    position: fixed;
    bottom: 20%;
    width: 97%;
    margin: 0 auto;
    flex-direction: column;
    right: 0;
    left: 0;
}

.info .title {
    font-family: 'Roboto', sans-serif;
    margin-left: 5px;
    margin-right: 5px;
    font-size: 1.2rem;
    color: #f1f1f1;
}

.info .artist {
    font-weight: 400;
    color: #aaaaaa;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: #FFFFFF20;
    height: 3px;
    border-radius: 5px;
    outline: none;
    transition: opacity .15s ease-in-out;
}

input[type="range"]:hover {
    opacity: 1;
}

/* Webkit Browsers (Chrome, Safari, Edge) */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #00ffbf;
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid #00ffbf;
    margin-top: -5px;
}

/* Mozilla Browsers (Firefox) */
input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #00FFBF;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* IE Browsers */
input[type="range"]::-ms-thumb {
    width: 20px;
    height: 20px;
    background: #00FFBF;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #fff;
}

.controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 50px;
    position: fixed;
    bottom: 10px;
    margin-left: 10px;
    margin-right: 10px;
    gap: 20px;
    right: 0;
    left: 0;
}

.control-button {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #00ffbf;
    transition: color 0.3s;
}

.play-outline {
    font-size: 50px;
}

.pause-outline {
    font-size: 50px;
}

.control-button:hover {
    color: #F966D6;
}

.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0px;
    bottom: 70px;
    position: fixed;
    left: 10px;
    right: 10px;
    color: #aaa;
}

#progress {
    flex: 1;
    margin: 0 10px;
}

.repeat-number {
    color: #00ffbf;
    display: flex;
    position: fixed;
    bottom: 50px;
    left: 30px;
    justify-content: center;
    align-items: center;
}

/* PLAYLIST CONFIG */
#playlist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

#playlist {
    padding: 10px;
    text-align: left;
    height: 100%;
    position: relative;
    width: auto;
    background: radial-gradient(circle, rgba(72, 46, 120, 1) 0%, rgba(23, 6, 43, 1) 100%);
}

#playlist h2 {
    margin-top: 0;
    font-weight: 400;
    height: 40px;
}

#playlist ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%;
    overflow-y: auto;
    height: calc(100% - 30px);
    scrollbar-width: none;
    position: relative;
    top: 35px;
}

#playlist ul li {
    display: flex;
    align-items: center;
    height: 90px;
}

#playlist ul li img {
    width: 150px;
    height: 85px;
    border-radius: 5px;
    object-fit: cover;
    object-position: center;
    margin-right: 10px;
    position: absolute;
}

#playlist ul li span {
    flex: 1;
    position: relative;
    margin-left: 160px;
    font-size: 0.9rem;
    color: #eee;
}

#playlist ul li p {
    margin-left: 160px;
    color: #00ffbf;
    font-size: 0.95rem;
}

#playlist ul li:hover {
    background: #311e56;
    color: #fff;
    cursor: pointer;
}

#close-playlist {
    background: none;
    border: none;
    color: #00ffbf;
    cursor: pointer;
    margin-right: 10px;
    margin-top: 5px;
    right: 0;
    position: absolute;
    font-size: 24px;
}

.dark-mode .player {
    background: linear-gradient(0deg, rgba(87,32,162,1) 0%, rgba(19,5,31,1) 49%);
}

.dark-mode #close-playlist {
    color: #00ffbf;
    align-items: center;
    cursor: pointer;
}

.dark-mode .player-header-items {
    color: #aaa;
}

.dark-mode .player-header-items a {
    color: #aaa;
}

.dark-mode .player-header button {
    color: #00FFBF;
}

.dark-mode .player-header ion-icon {
    color: #fafafa;
    cursor: pointer;
}

.dark-mode .control-button {
    color: #00ffbf;
}

.dark-mode .control-button:hover {
    color: #00ffbf;
}

.dark-mode #playlist {
    background: #00000070;
    color: #ffffff;
    bottom: 0;
    z-index: 4;
}

.dark-mode #playlist ul li {
    padding: 2px 0px;
    border-bottom: 1px solid #6666663d;
}


.dark-mode #playlist-items .title {
    font-weight: 400;
    color: #f1f1f1;
    position: relative;
    margin-left: 160px;
}

.dark-mode #playlist-items .author {
    color: #AAAAAA;
    position: relative;
    margin-left: 160px;
}

.dark-mode .header-icons {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    color: #aaaaaa;
    border-radius: 20px;
    background: #242424;
    cursor: pointer;
}

.dark-mode .header-icons ion-icon {
    color: #aaaaaa !important;
    cursor: pointer;
}

/* PREENCHIMENTO DINAMICO */
input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #00FFBF, #00FFBF) 0% / var(--slider-value) 100% no-repeat, #311e56;
    height: 2px;
    /* Define a altura do preenchimento dinâmico */
    border-radius: 5px;
}

input[type="range"]::-moz-range-track {
    background: linear-gradient(to right, #00FFBF, #00FFBF) 0% / var(--slider-value) 100% no-repeat, #ddd;
    height: 2px;
    /* Define a altura do preenchimento dinâmico */
    border-radius: 5px;
}

input[type="range"]::-ms-track {
    background: linear-gradient(to right, #00FFBF, #00FFBF) 0% / var(--slider-value) 100% no-repeat, #ddd;
    height: 2px;
    /* Define a altura do preenchimento dinâmico */
    border-radius: 5px;
}

input[type="range"]::-ms-fill-lower {
    background: #00FFBF;
    height: 3px;
    /* Define a altura do preenchimento dinâmico */
    border-radius: 5px;
}

input[type="range"]::-ms-fill-upper {
    background: #0f0f0f;
    height: 3px;
    /* Define a altura do preenchimento dinâmico */
    border-radius: 5px;
}

/*//////////////////////// MEDIA QUERY PORTRAIT /////////////////////////////// */
@MEDIA (orientation: portrait) {
    body .dark-mode {
        background: linear-gradient(0deg, rgba(87,32,162,1) 0%, rgba(19,5,31,1) 10%);
    }

    .dark-mode .player {
        max-width: 100%;
        height: 100vh;
    }

    .dark-mode #music-player {
        height: 50%;
    }
}

/* //////////////////// MEDIA QUERY LANDSCAPE MODE ////////////////////////// */
@media (orientation: landscape) {
    .player {
        flex-direction: row;
        max-width: 100%;
        height: 100vh;
    }

    #music-player {
        width: 50%;
        height: 100%;
    }

    .info {
        align-items: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        position: fixed;
        bottom: 40%;
        left: 50%;
        width: auto;
    }

    .player-header {
        height: auto;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .progress-container {
        left: 50%;
        display: flex;
        align-items: center;
        margin-left: 10px;
        position: fixed;
        bottom: 80px;
    }

    .controls {
        left: 50%;
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 5px;
    }

    #playlist {
        padding: 10px;
        display: flex;
        left: 50%;
        position: absolute;
        top: 0;
    }

    #playlist h2 {
        display: none;
    }

    .repeat-number {
        color: #000;
        background: #00ffbf;
        border-radius: 50%;
        padding: 2px;
        display: flex;
        position: fixed;
        bottom: 55px;
        left: 54.4%;
        width: 10px;
        justify-content: center;
        align-items: center;
    }

    .gradient-overlay {
        top: 0;
        left: 0;
        position: absolute;
        width: 50%;
        height: 100vh;
        /* Altura do gradiente */
        background: linear-gradient(to bottom, rgba(19, 5, 31, 0.99), rgba(19, 5, 31, 0.5), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.99));
        pointer-events: none;
    }

    .player-controls {
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex: 1;
        padding: 10px;
        background: linear-gradient(90deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url(bg-controls.jpg) no-repeat center center;
        background-size: cover;
        width: 50%;
        height: 100%;
        position: absolute;
        bottom: 0;
        right: 0;
    }
}
}

/*end landscape mode*/
/*playlist new design*/
#playlist-items li {
    display: flex;
    align-items: center;
    margin: 5px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#playlist-items .text-container {
    display: flex;
    flex-direction: column;
}

#playlist-items .author {
}

.busca {
    font-weight: 500;
    text-transform: uppercase;
    width: 90%;
    height: 30px;
    color: #00ffbf;
    border: none;
    background: transparent;
}

.dark-mode .busca {
    font-weight: 500;
    text-transform: uppercase;
    width: 90%;
    height: 30px;
    color: #00ffbf;
    border: none;
    background: #000;
}

.busca:focus {
    outline: none;
}

.header-icons {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    color: #aaaaaa;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
}

.header-icons ion-icon {
    cursor: pointer;
}

#playlist-items .title {
    font-weight: 500;
}

/*VOLUME CONFIG*/
.volume-container {
    display: flex;
    align-items: center;
    position: relative;
    padding: 10px;
}

.volume-icon {
    cursor: pointer;
    color: #00ffbf;
}

.volume-slider-container {
    display: none;
    /* Escondido por padrão */
    top: -10px;
    left: 40px;
    background: #311e56;
    border-radius: 20px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    position: relative;
    opacity: 50%;
    width: 150px;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    background: #444;
    border-radius: 5px;
    outline: none;
    background: linear-gradient(to right, #4caf50 var(--slider-value, 50%), #ddd 0%);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background-color: #4caf50;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background-color: #4caf50;
    border-radius: 50%;
    cursor: pointer;
}

.volume-value {
}
