:root {
    --primary-color: white;
    --secondary-color: black;
    --hover-color: #12e780;
    --bg-light: #4646467a;
    --bg-dark: #0000006c;
    --accent-color: #1ED760;
    --accent-hover: #00e984;
    --ff: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    font-family: var(--ff);
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

h1 { font-size: 1.5rem; text-align: center; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { font-size: 0.8rem; font-weight: 600; }

/* Navbar Styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 70px;
    padding: 0 2rem;
    background-color: var(--bg-dark);
    position: relative;
    z-index: 100;
}

.logo img {
    width: 120px;
    height: 120px;
    margin: 0 0.5rem;
    cursor: pointer;
}

.user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 0 0.5rem;
    background-color: var(--accent-color);
    cursor: pointer;
}

.nav-links ul {
    display: flex;
    list-style: none;
    gap: 6rem;
    background-color: var(--bg-light);
    border-radius: 50px;
    padding: 0.5rem 4rem;
}

.nav-links a {
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-hover);
}

/* Main Content */
.content {
    display: flex;
    padding: 1rem;
    gap: 1rem;
    height: calc(100vh - 140px);
}

.sidebar {
    width: 30vw;
    height: 100%;
    padding: 1rem 2rem;
    border-radius: 20px;
    background-color: var(--bg-light);
    overflow-x: hidden;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar {
    width: 5px;
  }
  .sidebar::-webkit-scrollbar-track {
    background: #1e1e1e;
  }
  .sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
  }
  .sidebar::-webkit-scrollbar-thumb:hover {
    background: #00c386;
  }
.library {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.card:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.card .song-info{
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    white-space: nowrap;
}
.song-info h2{
    font-size: 1rem;
}
.song-info p{
    font-size: 0.8rem;
}
.card img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
}

.card i {
    font-size: 1.5rem;
    margin-left: auto;
    position: absolute;
    right: 0;
    bottom: 25%;
    transition: all 0.3s ease;
}

.card i:hover {
    color: var(--accent-hover);
    transform: scale(1.2);
}

.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    gap: 2rem;
    background-color: var(--bg-light);
    padding: 2rem;
}

.album-cover {
    width: 300px;
    height: 300px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Playbar Styles */
.playbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 70px;
    padding: 0 2rem;
    background-color: var(--bg-dark);
    z-index: 100;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 20%;
}

.now-playing-img {
    width: 50px;
    height: 50px;
    border-radius: 5px;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 60%;
}

.music-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.music-controls i {
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.music-controls i:hover {
    color: var(--accent-hover);
    transform: scale(1.1);
}

#playBtn {
    font-size: 1.4rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 80%;
}

.progress-bar span {
    font-size: 0.8rem;
    min-width: 40px;
    text-align: center;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    width: 100%;
    border-radius: 5px;
    background: var(--primary-color);
    outline: none;
    cursor: pointer;
    flex: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0;
    transition: all 0.2s ease;
}

input[type="range"]:hover::-webkit-slider-thumb {
    opacity: 1;
}

#progress {
    background: linear-gradient(to right, var(--accent-color) 0%, var(--accent-color) 0%, var(--primary-color) 0%, var(--primary-color) 100%);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 15%;
    justify-content: flex-end;
}

#volume {
    width: 100px;
}
/* Active song styling */
.card.active {
    background-color: rgba(30, 215, 96, 0.1);
    border-left: 3px solid var(--accent-color);
}

/* Volume feedback */
.volume-feedback {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    z-index: 1000;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Now playing animation */
.now-playing-img {
    animation: pulse 3s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Loading spinner */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinner container */
.loader-icon-container {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Spinner icon */
.loader-icon {
    font-size: 3rem;
    color: #1ED760;
    animation: spin 1s linear infinite;
    will-change: transform;
    display: inline-block;
    width: 1em;
    height: 1em;
    transform-origin: center;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Responsive Design */
@media (max-width: 1100px) {
    .content {
        flex-direction: column;
    }
    .logo {
        width: 50px;
        overflow: hidden;
        display: inline-block;
    }
    .logo img {
        width: 120px;
        height: auto;
    }
    .sidebar {
        width: 100%;
        max-height: 500px;
    }
    .nav-links ul{
        gap: 1rem;
        padding: 0.5rem 2rem;
    }
    .nav-links a {
        font-size: 1rem;
    }
    .container {
        height: calc(100vh - 210px);
    }
    
    .playbar {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    
    .song-info, .controls, .volume-control {
        width: 100%;
        justify-content: center;
    }
    .volume-control{
        width: 60px;
        margin-top: 2px;
    }
    .container{
        display: none;
    }
    .playbar .now-playing{
        transform: translateY(-20px) scale(1.3);
        text-align: center;
    }
    .music-controls {
        margin: 1rem 0;
    }
}