@import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&display=swap');

html{
    box-sizing: border-box;
}

body{
    margin: 0;
    font-family: 'Ubuntu', sans-serif;
    font-size: 12px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background{
    position: fixed;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    z-index: -1;
}

.background img{
    position: absolute;
    margin: auto;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    min-width: 50%;
    min-height: 50%;
    filter: blur(15px);
    -webkit-filter: blur(50px);
    transform: scale(1.1);
}

#visualizer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.9;
    pointer-events: none;
}

.rectangle {
    position: fixed;
    bottom: 0; /* Adjusted to be at the bottom compared to 50px (same with left) */
    left: 0;
    width: 100%;
    height: 70px;
    background: #663fa3;
    z-index: 5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.container{
    position: absolute;
    top: 200px; /* Adjust this value */
    background-color: #e7e7e7;
    height: 400px;
    width: 700px;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}

.container:hover{
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6);
}

.player-img{
    width: 300px;
    height: 300px;
    position: relative;
    top: 50px;
    left: 50px;
}

.player-img img{
    object-fit: cover;
    border-radius: 20px;
    height: 0;
    width: 0;
    opacity: 0;
    box-shadow: 0 5px 30px 5px rgba(0, 0, 0, 0.5);
}

.player-img:hover img{
    box-shadow: 0 5px 30px 5px rgba(0, 0, 0, 0.8);
}

.player-img img.active{
    width: 100%;
    height: 100%;
    transition: all 0.5s;
    opacity: 1;
}

h2{
    font-size: 25px;
    text-align: center;
    font-weight: 500;
    margin: 10px 0 0;
    position: relative;
    top: -200px;
    left: 170px;
}

h3{
    font-size: 18px;
    text-align: center;
    font-weight: 500;
    margin: 10px 0 0;
    position: relative;
    top: -160px;
    left: 170px;
}

.player-progress{
    background-color: #cb4d9c;
    cursor: pointer;
    margin: 40px 20px 35px -18px;
    height: 10px;
    width: 90%;
    position: relative;
    box-shadow: 
        0 0 5px #b668b4,
        0 0 10px #803a74,
        0 0 15px #703c70;
}

/* Saja Boys theme - inverted colors */
.player-progress.saja-theme {
    background-color: #f8cc8f;
    box-shadow: 
        0 0 5px #f8cc8f,
        0 0 10px #efc68c;
}

.progress{
    background-color: #f8cc8f;
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
    box-shadow: 
        0 0 5px #f8cc8f,
        0 0 10px #efc68c;
}

/* Saja Boys theme - inverted progress fill */
.progress.saja-theme {
    background-color: #cb4d9c;
    box-shadow: 
        0 0 5px #cb4d9c,
        0 0 10px #803a74,
        0 0 15px #803a74;
}

.progress-indicator {
    position: absolute;
    top: -20px;
    left: 0%;
    width: 80px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateX(-50%);
    transition: left 0.1s linear;
    pointer-events: none;
    z-index: 10;
    opacity: 1;
    animation: rotate 1s linear infinite;
    animation-play-state: paused; /* Start paused by default */
    filter: drop-shadow(0 0 2px #4a90e2) drop-shadow(0 0 4px #4a90e2) drop-shadow(0 0 1px rgba(74, 144, 226, 0.8));
}

/* Default indicator image */
.progress-indicator.huntrix-bl-icon {
    background-image: url('assets/huntrix-bl-icon.png');
}

/* Saja Boys indicator image */
.progress-indicator.saja-icon {
    background-image: url('assets/saja-icon.png');
    width: 40px; 
    animation: rotate 1s linear infinite;
    animation-play-state: paused; /* Start paused by default */
    filter: drop-shadow(0 0 2px #ff69b4) drop-shadow(0 0 4px #ff69b4) drop-shadow(0 0 1px rgba(255, 105, 180, 0.8));
}

.progress-indicator.playing {
    animation-play-state: running; /* Play animation when music is playing */
}

/* Animation for the progress indicator */
@keyframes rotate {
    from {
        transform: translateX(-50%) rotate(0deg);
    }
    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

.music-duration{
    font-family: 'Pixelify Sans';
    font-size: 25px;
    position: relative;
    top: -19px;
    right: 80px;
    width: 1885px;
    display: flex;
    justify-content: space-between;
}

.player-controls{
    text-align: center;
    position: relative;
    top: -140px;
    left: 440px;
    width: 200px;
}

.fa-solid{
    font-size: 30px;
    color: #666;
    margin-right: 30px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    top: 25px;
}

.fa-solid:hover{
    filter: brightness(40%);
}

.play-button{
    font-size: 44px;
    position: relative;
    top: 30px;
}

/* Volume Controls */
.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px;
    gap: 10px;
}

.volume-control i {
    font-size: 20px;
    color: #000000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.volume-control i:hover {
    filter: brightness(40%);
}

.volume-slider {
    width: 120px;
    height: 6px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    top: 25px;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #212121;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #212121;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#volume-percent {
    font-size: 14px;
    color: #000000;
    font-weight: 500;
    min-width: 35px;
    position: relative;
    top: 25px;
}

/* Media Query for 320x240 resolution */
@media screen and (max-width: 320px) and (max-height: 240px) {
    body {
        font-size: 8px;
    }
    
    .container {
        position: absolute;
        top: 40px;
        left: 52%;
        transform: translateX(-50%);
        height: 110px;
        width: 170px;
        padding: 10px;
    }
    
    .player-img {
        width: 80px;
        height: 80px;
        top: 10px;
        left: 10px;
    }
    
    h2 {
        font-size: 12px;
        top: -60px;
        left: 50px;
    }
    
    h3 {
        font-size: 10px;
        top: -60px;
        left: 50px;
    }
    
    .player-controls {
        top: -60px;
        left: 95px;
        width: 100px;
    }
    
    .fa-solid {
        font-size: 15px;
        margin-right: 10px;
        top: 15px;
    }
    
    .play-button {
        font-size: 15px;
        top: 15px;
    }
    
    .rectangle {
        height: 20px;
        padding: 0 10px;
    }
    
    .player-progress {
        height: 5px;
        margin: 15px 10px 15px -5px;
        width: 75%;
    }
    
    .progress-indicator {
        width: 10px;
        height: 10px;
        top: -3px;
    }

    .progress-indicator.huntrix-bl-icon{
        width: 60px;
        height: 15px;
        top: -5px;
    }

    .music-duration {
        font-size: 10px;
        top: -9px;
        right: 35px;
        width: 307px;
    }
    
    .volume-control {
        margin: 10px;
        gap: 5px;
    }
    
    .volume-control i {
        font-size: 12px;
        top: -19px;
        left: 5px;
    }
    
    .volume-slider {
        width: 60px;
        height: 4px;
        top: -20px;
    }
    
    #volume-percent {
        font-size: 8px;
        top: -20px;
    }
    
    /* Adjust visualizer for small screen */
    #visualizer-canvas {
        opacity: 0.6;
    }
    
    /* Hide or minimize non-essential elements */
    .background img {
        filter: blur(8px);
        -webkit-filter: blur(8px);
    }
}