:root {
    --primary-color: #1DB954;
    --dark-bg: #121212;
    --card-bg: #181818;
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --hover-color: #282828;
    --player-height: 90px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(to right, #1e3c72, #2a5298);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, #1DB954, #1ed760);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 15px;
    flex: 1;
    max-width: 300px;
    min-width: 150px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 5px 10px;
    width: 100%;
    font-size: 14px;
    outline: none;
}

.search-bar i {
    color: var(--text-secondary);
}

.user-actions {
    display: flex;
    gap: 10px;
}

.user-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.user-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: calc(100vh - var(--player-height) - 70px);
}

.sidebar {
    width: 240px;
    background-color: #000000;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s;
}

.sidebar-section {
    margin-bottom: 25px;
}

.sidebar-section h3 {
    padding: 0 20px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.sidebar-item:hover, .sidebar-item.active {
    color: var(--text-primary);
    background-color: var(--hover-color);
}

.sidebar-item i {
    font-size: 18px;
    min-width: 20px;
    text-align: center;
}

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #3a3a3a, var(--dark-bg) 400px);
}

.welcome-section {
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 16px;
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.playlist-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.playlist-card:hover {
    background-color: var(--hover-color);
    transform: translateY(-5px);
}

.playlist-card:hover .play-btn {
    opacity: 1;
    transform: translateY(0);
}

.playlist-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 4px;
    margin-bottom: 15px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.playlist-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card p {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-btn {
    position: absolute;
    bottom: 80px;
    right: 15px;
    background-color: var(--primary-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: none;
    cursor: pointer;
}

.play-btn i {
    color: #000;
    font-size: 18px;
}

.player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background-color: #181818;
    border-top: 1px solid #282828;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 100;
    gap: 10px;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 30%;
    min-width: 180px;
}

.now-playing img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    flex-shrink: 0;
}

.track-info {
    min-width: 0;
}

.track-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info p {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 500px;
    min-width: 300px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s;
}

.control-btn:hover {
    color: var(--text-primary);
}

.play-pause {
    background-color: var(--text-primary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.play-pause:hover {
    transform: scale(1.05);
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.time {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background-color: #5e5e5e;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress {
    height: 100%;
    background-color: var(--text-secondary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s;
}

.progress-bar:hover .progress {
    background-color: var(--primary-color);
}

.volume-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 30%;
    min-width: 150px;
    justify-content: flex-end;
}

.volume-bar {
    width: 100px;
    height: 4px;
    background-color: #5e5e5e;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-level {
    height: 100%;
    background-color: var(--text-secondary);
    border-radius: 2px;
    width: 70%;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 24px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.song-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.song-item:hover {
    background-color: var(--hover-color);
}

.song-item img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    flex-shrink: 0;
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-info h4 {
    font-size: 16px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info p {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-duration {
    color: var(--text-secondary);
    font-size: 14px;
    flex-shrink: 0;
}

.song-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.song-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
}

.song-action-btn:hover {
    color: var(--text-primary);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar-item span {
        display: none;
    }
    
    .sidebar-section h3 {
        display: none;
    }
    
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 12px 15px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .search-bar {
        order: 3;
        max-width: 100%;
        margin-top: 10px;
        display: none;
    }
    
    .search-bar.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -240px;
        height: 100%;
        z-index: 99;
        transition: left 0.3s;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .content {
        padding: 15px;
    }
    
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    
    .player {
        padding: 0 10px;
    }
    
    .now-playing {
        width: 40%;
        min-width: 150px;
    }
    
    .player-controls {
        min-width: 250px;
    }
    
    .volume-controls {
        display: none;
    }
    
    .track-info h4, .track-info p {
        display: block;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }
    
    .user-actions button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .welcome-section h2 {
        font-size: 24px;
    }
    
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .playlist-card {
        padding: 12px;
    }
    
    .player {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }
    
    .now-playing {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .player-controls {
        width: 100%;
        min-width: auto;
        order: 3;
    }
    
    .control-buttons {
        gap: 10px;
    }
    
    .progress-container {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .playlist-card h3 {
        font-size: 14px;
    }
    
    .playlist-card p {
        font-size: 12px;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
}

.sidebar-overlay.active {
    display: block;
}
