@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #121212;
    --bg-surface: #181818;
    --bg-elevated: #1e1e1e;
    --bg-highlight: #282828;
    --bg-sidebar: #000000;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-subdued: #6a6a6a;
    --accent: #1db954;
    --accent-hover: #1ed760;
    --border-color: rgba(255, 255, 255, 0.06);
    --hover-bg: rgba(255, 255, 255, 0.07);
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.1);
    --player-bg: #181818;
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    background: var(--bg-base);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 80px);
}

.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 24px 20px;
}

.logo .icon-logo {
    font-size: 28px;
    color: var(--text-primary);
}

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.menu {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    gap: 2px;
}

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

.menu-item .material-symbols-rounded {
    font-size: 24px;
}

.menu-item:hover {
    color: var(--text-primary);
}

.menu-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    overflow: hidden;
    position: relative;
}

.topbar {
    height: 64px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.nav-btn .material-symbols-rounded {
    font-size: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-highlight);
    border-radius: 500px;
    padding: 6px 14px;
    width: 360px;
    gap: 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.search-bar:focus-within {
    border-color: var(--text-primary);
    background: var(--bg-elevated);
}

.search-bar .material-symbols-rounded {
    color: var(--text-secondary);
    font-size: 22px;
}

.search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 400;
}

.search-bar input::placeholder {
    color: var(--text-subdued);
}

.user-profile .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-highlight);
    cursor: pointer;
    transition: transform 0.2s;
}

.user-profile .avatar:hover {
    transform: scale(1.05);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px 32px;
    scroll-behavior: smooth;
}

.content-scroll::-webkit-scrollbar {
    width: 12px;
}

.content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: content-box;
}

.content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
    background-clip: content-box;
}

.content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: 32px;
}

.section-header:first-child {
    margin-top: 8px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: color 0.15s;
}

.section-link:hover {
    color: var(--text-primary);
}

.loading-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.loading-spinner.active {
    display: flex;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

.card:hover {
    background: var(--card-hover);
}

.card .cover-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card .play-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

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

.card .play-overlay .material-symbols-rounded {
    font-size: 24px;
    color: #000;
}

.card .song-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.3;
}

.card .song-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bottom-player {
    height: 80px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--player-bg);
    border-top: 1px solid var(--border-color);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 30%;
    min-width: 180px;
}

.now-playing .cover {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.track-info {
    overflow: hidden;
}

.track-info .title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.track-info .artist {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.track-info .artist:hover {
    color: var(--text-primary);
    text-decoration: underline;
    cursor: pointer;
}

.heart-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0;
    transition: color 0.15s;
}

.heart-btn:hover {
    color: var(--text-primary);
}

.heart-btn .material-symbols-rounded {
    font-size: 18px;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 40%;
    max-width: 720px;
}

.controls-main {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.control-btn:hover {
    color: var(--text-primary);
}

.control-btn .material-symbols-rounded {
    font-size: 20px;
}

.control-btn.play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--text-primary);
    color: #000;
    padding: 0;
    transition: transform 0.1s;
}

.control-btn.play-btn:hover {
    transform: scale(1.06);
    background: var(--text-primary);
    color: #000;
}

.control-btn.play-btn .material-symbols-rounded {
    font-size: 20px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.progress-container .time {
    font-size: 11px;
    color: var(--text-subdued);
    min-width: 32px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.1s;
}

.progress-bar:hover {
    height: 6px;
}

.progress-bar .progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    width: 0%;
    transition: background 0.1s;
}

.progress-bar:hover .progress {
    background: var(--accent);
}

.extra-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 30%;
    justify-content: flex-end;
}

.extra-controls .material-symbols-rounded {
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s;
}

.extra-controls .material-symbols-rounded:hover {
    color: var(--text-primary);
}

.volume-bar {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.volume-bar:hover {
    height: 6px;
}

.volume-level {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: background 0.1s;
}

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

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 12px;
}

.empty-state .material-symbols-rounded {
    font-size: 56px;
    color: var(--text-subdued);
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 15px;
}

.empty-state p:last-child {
    color: var(--text-subdued);
    font-size: 13px;
}

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

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

.card {
    animation: fadeInUp 0.4s ease both;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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

    .extra-controls {
        display: none;
    }

    .now-playing {
        width: 40%;
    }

    .player-controls {
        width: 60%;
    }
}

.lyrics-view {
    flex: 1;
    display: flex;
    padding: 40px;
    gap: 60px;
    overflow: hidden;
    height: 100%;
}

.lyrics-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyrics-cover-wrapper {
    width: 280px;
    height: 280px;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0, 191, 255, 0.4), 0 0 20px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease;
}

@keyframes rhythmPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(0, 191, 255, 0.4), 0 0 10px rgba(255, 255, 255, 0.3);
    }
    100% {
        transform: scale(1.08);
        box-shadow: 0 0 80px rgba(0, 191, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.6);
    }
}

.lyrics-cover-wrapper.playing {
    animation: rhythmPulse 1.2s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.lyrics-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lyrics-right {
    flex: 1;
    overflow-y: auto;
    padding-right: 20px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    padding-bottom: 50%;
}

.lyrics-right::-webkit-scrollbar {
    display: none;
}

.lyric-line {
    font-size: 36px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1.3;
}

.lyric-line.active {
    color: #ffffff;
    transform: scale(1.02);
    transform-origin: left;
}

.lyrics-placeholder {
    font-size: 24px;
    color: var(--text-secondary);
    margin-top: 50%;
    transform: translateY(-50%);
}

.mobile-nav { display: none; }
@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 90px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(20, 20, 20, 0.4);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 30px;
        padding: 8px 16px;
        gap: 32px;
        z-index: 90;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
    .mobile-menu-item {
        color: var(--text-secondary);
        text-decoration: none;
        display: flex;
        padding: 8px;
        border-radius: 50%;
        transition: color 0.2s, background 0.2s;
    }
    .mobile-menu-item.active {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.1);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.auth-fullscreen {
    background: var(--bg-base);
}

.auth-content {
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
}

.auth-header {
    margin-bottom: 32px;
}

.auth-header .icon-logo {
    margin-bottom: 16px;
}

#auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.auth-error {
    background: rgba(230, 33, 23, 0.2);
    color: #ff4d4d;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
}

#auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#auth-form input {
    background: var(--bg-highlight);
    border: 1px solid transparent;
    padding: 14px;
    border-radius: 4px;
    color: white;
    outline: none;
    font-family: var(--font);
    font-size: 14px;
    transition: border-color 0.2s;
}

#auth-form input:focus {
    border-color: var(--text-subdued);
}

#auth-form button {
    background: var(--accent);
    color: black;
    border: none;
    padding: 14px;
    border-radius: 500px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
    transition: transform 0.1s;
}

#auth-form button:hover {
    transform: scale(1.02);
}

.auth-switch {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

#auth-switch-btn {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.user-dropdown button:hover {
    background: var(--hover-bg) !important;
}
