/* Reset & Core Config */
:root {
    --bg-black: #000000;
    --bg-dark: #121212;
    --bg-light: #1e1e1e;
    --bg-elevated: #282828;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #bb86fc;
    /* Purple/Violet Accent */
    --accent-hover: #9e64e6;
    --accent-dim: rgba(187, 134, 252, 0.1);
    --border-color: #333;
    --transition: all 0.3s ease;
    --sidebar-width: 280px;
    --player-height: 90px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-black);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    overflow: hidden;
    /* Prevent body scroll, handle internally */
    height: 100vh;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-areas:
        "sidebar main"
        "player player";
    grid-template-rows: 1fr var(--player-height);
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background-color: var(--bg-black);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.logo i {
    font-size: 1.5rem;
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

nav ul li.active a,
nav ul li a:hover {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

.playlist-section h3 {
    padding: 0 12px;
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.create-playlist,
.liked-songs {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.create-playlist:hover,
.liked-songs:hover {
    color: var(--text-primary);
}

.icon-box {
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    color: var(--text-primary);
}

.icon-box.gradient-bg {
    background: linear-gradient(135deg, #450af5, #a485fa);
}

.playlist-list {
    list-style: none;
    margin-top: 10px;
    padding: 0 12px;
    overflow-y: auto;
    max-height: 200px;
}

.playlist-list li {
    padding: 6px 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.playlist-list li:hover {
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    grid-area: main;
    background: linear-gradient(180deg, #2a1040 0%, var(--bg-dark) 40%);
    overflow-y: auto;
    position: relative;
    border-radius: 8px;
    margin: 8px 8px 0 0;
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.nav-arrows button {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 8px;
}

.upgrade-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    margin-right: 16px;
    transition: transform 0.1s;
}

.upgrade-btn:hover {
    transform: scale(1.05);
    border-color: var(--text-primary);
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Hero Section */
.content-padding {
    padding: 24px 32px;
    padding-bottom: 120px;
    /* Space for list */
}

.hero-banner {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}

.hero-image {
    width: 230px;
    height: 230px;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fallback-hero-icon {
    font-size: 80px;
    color: #555;
}

.hero-text {
    flex: 1;
}

.sub-text {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    font-size: 80px;
    font-weight: 900;
    letter-spacing: -2px;
    margin: 8px 0;
    color: var(--text-primary);
}

.desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 24px;
}

.play-btn-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent);
    border: none;
    color: var(--bg-black);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.play-btn-large:hover {
    transform: scale(1.05);
    background-color: var(--accent-hover);
}

.like-btn-large,
.more-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 32px;
    cursor: pointer;
}

.like-btn-large:hover,
.more-btn:hover {
    color: var(--text-primary);
}

/* Song List */
.song-list-container {
    margin-top: 24px;
}

.list-header {
    display: grid;
    grid-template-columns: 40px 4fr 3fr 2fr 60px;
    padding: 0 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

hr {
    display: none;
    /* Hide hr as border-bottom is used now or remove completely if preferred, but hiding is safer to match initial */
}

.song-row {
    display: grid;
    grid-template-columns: 40px 4fr 3fr 2fr 60px;
    padding: 10px 16px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 14px;
    align-items: center;
    cursor: pointer;
    transition: 0.2s;
}

.song-row:hover {
    background-color: #282828;
    transform: scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.song-row.active {
    background-color: #282828;
}

.song-row.active .title {
    color: var(--accent);
}

.song-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.song-info img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

.title-artist {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
}

.artist {
    font-size: 12px;
    color: var(--text-secondary);
}

.col-album,
.col-date {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.cover-img {
    width: 56px;
    height: 56px;
    color: var(--text-primary);
}

.main-control {
    width: 32px;
    height: 32px;
    background-color: var(--text-primary) !important;
    color: var(--bg-black) !important;
    border-radius: 50%;
    font-size: 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1);
}

.main-control:hover {
    transform: scale(1.05) !important;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #a7a7a7;
    font-variant-numeric: tabular-nums;
    /* Prevent jitter */
}

.progress-bar-wrapper {
    flex: 1;
    height: 4px;
    background-color: hsla(0, 0%, 100%, .3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* For rounded corners on bar */
}

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

.progress-bar-wrapper:hover .progress-bar {
    background-color: var(--accent);
    /* #1db954 or purple */
}

/* Player Right */
.player-right {
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.player-right button {
    background: transparent;
    border: none;
    color: #b3b3b3;
    cursor: pointer;
    font-size: 16px;
}

.player-right button:hover {
    color: var(--text-primary);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 93px;
}

.volume-bar-wrapper {
    flex: 1;
    height: 4px;
    background-color: hsla(0, 0%, 100%, .3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-bar {
    width: 70%;
    height: 100%;
    background-color: #b3b3b3;
    border-radius: 2px;
}

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

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.song-row {
    animation: fadeIn 0.3s ease-in;
}