:root {
    --clr-body: hsl(0, 0%, 0%);
    --clr-visible: hsl(0, 0%, 100%);

    --clr-border: hsl(0, 0%, 10%);
    --clr-skeleton: hsl(0, 0%, 20%);
    
    --clr-search-button: hsl(0, 0%, 10%);
    --clr-search-input: hsl(0, 0%, 15%);

    --clr-card: hsl(0, 0%, 10%);
    --clr-card-hover: hsl(0, 0%, 12%);
    --clr-download-button: hsl(0, 0%, 20%);

    --clr-accent: hsl(142, 75%, 48%);
    --clr-accent-text: hsl(0, 0%, 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    display: none;
}


::selection {
    color: var(--clr-body);
    background: var(--clr-visible);
}

body {
    background: var(--clr-body);
    color: var(--clr-visible);
}

a {
    text-decoration: none;
}

.seo-content {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@font-face {
    font-family: "VKP Sans";
    src: url(assets/fonts/acme.ttf);
}


header {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    background: var(--clr-body);
    border-bottom: 2px solid var(--clr-border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    position: fixed;
    top: 0;
    z-index: 1;

    .icon {
        width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        
        & img {
            width: 100%;
            aspect-ratio: 1/1;
        }
    }

    & h1 {
        font-size: 24px;
        letter-spacing: 1px;
        font-family: VKP Sans;
        color: var(--clr-visible);
        cursor: pointer;
    }
}

.search-container {
    padding-left: 16px;
    position: relative;
    width: 44px;
    transition: 0.4s ease;

    & input {
        width: 100%;
        height: 44px;
        background: var(--clr-search-input);
        
        padding: 10px;
        padding-left: 16px;
        
        border: none;
        outline: none;
        border-radius: 500px;
        
        font-size: 14px;
        color: var(--clr-visible);
        
        transition: 0.4s ease;
        opacity: 0;
    }

    & button {
        position: absolute;
        top: 0;
        right: 0;

        width: 44px;
        aspect-ratio: 1/1;
        border: none;
        border-radius: 50%;
        fill: var(--clr-visible);
        background: var(--clr-search-button);
        
        display: flex;
        align-items: center;
        justify-content: center;

        cursor: pointer;
    }

    &.active {
        width: 50%;
    }

    &.active input {
        opacity: 1;
    }
}

#empty-state {
    width: 100%;
    padding: 8px;
    
    font-size: 16px;
    text-align: center;
    color: var(--clr-visible);
    
    position: fixed;
    left: 50%;
    transform: translate(-50%, 0);
}


/* ==============
    Songs Grid
================= */

.music-grid {
    padding-top: calc(56px + 25px);
    padding-inline: 20px;
    padding-bottom: calc(173px + 25px);

    display: grid;
    gap: 25px;
    grid-template-columns: repeat(3, 1fr);
}

/* Song Card */
.song {
    padding: 15px;
    border-radius: 30px;
    corner-shape: squircle;
    background: var(--clr-card);
    transition: 0.3s;
    border: 1px solid transparent;
}
.song:hover {
    transform: scale(1.03);
    background: var(--clr-card-hover);
}
.song.active {
    border: 1px solid var(--clr-accent);
}

/* Song Thumbnail */
.song img {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 20px;
    corner-shape: squircle;
    background: var(--clr-skeleton);
}

/* Song Title */
.song h3 {
    margin-top: 10px;
}

/* Buttons Container */
.actions {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
}

/* Buttons */
.actions button {
    height: 48px;
    border: none;
    outline: none;
    border-radius: 20px;
    corner-shape: squircle;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}
.play {
    aspect-ratio: 2/1;
    background: var(--clr-accent);
    color: var(--clr-accent-text);
    font-size: 14px;
    font-weight: 500;
}
.download {
    aspect-ratio: 1/1;
    fill: var(--clr-visible);
    background: var(--clr-download-button);
}


/* ===============
    Mini Player
================== */

.player {
    width: 100%;
    padding: 20px;
    padding-top: 12px;
    background: var(--clr-card);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    
    display: flex;
    flex-direction: column;

    position: fixed;
    bottom: 0;
    z-index: 1;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-left img {
    width: 40px;
    aspect-ratio: 1/1;
    border-radius: 12px;
    corner-shape: squircle;
    object-fit: cover;
    background: var(--clr-skeleton);
}

/* Internet Connection Status */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* Offline = Red */
.status-indicator.offline {
  background: #ff5252;
  box-shadow: 0 0 6px #ff5252;
}

/* Online = Green */
.status-indicator.online {
  background: #00c853;
  /* box-shadow: 0 0 6px #00c853; */
  animation: pulse 1.5s infinite;
}

/* Animation for Online */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(0, 200, 83, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0); }
}


.player-controls {
    margin-top: 5px;
    margin-left: -32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.player-controls button {
    width: 48px;
    aspect-ratio: 1/1;
    font-size: 16px;
    color: var(--clr-visible);
    background: none;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    outline: none;
    cursor: pointer;
}
#playBtn {
    border-radius: 50%;
    color: var(--clr-accent-text);
    background: var(--clr-accent);
}
#loopBtn {
    width: 32px;
    height: 32px;
    font-size: 10px;
    border-radius: 500px;
    corner-shape: squircle;
}
#loopBtn.active {
    background: var(--clr-visible);
}

/* Progress Bar */
#progress {
    width: 100%;
    margin-top: 12px;
    accent-color: var(--clr-accent);
}

/* Timestamp */
.time {
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--clr-visible);
    opacity: 0.8;
}


/* Go to Top (Button) */
#goTopBtn {
    position: fixed;
    right: 20px;
    bottom: calc(173px - 40px - 12px);
    z-index: 100;

    width: 40px;
    aspect-ratio: 1/1;
    border-radius: 50%;
    background: var(--clr-visible);
    fill: var(--clr-body);

    border: none;
    outline: none;
    cursor: pointer;

    display: none;
    align-items: center;
    justify-content: center;
}

/* ===============
    Responsive
================== */

@media(max-width:900px) {
    .search-container.active {
        width: 60%;
    }
    .music-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:600px) {
    .search-container.active {
        width: 100%;
    }
    
    .music-grid {
        grid-template-columns: 1fr;
    }

    .song:hover {
        transform: scale(1);
        background: var(--clr-card);
    }
}
