:root {
    /* Color Palette - Cyberpunk Purple */
    --bg-dark: #09090b;       /* Nearly black */
    --bg-panel: #18181b;      /* Dark grey for cards/bars */
    --bg-hover: #27272a;      /* Lighter grey for hovers */
    --accent: #8b5cf6;        /* Violet */
    --accent-glow: #7c3aed;   /* Brighter Violet */
    --text-main: #ffffff;
    --text-sub: #a1a1aa;
    
    /* Dimensions */
    --sidebar-width: 240px;
    --player-height: 90px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- LAYOUT --- */
.app-container {
    display: flex;
    flex: 1;
    overflow: hidden; /* Prevent body scroll, only main-view scrolls */
    height: calc(100vh - var(--player-height));
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    background-color: black;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #222;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 40px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo .icon { color: var(--accent); }

.nav-item {
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 0;
    transition: all 0.2s;
    display: block;
}

.nav-item:hover { color: white; transform: translateX(5px); }
.nav-item.active { color: white; color: var(--accent); }

.server-status {
    margin-top: auto;
    font-size: 11px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px; height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 5px #22c55e;
}

/* MAIN VIEW */
.main-view {
    flex: 1;
    background: linear-gradient(180deg, #1e1b4b 0%, var(--bg-dark) 45%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
}

.user-greeting { font-size: 24px; font-weight: 700; }
.user-profile { 
    width: 32px; height: 32px; background: #333; 
    border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; cursor: pointer;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 30px 40px 30px;
}

.section-title { font-size: 18px; margin-bottom: 20px; font-weight: 700; }

/* SONG GRID */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
}

.card {
    background-color: var(--bg-panel);
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.card:hover { 
    background-color: var(--bg-hover); 
    transform: translateY(-4px);
}

.card-img {
    width: 100%;
    aspect-ratio: 1;
    background-color: #222;
    border-radius: 4px;
    margin-bottom: 12px;
    object-fit: cover;
    box-shadow: 0 8px 12px rgba(0,0,0,0.3);
}

.card-title { 
    font-weight: 700; font-size: 14px; margin-bottom: 6px; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.card-sub { color: var(--text-sub); font-size: 12px; }

/* LOADING MESSAGE */
.loading-msg { grid-column: 1 / -1; color: var(--text-sub); text-align: center; margin-top: 50px; }

/* PLAYER BAR */
.player-bar {
    height: var(--player-height);
    background-color: var(--bg-panel);
    border-top: 1px solid #222;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

/* Player Info (Left) */
.player-info { display: flex; align-items: center; width: 30%; gap: 14px; }
.player-info img { width: 56px; height: 56px; border-radius: 4px; background: #333; object-fit: cover; }
.track-details h4 { margin: 0; font-size: 14px; color: white; }
.track-details p { margin: 4px 0 0; font-size: 11px; color: var(--text-sub); }

/* Player Controls (Center) */
.player-controls { display: flex; flex-direction: column; align-items: center; width: 40%; }
.buttons { display: flex; align-items: center; gap: 24px; margin-bottom: 8px; }

.btn-control {
    background: none; border: none; color: var(--text-sub);
    cursor: pointer; font-size: 18px; transition: color 0.2s;
}
.btn-control:hover { color: white; }

.btn-play {
    width: 32px; height: 32px; border-radius: 50%;
    background: white; color: black; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: transform 0.1s; cursor: pointer;
}
.btn-play:hover { transform: scale(1.1); background: var(--accent); color: white; }

/* Progress Bar */
.progress-wrapper {
    width: 100%; display: flex; align-items: center; gap: 10px;
    font-size: 11px; color: var(--text-sub);
}

input[type=range] {
    -webkit-appearance: none; width: 100%; height: 4px;
    background: #404040; border-radius: 2px; outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 10px; height: 10px;
    background: white; border-radius: 50%;
}
input[type=range]:hover::-webkit-slider-thumb { background: var(--accent); }

/* Volume (Right) */
.player-volume { width: 30%; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.volume-slider { width: 80px; }