:root {
    --bg-black: #000000;
    --sidebar-bg: #000000;
    --player-bg: #181818;
    --text-white: #ffffff;
    --text-gray: #b3b3b3;
    --accent-color: #ffffff; /* Black and white theme */
    --hover-bg: #282828;
    --card-bg: #181818;
    --glass-bg: rgba(18, 18, 18, 0.7);
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden; /* Main content handles scrolling */
}

.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid #282828;
}

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

.sidebar-logo {
    width: 32px;
    height: 32px;
    margin-right: 12px;
}

.sidebar-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.nav-item:hover {
    color: var(--text-white);
}

.nav-item.active {
    color: var(--text-white);
    background-color: var(--hover-bg);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-right: 16px;
}

/* Main Content Styling */
.main-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: linear-gradient(to bottom, #222222, #121212);
    padding-bottom: 120px;
}

.main-header {
    padding: 20px 32px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
}

.search-container {
    flex: 1;
    max-width: 400px;
}

#music-search {
    width: 100%;
    padding: 12px 20px;
    border-radius: 500px;
    border: none;
    background-color: #242424;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: background-color 0.2s;
}

#music-search:focus {
    background-color: #333333;
    box-shadow: 0 0 0 1px #555;
}

.mobile-header {
    display: none; /* Desktop default */
}

.content-body {
    padding: 0 32px;
}

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

/* Song Item Styling (Grid View for Desktop) */
.playlist-item {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

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

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

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

.playlist-info {
    width: 100%;
    overflow: hidden;
}

.playlist-track-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-artist-name {
    font-size: 0.85rem;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bottom Player Styling */
.bottom-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--player-bg);
    border-top: 1px solid #282828;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    padding: 0;
    height: 90px;
}

.player-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 100%;
}

.player-left {
    display: flex;
    align-items: center;
    width: 30%;
    min-width: 180px;
}

.player-album-art {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    margin-right: 14px;
    object-fit: cover;
}

.track-details {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.artist-name {
    font-size: 0.75rem;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 40%;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 8px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.1s;
    padding: 0;
}

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

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

.play-pause-btn:hover {
    transform: scale(1.05);
    background-color: #f0f0f0;
}

.play-icon, .pause-icon {
    width: 20px;
    height: 20px;
}

.secondary-control-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-gray);
    transition: color 0.2s;
    padding: 0;
}

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

.secondary-control-btn.active {
    color: var(--accent-color);
}

.icon { width: 24px; height: 24px; }
.small-icon { width: 16px; height: 16px; }

.playback-bar-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.time-display {
    font-size: 0.75rem;
    color: var(--text-gray);
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.progress-container {
    flex: 1;
    height: 4px;
    background-color: #4d4d4d;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

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

.progress-handle {
    width: 12px;
    height: 12px;
    background-color: var(--text-white);
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

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

.progress-container:hover .progress-handle {
    display: block;
}

.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    min-width: 180px;
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 125px;
    color: var(--text-gray);
}

.volume-slider-container {
    flex: 1;
    height: 4px;
    background-color: #4d4d4d;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

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

.volume-handle {
    width: 12px;
    height: 12px;
    background-color: var(--text-white);
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

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

.volume-slider-container:hover .volume-handle {
    display: block;
}

/* Responsive Mobile View */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main-header {
        padding: 16px;
        background-color: var(--bg-black);
    }

    .search-container {
        display: none; /* Trigger via button on mobile */
    }

    .mobile-header {
        display: flex;
        align-items: center;
        width: 100%;
    }

    .mobile-logo {
        width: 32px;
        height: 32px;
        margin-right: 12px;
    }

    .mobile-header h1 {
        font-size: 1.25rem;
        margin: 0;
    }

    .content-body {
        padding: 0 16px;
    }

    .playlist-container {
        grid-template-columns: 1fr; /* List view on mobile */
        gap: 8px;
    }

    .playlist-item {
        flex-direction: row;
        align-items: center;
        padding: 8px;
        background-color: transparent;
    }

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

    .playlist-art {
        width: 48px;
        height: 48px;
        margin-bottom: 0;
        margin-right: 16px;
    }

    .bottom-player {
        height: 100px;
    }

    .player-content {
        flex-wrap: wrap;
        padding: 8px;
    }

    .player-left {
        width: 100%;
        margin-bottom: 8px;
    }

    .player-center {
        max-width: 100%;
        width: 100%;
    }

    .player-right {
        display: none;
    }

    .secondary-control-btn {
        display: none;
    }
    
    .player-controls {
        gap: 16px;
    }
}
