:root {
    --bg-dark: #0f0f13;
    --bg-panel: #18181c;
    --primary: #6c5ce7;
    --primary-hover: #5b4cc4;
    --accent: #00cec9;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --glass-bg: rgba(24, 24, 28, 0.95);
    --glass-border: rgba(255, 255, 255, 0.08);
    --nav-width: 240px;
    --player-height: 90px;
    --card-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--nav-width);
    background-color: var(--bg-panel);
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 40px;
}

.logo i {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 40px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
}

.playlists {
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 16px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    font-size: 14px;
}

.playlist-item:hover {
    color: var(--text-main);
}

/* Main Content */
.main-content {
    flex: 1;
    background: linear-gradient(180deg, #1e1e24 0%, var(--bg-dark) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
}

.top-bar {
    height: 80px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    z-index: 10;
    flex-shrink: 0;
}

.search-container {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 360px;
    border: 1px solid transparent;
    transition: 0.3s;
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.search-icon {
    color: var(--text-muted);
}

#searchInput {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    flex: 1;
    font-size: 14px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    cursor: pointer;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 120px 32px;
    /* Bottom padding for scroll space */
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Section */
.hero-banner {
    height: 280px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    position: relative;
    overflow: hidden;
    padding: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.hero-content {
    z-index: 2;
    max-width: 500px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.1;
}

.hero-content p {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 24px;
}

.play-btn-lg {
    background: var(--text-main);
    color: var(--primary);
    border: none;
    padding: 14px 32px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.play-btn-lg:hover {
    transform: scale(1.05);
    background: #f0f0f0;
}

.hero-visual {
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(40px);
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: 10px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.see-all {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
    font-weight: 600;
}

.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

/* Song Card */
.song-card {
    background: #1e1e24;
    padding: 16px;
    border-radius: var(--card-radius);
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.song-card:hover {
    background: #282830;
    transform: translateY(-5px);
}

.card-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.2s;
}

.song-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay i {
    font-size: 24px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: white;
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-artist {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Skeleton Loader */
.skeleton-card {
    height: 240px;
    background: #1e1e24;
    border-radius: var(--card-radius);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--player-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 300px;
}

.track-art {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: #333;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details h4 {
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-details p {
    font-size: 12px;
    color: var(--text-muted);
}

.like-btn {
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 10px;
}

.like-btn:hover {
    color: var(--primary);
}

.player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-width: 600px;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s;
}

.control-btn:hover {
    color: var(--text-main);
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--text-main);
    color: black;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.play-pause-btn:hover {
    transform: scale(1.1);
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.progress-bar-wrapper {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
}

.progress-bar {
    height: 100%;
    background: var(--text-main);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
}

.volume-controls {
    width: 300px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.volume-slider {
    width: 100px;
    height: 4px;
    accent-color: var(--primary);
}

/* Mobile Nav (Desktop Hidden) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--bg-panel);
    border-top: 1px solid var(--glass-border);
    justify-content: space-around;
    align-items: center;
    z-index: 110;
    padding: 0 10px;
}

.mobile-nav .nav-item {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    font-size: 10px;
    background: transparent !important;
}

.mobile-nav .nav-item i {
    font-size: 20px;
}

/* Responsive Queries */
@media (max-width: 992px) {
    .search-container {
        width: 250px;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .sidebar {
        display: none;
    }

    .mobile-nav {
        display: flex;
    }

    .top-bar {
        padding: 0 16px;
        height: 70px;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .content-scroll {
        padding: 16px 16px 180px 16px;
    }

    .hero-banner {
        height: auto;
        padding: 24px;
        margin-bottom: 24px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-visual {
        display: none;
    }

    .song-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .song-card {
        padding: 10px;
    }

    .player-bar {
        bottom: 65px;
        /* Stay above mobile nav */
        height: 80px;
        padding: 0 16px;
    }

    .track-info {
        width: auto;
        flex: 1;
    }

    .track-details {
        max-width: 120px;
    }

    .volume-controls {
        display: none;
        /* No space for volume on mobile */
    }

    .player-controls {
        max-width: none;
        width: auto;
    }

    .progress-container {
        display: none;
        /* Hide progress bar on mobile to keep it clean, or keep it tiny */
    }

    .control-buttons {
        gap: 12px;
    }

    .control-btn.sm {
        display: none;
        /* Hide shuffle/repeat to save space, or keep them */
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 28px;
    }

    .track-art {
        width: 40px;
        height: 40px;
    }

    .track-details h4 {
        font-size: 13px;
    }

    .song-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}