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

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: #000000;
    color: #ffffff;
    overflow: hidden;
}

body {
    display: flex;
}

/* SIDEBAR - Desktop Only */
.sidebar {
    width: 280px;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    border-right: 1px solid #222;
    gap: 32px;
    overflow-y: auto;
}

.sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #b0b0b0;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background-color: #2a2a2a;
    color: #ffffff;
}

.nav-item.active {
    background-color: #3a3a3a;
    color: #ffffff;
}

.nav-item .material-icons {
    font-size: 20px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* TOP BAR */
.top-bar {
    padding: 16px 24px;
    border-bottom: 1px solid #222;
    display: flex;
    gap: 16px;
    align-items: center;
    background: #0a0a0a;
    z-index: 20;
}

.search-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 24px;
    padding: 10px 16px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
    max-width: 400px;
}

.search-input::placeholder {
    color: #666;
}

.search-input:focus {
    outline: none;
    border-color: #444;
    background: #333;
}

/* CONTENT AREA */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* SEARCH RESULTS */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.song-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #222;
}

.song-card:hover {
    background-color: #252525;
    transform: translateY(-2px);
    border-color: #333;
}

.song-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: #2a2a2a;
    object-fit: cover;
}

.song-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 50px;
}

.song-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.song-artist {
    font-size: 12px;
    color: #888;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #666;
    padding: 60px 24px;
    text-align: center;
}

.empty-state .material-icons {
    font-size: 64px;
    opacity: 0.5;
}

/* PLAYER BAR */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(25px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 30;
    cursor: pointer;
}

.player-bar.hidden {
    display: none;
}

.player-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: #2a2a2a;
    object-fit: cover;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.player-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.player-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 4px;
}

.player-btn:hover {
    color: #ccc;
}

.player-btn .material-icons {
    font-size: 24px;
}

/* NOW PLAYING OVERLAY */
.now-playing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 24px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.now-playing-overlay.active {
    opacity: 1;
    visibility: visible;
}

.np-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.np-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color 0.2s;
}

.np-close-btn:hover {
    color: #888;
}

.np-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.np-cover {
    width: 280px;
    height: 280px;
    border-radius: 16px;
    background: #2a2a2a;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: spin 8s linear infinite;
    animation-play-state: running;
}

.np-cover.paused {
    animation-play-state: paused;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.np-info {
    text-align: center;
    gap: 8px;
    display: flex;
    flex-direction: column;
}

.np-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.np-artist {
    font-size: 16px;
    color: #888;
}

.np-progress {
    width: 100%;
    max-width: 400px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #2a2a2a;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 3px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
    opacity: 1;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.np-controls {
    display: flex;
    gap: 24px;
    align-items: center;
}

.np-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, color 0.2s;
    padding: 8px;
}

.np-btn:hover {
    color: #ccc;
}

.np-btn:active {
    transform: scale(0.95);
}

.np-btn.play-btn {
    width: 56px;
    height: 56px;
    background: #ffffff;
    color: #000000;
    border-radius: 50%;
}

.np-btn.play-btn:hover {
    color: #000000;
    background: #e0e0e0;
}

.np-btn .material-icons {
    font-size: 28px;
}

.np-btn.play-btn .material-icons {
    font-size: 32px;
}

/* BOTTOM NAV - Mobile */
.bottom-nav {
    display: none;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s;
    color: #666;
    flex: 1;
}

.bottom-nav-item.active {
    color: #ffffff;
}

.bottom-nav-item .material-icons {
    font-size: 24px;
}

/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast.error {
    border-color: #ff4444;
    color: #ff6666;
}

/* LOADING STATE */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #888;
    font-size: 14px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
    animation: bounce 1.4s infinite;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        display: none;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .search-input {
        max-width: none;
    }

    .content {
        padding: 16px;
        padding-bottom: 140px;
        gap: 16px;
    }

    .songs-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .song-card {
        padding: 12px;
        gap: 8px;
    }

    .player-bar {
        bottom: 60px;
        height: 70px;
        padding: 10px 12px;
    }

    .player-thumbnail {
        width: 50px;
        height: 50px;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(20, 20, 20, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: env(safe-area-inset-bottom);
        z-index: 25;
    }

    .np-cover {
        width: 240px;
        height: 240px;
    }

    .np-title {
        font-size: 22px;
    }

    .np-artist {
        font-size: 14px;
    }

    .np-controls {
        gap: 16px;
    }
}

@media (max-height: 600px) {
    .sidebar {
        padding: 16px 8px;
        gap: 16px;
    }

    .content {
        padding: 16px;
    }

    .songs-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .np-cover {
        width: 200px;
        height: 200px;
    }

    .np-content {
        gap: 16px;
    }
}
