:root {
    --bg-black: #000000;
    --bg-dark: #121212;
    --bg-light: #282828;
    --accent-color: #1ed760;

    --text-white: #ffffff;
    --text-gray: #b3b3b3;
    --sidebar-width: 240px;
    --player-height: 90px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr 0px;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
    transition: grid-template-columns 0.3s ease;
}

.app-container.show-queue {
    grid-template-columns: var(--sidebar-width) 1fr 280px;
}


/* Sidebar */
.sidebar {
    background-color: var(--bg-black);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo {
    padding: 0 12px;
    margin-bottom: 20px;
}

.logo img {
    height: 40px;
}

.nav-links,
.library-links {
    list-style: none;
}

.nav-links li,
.library-links li {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-gray);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.nav-links li:hover,
.library-links li:hover,
.nav-links li.active {
    color: var(--text-white);
    background-color: var(--bg-light);
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* Main Content */
.main-view {
    background: linear-gradient(to bottom, #1e1e1e, var(--bg-dark));
    overflow-y: auto;
    padding: 24px 32px;
    position: relative;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    position: sticky;
    top: 0;
    background: transparent;
    z-index: 100;
    padding: 8px 0;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-profile {
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* Song Cards */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.song-card {
    background-color: #181818;
    padding: 16px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}



.song-card:hover {
    background-color: var(--bg-light);
}

.song-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}



.song-card .play-btn {
    position: absolute;
    right: 24px;
    bottom: 80px;
    width: 48px;
    height: 48px;


    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    color: black;
}



.song-card:hover .play-btn {
    opacity: 1;
    transform: translateY(0);
}

.song-card h4 {
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



.song-card p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Song List Item (Row layout) */
.song-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.song-list-item:hover {
    background-color: var(--bg-light);
}

.song-list-item.active {
    background-color: rgba(30, 215, 96, 0.1);
}

.song-list-item img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    aspect-ratio: unset !important;
    margin-bottom: 0 !important;
    box-shadow: none !important;
}

.song-list-item .song-info {
    flex-grow: 1;
    overflow: hidden;
}

.song-list-item .song-info h5 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-list-item .song-info p {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin: 0;
}



/* Player Bar */
.player-bar {
    grid-column: 1 / span 2;
    background-color: var(--bg-black);
    border-top: 1px solid #282828;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 30%;
}

.now-playing img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
}

.track-info h5 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.track-info p {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 40%;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.control-btn:hover {
    color: var(--text-white);
}

.control-btn.play-pause {
    background-color: var(--text-white);
    color: var(--bg-black);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-gray);
}

.progress-bar {
    flex-grow: 1;
    height: 4px;
    background-color: #4d4d4d;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-filled {
    height: 100%;
    background-color: var(--text-white);
    border-radius: 2px;
    width: 0%;
}

.progress-bar:hover .progress-filled {
    background-color: var(--accent-color);
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 30%;
    justify-content: flex-end;
}

.volume-bar-container {
    width: 100px;
    display: flex;
    align-items: center;
}

.volume-bar {
    width: 100%;
    height: 4px;
    background-color: #4d4d4d;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-filled {
    height: 100%;
    background-color: var(--text-white);
    border-radius: 2px;
    width: 100%;
    position: relative;
}

.volume-bar:hover .volume-filled {
    background-color: var(--accent-color);
}

.volume-bar:hover .volume-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: -4px;
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}


/* Forms (Login/Register) */
.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, #222, #000);
}

.auth-form {
    background-color: var(--bg-black);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #727272;
    background-color: var(--bg-light);
    color: white;
    outline: none;
}

.form-group input:focus {
    border-color: white;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    border-radius: 30px;
    border: none;
    background-color: var(--accent-color);
    color: black;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: scale(1.04);
    background-color: #1ed760;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.auth-footer a {
    color: white;
    text-decoration: underline;
}

/* Utils */
/* Improved Language Switcher Dropdown */
.lang-switcher {
    position: relative;
    display: inline-block;
}

.lang-dropdown-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid #727272;
    border-radius: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.lang-dropdown-btn:hover {
    border-color: white;
    background: rgba(40, 40, 40, 0.8);
}

.lang-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #282828;
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border-radius: 4px;
    margin-top: 4px;
    overflow: hidden;
}

.lang-dropdown-content a {
    color: #b3b3b3;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lang-dropdown-content a:hover {
    background-color: #3e3e3e;
    color: white;
}

.lang-switcher.active .lang-dropdown-content {
    display: block;
}



.add-to-playlist-btn:hover {
    color: var(--accent-color) !important;
    transform: scale(1.1);
}

#like-btn {
    transition: color 0.2s, transform 0.2s;
}

#like-section:hover #like-btn {
    color: #ff4466 !important;
}

.modal .auth-form {
    border: 1px solid #333;
}

#modal-playlist-list li:hover {
    background-color: var(--bg-light) !important;
    color: var(--accent-color);
}

::-webkit-scrollbar {

    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: #5a5a5a;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}