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

body {
    background-color: black;
    font-family: "Montserrat", sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* NavBar */
nav {
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
    width: 100%;
    padding: 0.75rem 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.left-half {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 38rem;
    flex-wrap: wrap;
    color: white;
    min-width: 0;
}

.logo {
    font-size: 2.5rem;
    margin: 0;
}

.home-icon {
    font-size: 1.7rem;
    background-color: #1f1f1f;
    color: rgb(179, 179, 179);
    padding: 8px;
    border-radius: 50%;
    margin: 0 1rem;
    transition: 0.2s;
}

.home-icon:hover {
    color: white;
    transform: scale(1.05);
}

.search-bar {
    display: flex;
    background-color: #1f1f1f;
    align-items: center;
    height: 3rem;
    width: min(100%, 30rem);
    flex: 1 1 18rem;
    min-width: 0;
    border-radius: 20rem;
}

.search-bar:hover {
    background-color: #272727;
    border: 1px solid rgb(76, 76, 76);
}

.search-icon {
    font-size: 1.5rem;
    color: rgb(179, 179, 179);
    padding: 0 0.7rem;

}

.search-bar:hover .search-icon {
    color: white;
}

.input-box {
    width: 100%;
    height: 60%;
    min-width: 0;
    background-color: #27272700;
    border: none;
    border-right: 1px solid rgb(179, 179, 179);
    color: white;
    font-size: 1.2rem;
}

.input-box:focus {
    outline: none;
    border-right: 1px solid rgb(179, 179, 179);
}

.browse {
    font-size: 1.3rem;
    margin-left: 0.6rem;
    transition: 0.2s;
}

.browse:hover {
    transform: scale(1.05);
}

.right-half {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    color: white;
    margin-left: auto;
    gap: 1rem;
    flex: 0 1 auto;
}

.right-half-p1 {
    display: flex;
    align-items: center;
    height: 1.7rem;
    margin: 0 1rem;
    padding: 0 1rem 0 0;
    border-right: 1px solid rgb(179, 179, 179);
}

.nav-text {
    padding: 0 0.5rem;
    font-weight: 600;
    color: rgb(179, 179, 179);
    transition: 0.1s;
}

.nav-text:hover {
    color: white;
    transform: scale(1.05);
    cursor: pointer;
}

.right-half-p2 {
    display: flex;
    align-items: center;
}

.login-btn {
    height: 3rem;
    width: 7rem;
    border-radius: 15rem;
    border: none;
    background-color: white;
    font-size: 1rem;
    font-weight: 700;
    margin: 1rem;
    transition: 0.2s;
}

.login-btn:hover {
    transform: scale(1.05);
}

/* main-left-part */
.main {
    background-color: black;
    width: 100%;
    min-height: calc(100vh - 10rem);
    margin-top: 2vh;
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    color: white;
    padding: 0 1rem 1rem;
}

.main-left-part {
    width: min(100%, 360px);
    min-width: 280px;
    max-height: 100%;
    background-color: #121212;
    border-radius: 10px;
    padding-bottom: 1.5rem;
}

.library {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 1.5rem;
}

.library p {
    font-weight: 600;
}

.library div {
    font-size: 2rem;
    color: rgb(179, 179, 179);
    background-color: #2f2f2f;
    padding: 8px;
    height: 1.5rem;
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 30rem;
    transition: 0.2s;
}

.library div:hover {
    color: white;
    background-color: #3a3a3a;
}

.box-container {
    margin-top: 1rem;
    height: auto;
}

.box {
    background-color: #1f1f1f;
    min-height: 9rem;
    width: 100%;
    border-radius: 10px;
    margin: 1rem 0;
    padding-bottom: 1rem;
}

.box h4 {
    font-weight: 600;
    font: 0.9rem;
    padding: 1.3rem 0 0.5rem 1rem;
}

.box p {
    font-size: 0.8rem;
    padding-left: 1rem;
}

.box button {
    background-color: white;
    color: black;
    font-weight: 600;
    padding: 0.6rem 0.8rem;
    margin: 1rem 0 0 1rem;
    border-radius: 25rem;
}

.box button:hover {
    transform: scale(1.04);
    background-color: rgb(238, 238, 238);
}


/* Main: right part */
.main-right-part {
    flex: 1 1 0;
    min-width: 0;
    min-height: 100%;
    background-color: #121212;
    border-radius: 10px;
    overflow: auto;
}

.music-card img {
    height: 10rem;
    width: 10rem;
    object-fit: cover;
    object-position: center;
    border-radius: 5px;
}

.music-card {
    width: 10rem;
    min-width: 10rem;
    padding: 0.7rem;
    border-radius: 5px;
    position: relative;
    flex: 0 0 auto;
}

.music-card:hover {
    background-color: #222;
}

.music-section {
    margin: 2rem;
}

.songs {
    margin: 2rem 0;
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.empty-state {
    color: rgb(179, 179, 179);
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.img-title {
    margin: 0.7rem 0;
}

.img-description {
    font-size: 0.8rem;
    color: rgb(199, 199, 199);
}

.music-play-btn {
    color: rgb(32, 234, 32);
    font-size: 2.7rem;
    position: absolute;
    background-color: rgb(0, 0, 0);
    width: 2.7rem;
    display: flex;
    border-radius: 20rem;
    transform: translate(110px, -40px);
    opacity: 0;
    transition: 0.3s;
}

.music-card:hover .music-play-btn {
    opacity: 1;
    transform: translate(110px, -50px);
}


/* Player */
.player-bar{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: 5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem 1rem;
    flex-wrap: wrap;
    background-color: rgba(0, 0, 0, 0.96);
    border-top: 1px solid #1f1f1f;
    z-index: 200;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.player-bar.player-bar-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(100%);
}
.music-controller{
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 24rem;
    min-width: 0;
}
.player{
    display: flex;
    align-items: center;
}
.player-btns{
    font-size: 1.1rem;
    margin: 0.4rem 1rem;
    color: rgb(190, 190, 190);
    cursor: pointer;
}
.player-btns:hover{
    transform: scale(1.02);
    color: rgb(232, 232, 232);
}
#play{
    font-size: 2.3rem;
    color: white;
}

#progressBar{
    appearance: none;
    width: min(100%, 600px);
    height: 3px;
    background-color: #333;
    border-radius: 5px;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb{
    appearance: none;
    width: 10px;
    height: 10px;
    background-color: white;
    border-radius: 10px;
}

.now-bar{
    color: white;
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 16rem;
}
.player-bar img{
    height: 4rem;
    width: 4rem;
    border-radius: 10px;
    padding: 0.3rem;
    flex-shrink: 0;
}
.img-title-info{
    font-size: 0.9rem;
    margin-left: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.img-des-info{
    font: 0.8rem;
    color: rgb(192, 192, 192);
    margin-left: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active{
    color: rgb(0, 255, 0);
}
.active:hover{
    color: rgb(0, 255, 0);
}

/* ===== PAGE VISIBILITY ===== */
.page {
    width: 100%;
}

.page.hidden {
    display: none;
}

.page-content {
    width: 100%;
}

#app-page.player-visible {
    padding-bottom: 7rem;
}

.page-content.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* ===== AUTHENTICATION PAGES ===== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.auth-box {
    background: #1f1f1f;
    padding: 3rem 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.auth-box h1 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-box p {
    color: rgb(179, 179, 179);
    text-align: center;
    margin-bottom: 2rem;
}

.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-box input {
    padding: 0.8rem;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #2f2f2f;
    color: white;
    font-size: 0.95rem;
    transition: 0.2s;
}

.auth-box input:focus {
    outline: none;
    border-color: #21a600;
    background-color: #383838;
}

.auth-box button {
    padding: 0.9rem;
    background-color: #21a600;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.auth-box button:hover {
    background-color: #1a8a00;
    transform: scale(1.02);
}

.auth-toggle {
    text-align: center;
    color: rgb(179, 179, 179);
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-toggle a {
    color: #21a600;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

/* ===== PROFILE PAGE ===== */
.profile-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    background-color: #1f1f1f;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
    color: white;
    min-width: 200px;
}

.profile-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-info p {
    color: rgb(179, 179, 179);
    margin-bottom: 0.3rem;
}

.edit-profile-btn {
    padding: 0.8rem 1.5rem;
    background-color: #21a600;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.edit-profile-btn:hover {
    background-color: #1a8a00;
    transform: scale(1.05);
}

.profile-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat {
    background-color: #1f1f1f;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.stat h3 {
    font-size: 1.8rem;
    color: #21a600;
    margin-bottom: 0.5rem;
}

.stat p {
    color: rgb(179, 179, 179);
    font-size: 0.9rem;
}

.profile-section {
    background-color: #1f1f1f;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.profile-section h2 {
    color: white;
    margin-bottom: 1.5rem;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.playlist-card {
    background-color: #2f2f2f;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.playlist-card:hover {
    background-color: #383838;
    transform: scale(1.05);
}

.playlist-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.playlist-card h3 {
    color: white;
    padding: 0.8rem;
    font-size: 0.9rem;
}

.genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.genre-tag {
    background-color: #21a600;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* ===== PLAYLISTS ===== */
.playlists-list {
    margin-top: 1rem;
}

.playlist-item {
    background-color: #1f1f1f;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    color: rgb(179, 179, 179);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.playlist-item:hover {
    background-color: #2f2f2f;
    color: white;
    transform: translateX(5px);
}

.add-playlist-btn {
    font-size: 1.5rem;
    cursor: pointer;
}

.playlist-controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.playlist-controls button {
    padding: 0.6rem 1.2rem;
    background-color: #21a600;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.playlist-controls button:hover {
    background-color: #1a8a00;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #1f1f1f;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    color: white;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: rgb(179, 179, 179);
    cursor: pointer;
    transition: 0.2s;
}

.close-btn:hover {
    color: white;
}

.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content input,
.modal-content textarea {
    padding: 0.8rem;
    border: 1px solid #333;
    border-radius: 8px;
    background-color: #2f2f2f;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #21a600;
}

.modal-content textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-content label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgb(179, 179, 179);
    cursor: pointer;
}

.modal-content input[type="checkbox"] {
    width: auto;
}

.modal-content button {
    padding: 0.9rem;
    background-color: #21a600;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
}

.modal-content button:hover {
    background-color: #1a8a00;
    transform: scale(1.02);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
    position: relative;
    display: inline-flex;
    width: 50px;
    height: 24px;
    background-color: #333;
    border-radius: 12px;
    cursor: pointer;
    margin: 0;
    transition: 0.3s;
}

.theme-toggle input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

.theme-toggle input:checked + .toggle-slider {
    left: 26px;
}

.theme-toggle:hover {
    background-color: #404040;
}

/* ===== PROFILE/NAV BUTTONS ===== */
.profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    width: 40px;
    height: 40px;
    transition: 0.2s;
    flex-shrink: 0;
}

.profile-btn:hover {
    transform: scale(1.1);
}

.profile-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logout-btn {
    padding: 0.6rem 1.2rem;
    background-color: #21a600;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    flex-shrink: 0;
}

.logout-btn:hover {
    background-color: #1a8a00;
    transform: scale(1.05);
}

.player-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 10rem;
}

/* ===== CONTENT SECTION ===== */
.content-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.content-section h1 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.playlist-description {
    color: rgb(179, 179, 179);
    margin-bottom: 1rem;
}

/* ===== LIGHT THEME ===== */
body.light-theme {
    background-color: #f5f5f5;
    color: #333;
}

body.light-theme nav {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

body.light-theme .left-half,
body.light-theme .right-half {
    color: #333;
}

body.light-theme .search-bar {
    background-color: #e8e8e8;
}

body.light-theme .search-bar:hover {
    background-color: #ddd;
    border-color: #bbb;
}

body.light-theme .input-box {
    background-color: transparent;
    color: #333;
    border-right-color: #999;
}

body.light-theme .logo,
body.light-theme .home-icon,
body.light-theme .nav-text {
    color: #333;
}

body.light-theme .home-icon {
    background-color: #e8e8e8;
    color: #666;
}

body.light-theme .home-icon:hover {
    color: #333;
}

body.light-theme .main {
    background-color: #f5f5f5;
}

body.light-theme .main-left-part,
body.light-theme .main-right-part {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.light-theme .music-section h2,
body.light-theme .library p {
    color: #333;
}

body.light-theme .img-title,
body.light-theme .content-section h1,
body.light-theme .playlist-item,
body.light-theme .img-title-info {
    color: #222;
}

body.light-theme .img-description,
body.light-theme .playlist-description,
body.light-theme .img-des-info,
body.light-theme .profile-info p {
    color: #666;
}

body.light-theme .box {
    background-color: #f9f9f9;
}

body.light-theme .box h4,
body.light-theme .box p {
    color: #333;
}

body.light-theme .box p {
    color: #666;
}

body.light-theme .music-card:hover {
    background-color: #f0f0f0;
}

body.light-theme .player-bar {
    background-color: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e0e0e0;
}

body.light-theme .now-bar,
body.light-theme .player-btns {
    color: #555;
}

body.light-theme .player-btns:hover {
    color: #111;
}

body.light-theme #play {
    color: #111;
}

body.light-theme #progressBar {
    background-color: #cfcfcf;
}

body.light-theme .auth-box {
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.light-theme .auth-box h1,
body.light-theme .profile-info h1 {
    color: #333;
}

body.light-theme .auth-box input {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ddd;
}

body.light-theme .modal-content {
    background-color: #fff;
}

body.light-theme .modal-content h2 {
    color: #333;
}

body.light-theme .modal-content input,
body.light-theme .modal-content textarea {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ddd;
}

body.light-theme .playlist-option {
    background-color: #f0f0f0;
}

body.light-theme .playlist-option:hover {
    background-color: #e0e0e0;
}

body.light-theme .playlist-option-info h4 {
    color: #333;
}

body.light-theme .playlist-option-info p {
    color: #666;
}

body.light-theme .avatar-upload-section {
    background-color: #f0f0f0;
}

body.light-theme .avatar-preview {
    border-color: #1db954;
}

body.light-theme .upload-btn {
    background-color: #1db954;
    color: white;
}

body.light-theme .upload-btn:hover {
    background-color: #1ed760;
}

body.light-theme .upload-hint {
    color: #666;
}

/* ===== RESPONSIVE ADJUSTMENTS FOR NEW FEATURES ===== */
@media (max-width: 768px) {
    .auth-box {
        padding: 2rem 1.5rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-stats {
        justify-content: space-around;
    }

    .modal-content {
        width: 95%;
    }

    .theme-toggle {
        margin: 0 0.5rem;
    }

    .logout-btn, .edit-profile-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .avatar-upload-section {
        flex-direction: column;
        gap: 1rem;
    }

    .avatar-preview {
        width: 100px;
        height: 100px;
    }
}

/* ===== PROFILE PLAYLIST CARDS ===== */
.playlist-cover {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #1db954, #191414);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.playlist-info {
    padding: 1rem;
}

.playlist-name {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-desc {
    color: #b3b3b3;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-count {
    color: #666;
    font-size: 0.75rem;
}

/* ===== ADD TO PLAYLIST BUTTON ===== */
.music-card {
    position: relative;
}

.add-to-playlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s, background-color 0.3s;
}

.music-card:hover .add-to-playlist-btn {
    opacity: 1;
}

.add-to-playlist-btn:hover {
    background-color: #1db954;
    transform: scale(1.1);
}

/* ===== PLAYLISTS SELECT MODAL ===== */
.playlists-select {
    max-height: 400px;
    overflow-y: auto;
}

.playlists-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.playlist-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #2f2f2f;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.playlist-option:hover {
    background-color: #383838;
    transform: translateX(5px);
}

.playlist-option i {
    font-size: 1.5rem;
    color: #1db954;
    min-width: 30px;
}

.playlist-option-info {
    flex: 1;
    min-width: 0;
}

.playlist-option-info h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-option-info p {
    color: #b3b3b3;
    font-size: 0.8rem;
}

.create-new-playlist-btn {
    width: 100%;
    padding: 0.8rem;
    background-color: #1db954;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.create-new-playlist-btn:hover {
    background-color: #1ed760;
}

/* ===== AVATAR UPLOAD SECTION ===== */
.avatar-upload-section {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #2f2f2f;
    border-radius: 10px;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #1db954;
    flex-shrink: 0;
}

.upload-controls {
    flex: 1;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #1db954;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s, transform 0.2s;
}

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

.upload-hint {
    color: #b3b3b3;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

@media (min-width: 1400px) {
    .main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .main-left-part {
        width: 380px;
    }

    .music-card {
        width: 11rem;
        min-width: 11rem;
    }

    .music-card img {
        width: 11rem;
        height: 11rem;
    }

    .music-play-btn {
        transform: translate(122px, -42px);
    }

    .music-card:hover .music-play-btn {
        transform: translate(122px, -52px);
    }
}

@media (max-width: 1024px) {
    .main {
        flex-direction: column;
        min-height: auto;
    }

    .main-left-part,
    .main-right-part {
        width: 100%;
        min-width: 0;
    }

    .main-right-part {
        overflow: visible;
    }

    .box-container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .box {
        margin: 0;
    }

    .playlist-controls {
        flex-wrap: wrap;
    }

    .now-bar {
        display: none;
    }

    .music-controller {
        flex: 1 1 100%;
    }

    .player-controls {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    nav {
        align-items: stretch;
    }

    .left-half,
    .right-half {
        width: 100%;
    }

    .right-half {
        justify-content: space-between;
    }

    .main {
        padding: 0 0.75rem 0.75rem;
    }

    .music-section,
    .content-section,
    .profile-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .music-section {
        margin: 1.25rem 1rem;
    }

    .songs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow-x: visible;
        gap: 1rem;
    }

    .music-card,
    .music-card img {
        width: 100%;
        min-width: 0;
    }

    .music-card img {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .music-play-btn {
        right: 1rem;
        bottom: 4.25rem;
        transform: none;
    }

    .music-card:hover .music-play-btn {
        transform: none;
    }

    .player-bar {
        justify-content: center;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }

    .now-bar,
    .music-controller,
    .player-controls {
        width: 100%;
        flex: 1 1 100%;
    }

    .player-controls {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    nav {
        padding: 0.75rem;
    }

    .logo {
        font-size: 2rem;
    }

    .home-icon {
        margin: 0;
    }

    .search-bar {
        height: 2.75rem;
    }

    .input-box {
        font-size: 1rem;
    }

    .logout-btn {
        width: 100%;
    }

    .box-container,
    .songs,
    .playlists-grid {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        display: grid;
        grid-template-columns: 1fr;
    }

    .profile-header,
    .profile-section,
    .content-section {
        padding: 1.25rem;
    }

    .profile-avatar {
        width: 110px;
        height: 110px;
    }

    .profile-info h1,
    .content-section h1 {
        font-size: 1.6rem;
    }

    .player {
        justify-content: center;
        flex-wrap: wrap;
    }

    .player-btns {
        margin: 0.4rem 0.75rem;
    }

    .player-bar img {
        width: 3.5rem;
        height: 3.5rem;
    }

    .modal-content {
        padding: 1.25rem;
    }

    #app-page.player-visible {
        padding-bottom: 8.5rem;
    }
}
