:root {
    --bg-color: #121212;
    --sidebar-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --accent-color: #bb86fc;
    --hover-color: #333;
    --danger-color: #cf6679;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.app-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    overflow-y: auto;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.header-col {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
}

.search-box {
    display: flex;
    gap: 5px;
}

.search-box input {
    flex: 1;
    background: #333;
    border: 1px solid #444;
    color: white;
    padding: 5px;
    border-radius: 4px;
}

.header-col h2 {
    margin: 0;
    font-size: 1.2rem;
}

.list-group {
    flex: 1;
}

.list-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:hover {
    background-color: var(--hover-color);
}

.list-item.active {
    background-color: var(--accent-color);
    color: #000;
    font-weight: bold;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.card {
    background-color: var(--sidebar-bg);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

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

.no-cover {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    color: #666;
}

.card-body {
    padding: 15px;
}

.card-body h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-body p {
    margin: 0;
    font-size: 0.8rem;
    color: #aaa;
}

.hidden {
    display: none !important;
}

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

.modal-content {
    background: var(--sidebar-bg);
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.track-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.track-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    gap: 15px;
}

.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.track-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    font-size: 0.8rem;
    color: #aaa;
}

.track-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

audio {
    height: 30px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background-color: #444;
    color: white;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    display: none;
    /* managed by outside click or explicit button if wanted */
}

/* Utilities */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
}