:root {
    --accent: #00ff88;
    --accent-hover: #00cc6e;
    --bg-dark: #050505;
    --bg-glass: rgba(18, 18, 18, 0.75);
    --card-bg: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --radius-lg: 32px;
    --radius-md: 20px;
    --radius-sm: 12px;
    --shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top right, #1a2a1f, #050505 45%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow: hidden;
    min-height: 100vh;
}

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    grid-template-areas: "nav main queue";
    height: 100vh;
    gap: 16px;
    padding: 16px;
}

.sidebar-nav {
    grid-area: nav;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow: hidden;
}

.brand h1 {
    font-size: 1.6em;
    font-weight: 700;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-left: 10px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    cursor: pointer;
}

.nav-item span { font-size: 1.2em; }

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #000;
    background: var(--accent);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.2);
}

.side-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 10px;
}

.side-history h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 12px;
}

.mini-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.mini-list::-webkit-scrollbar { width: 3px; }
.mini-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); }

.mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    font-size: 0.85em;
    transition: 0.2s;
}

.mini-item img {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
}

.mini-info { flex: 1; overflow: hidden; }
.mini-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.mini-artist { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; }

.main-content {
    grid-area: main;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 40px;
    position: relative;
    padding-bottom: 200px;
}

.main-content::-webkit-scrollbar { width: 6px; }
.main-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.view {
    display: none;
    animation: fadeIn 0.5s ease-out;
}
.view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.view-header {
    margin-bottom: 40px;
}
.view-header h1 {
    font-size: 2.8em;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
}
.view-header p {
    color: var(--text-secondary);
    font-size: 1.1em;
}

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

.playlist-card {
    background: var(--card-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.playlist-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border);
    transform: translateY(-8px);
}

.playlist-cover {
    width: 100%;
    aspect-ratio: 1;
    background: #111;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.playlist-name { font-weight: 600; margin-bottom: 4px; font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-info { font-size: 0.85em; color: var(--text-secondary); }

.card-overlay {
    position: absolute;
    right: 24px;
    bottom: 80px;
    width: 48px;
    height: 48px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.5em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 255, 136, 0.3);
}

.playlist-card:hover .card-overlay {
    opacity: 1;
    transform: translateY(0);
}

.queue-sidebar {
    grid-area: queue;
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
}

.queue-sidebar h2 {
    font-size: 1.4em;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.queue-list::-webkit-scrollbar { width: 4px; }
.queue-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 10px; }

.q-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: 0.2s;
}

.q-track:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
}

.q-art {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
}

.q-info { flex: 1; overflow: hidden; }
.q-title { font-weight: 500; font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-artist { font-size: 0.8em; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-bar {
    position: fixed;
    bottom: 32px;
    left: 312px;
    right: 372px;
    background: rgba(25, 25, 25, 0.85);
    backdrop-filter: blur(40px);
    border: 1px solid var(--border);
    border-radius: 60px;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 500;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
}

.mini-meta { display: flex; align-items: center; gap: 16px; flex: 1; }
.mini-art { width: 56px; height: 56px; border-radius: 50%; background-size: cover; border: 2px solid var(--border); }
.mini-text h4 { font-size: 1em; margin-bottom: 2px; }
.mini-text p { font-size: 0.8em; color: var(--text-secondary); }

.mini-progress-container {
    position: absolute;
    top: -2px;
    left: 60px;
    right: 60px;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
}
.mini-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s linear;
}

.search-header {
    background: rgba(255,255,255,0.03);
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    gap: 16px;
    border: 1px solid var(--border);
    max-width: 500px;
    margin-bottom: 40px;
}

.search-header input {
    background: transparent;
    border: none;
    color: #fff;
    flex: 1;
    outline: none;
    font-size: 1em;
}

.btn-back {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    margin-bottom: 32px;
    transition: all 0.3s;
}

.playlist-header {
    display: flex;
    gap: 40px;
    align-items: flex-end;
    margin-bottom: 48px;
}

.playlist-cover-large {
    width: 240px;
    height: 240px;
    background: #1a1a1a;
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
}

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

.track-list-item {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.track-list-item:hover { background: rgba(255, 255, 255, 0.05); }

.track-list-item-img {
    width: 52px;
    height: 52px;
    background: #1a1a1a;
    border-radius: var(--radius-sm);
    background-size: cover;
    background-position: center;
}

.track-list-item-info { 
    flex: 1; 
    min-width: 0;
}
.track-list-item-title { font-weight: 500; font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-list-item-artist { color: var(--text-secondary); font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-list-item-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.track-list-item-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 80px 1fr 300px;
    }
    .side-history h3 { display: none; }
    .nav-item span:last-child { display: none; }
    .mini-info { display: none; }
    .mini-item { justify-content: center; }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 80px 1fr;
        grid-template-areas: "nav main";
    }
    .queue-sidebar { display: none; }
    .player-bar { left: 112px; right: 32px; }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-areas: "main";
        padding-bottom: 80px;
    }
    .sidebar-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        flex-direction: row;
        justify-content: space-around;
        border-radius: 0;
        padding: 0;
        z-index: 1000;
    }
    .side-history { display: none; }
    .brand { display: none; }
    .nav-menu { flex-direction: row; width: 100%; justify-content: space-around; }
    .player-bar { left: 16px; right: 16px; bottom: 86px; border-radius: 20px; }
    .main-content { border-radius: 0; padding: 24px; }
}
