/* General & Body Styling */
body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0d0d0d;
    color: #fff;
    overflow-x: hidden;
}

.yt-music-container {
    display: flex;
}

/* Overlay for mobile sidebar */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
}

.overlay.active {
    display: block;
}

/* Mobile Header (Visible only on mobile) */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    height: 60px;
    background-color: #050505;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
}

.menu-btn-mobile {
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo .fab {
    color: #ff0000;
    font-size: 32px;
}

.logo span {
    font-size: 24px;
    font-weight: bold;
    margin-left: 5px;
}

.header-right .profile-pic img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.header-right .fa-search {
    font-size: 20px;
    margin-right: 20px;
}


/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #050505;
    padding: 20px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: width 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.menu-btn-desktop {
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .playlist-header,
.sidebar.collapsed .playlist-item span {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-link {
    display: flex;
    align-items: center;
    color: #aaaaaa;
    text-decoration: none;
    font-size: 16px;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #333333;
    color: #fff;
}

.nav-link.active {
    background-color: #333333;
    color: #fff;
}

.nav-link i {
    font-size: 20px;
    width: 30px;
}

.separator {
    height: 1px;
    background-color: #333333;
    margin: 20px 0;
}

.sidebar-playlists {
    margin-top: 20px;
}

.playlist-header h4 {
    margin: 0 0 10px 15px;
    font-size: 14px;
    color: #aaaaaa;
    text-transform: uppercase;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.playlist-item:hover {
    background-color: #333333;
}

.playlist-item img {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    margin-right: 15px;
}

/* Main Content */
.main-content {
    margin-left: 290px;
    padding: 20px;
    transition: margin-left 0.3s ease-in-out;
}

.sidebar.collapsed + .main-content {
    margin-left: 110px;
}

.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
}

.profile-pic img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.card-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.card-row::-webkit-scrollbar {
    display: none;
}

.music-card {
    min-width: 180px;
    cursor: pointer;
}

.music-card img {
    width: 100%;
    border-radius: 8px;
}

.music-card h4 {
    margin: 10px 0 5px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-card p {
    margin: 0;
    font-size: 14px;
    color: #aaaaaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background-color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 101;
}

.song-info {
    display: flex;
    align-items: center;
    width: 250px;
}

.song-info img {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-right: 15px;
}

.song-details {
    overflow: hidden;
}

.song-title {
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 14px;
    color: #aaaaaa;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equalizer {
    display: flex;
    align-items: flex-end;
    height: 20px;
    margin-left: 20px;
    visibility: hidden; /* Use visibility to keep layout */
}

.equalizer.playing {
    visibility: visible;
}

.bar {
    width: 4px;
    background-color: #fff;
    margin: 0 1px;
    animation: equalizer-play 0.8s ease-in-out infinite alternate;
}

.bar:nth-child(1) { height: 50%; }
.bar:nth-child(2) { height: 80%; animation-delay: -0.8s; }
.bar:nth-child(3) { height: 60%; animation-delay: -0.4s; }

@keyframes equalizer-play {
    0% { height: 50%; }
    100% { height: 100%; }
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.player-controls i {
    font-size: 24px;
    cursor: pointer;
    color: #fff;
}

.play-pause-btn {
    font-size: 36px;
}

.player-options {
    display: flex;
    align-items: center;
    width: 250px;
    justify-content: flex-end;
}

.player-options i {
    font-size: 20px;
    margin-right: 10px;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    background: #555;
    border-radius: 5px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .yt-music-container {
        flex-direction: column;
    }
    
    .mobile-header {
        display: flex;
    }

    .sidebar {
        width: 280px;
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 102;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-header {
        margin-bottom: 0;
        position: sticky;
        top: 0;
        background-color: #050505;
        padding: 10px 20px;
    }

    .menu-btn-desktop {
        display: none;
    }

    .sidebar-nav, .sidebar-playlists {
        display: block;
        padding: 0 10px;
    }

    .main-content {
        margin-left: 0;
        padding-top: 60px; /* Space for mobile header */
        padding-bottom: 120px; /* Space for player bar */
    }
    .header {
        display: none; /* Hide desktop header */
    }
    .player-bar {
        height: 80px;
        flex-direction: column;
        justify-content: center;
        padding: 0 10px;
    }
    .song-info {
        display: none; /* Hide for mobile */
    }
    .player-controls {
        gap: 30px;
    }
    .player-controls i {
        font-size: 28px;
    }
}

@media (min-width: 769px) {
    .menu-btn-mobile {
        display: none;
    }
}