:root {
    --background: #121212;
    --surface: #181818;
    --surface-strong: #1f1f1f;
    --primary: #1db954;
    --primary-strong: #1ed760;
    --text: #ffffff;
    --muted: #b3b3b3;
}

* {
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
}

.app {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 110px);
}

.sidebar {
    background: var(--surface);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    font-size: 1.5rem;
}

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

.logo p {
    margin: 0;
    color: var(--muted);
}

.search input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.genre-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
}

.genre-item {
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--muted);
    border: none;
    text-align: left;
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

.genre-item:hover,
.genre-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.content {
    padding: 2rem 3rem 6rem;
    background: linear-gradient(180deg, rgba(29, 185, 84, 0.2), transparent 40%), var(--background);
}

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

.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 12px;
    color: var(--text);
    font-size: 1.4rem;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    margin-right: 1rem;
}

.content-header h2 {
    margin: 0;
    font-size: 2rem;
}

.actions button {
    margin-left: 0.75rem;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.actions button.active {
    background: var(--primary);
    border-color: var(--primary);
}

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

.track-card {
    background: var(--surface-strong);
    padding: 1.5rem;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.track-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.08);
}

.track-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.track-card h3 {
    margin: 0;
    font-size: 1rem;
}

.track-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.player {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background: var(--surface);
    display: grid;
    grid-template-columns: 1fr 1.5fr 0.8fr;
    align-items: center;
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.track-info img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.controls .buttons button {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    margin: 0 0.5rem;
    cursor: pointer;
}

.controls .progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.controls input[type="range"],
.volume input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.volume {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.alert.error {
    background: rgba(255, 77, 79, 0.2);
}

.muted {
    color: var(--muted);
}

@media (max-width: 960px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 110px;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 10;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        padding: 1.5rem 1.5rem 7rem;
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .player {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }

    .track-info {
        justify-content: center;
    }

    .volume {
        justify-content: center;
        width: 100%;
    }
}
