/* Modern Music Player Design - DesiSpotify 2.0 */
:root {
    --bg-dark: #121212;
    --bg-card: #181818;
    --bg-hover: #282828;
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --accent: #E91E63;
    /* Vibrant Pink/Red */
    --accent-hover: #D81B60;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 240px;
    --player-height: 90px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hidden {
    display: none !important;
}

/* Search View Styles */
.search-container {
    padding: 32px 32px 16px;
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input-wrapper input {
    width: 100%;
    background: var(--bg-hover);
    border: 1px solid transparent;
    border-radius: 500px;
    padding: 12px 16px 12px 48px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    background: #333;
    border-color: var(--glass-border);
}

.search-input-wrapper input::placeholder {
    color: var(--text-secondary);
}

/* Library View Styles */
#libraryView {
    width: 100%;
    display: block;
    min-height: 100%;
}

.library-header {
    padding: 32px 32px 16px;
}

.library-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.library-list {
    list-style: none;
    padding: 0 16px;
}

.library-list li {
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.library-list li:hover {
    background: var(--bg-hover);
}

.library-list li i {
    color: var(--accent);
    font-size: 20px;
}


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

body {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Glassmorphism Utility */
.glass {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

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

/* Sidebar */
.sidebar {
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    padding: 24px 12px;
    gap: 24px;
    border-right: 1px solid var(--glass-border);
}

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

.logo-icon {
    font-size: 32px;
    color: var(--accent);
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.playlist-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.section-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 0 16px;
}

.playlist-nav {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.playlist-nav li {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.playlist-nav li.active {
    color: var(--accent);
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, rgba(233, 30, 99, 0.1) 0%, transparent 100%);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Main Content */
.main-content {
    background: rgba(18, 18, 18, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}



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

.upgrade-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

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

/* Hero Section */
.hero-section {
    display: flex;
    align-items: flex-end;
    /* Bottom align text with image */
    padding: 30px 32px;
    background: linear-gradient(transparent 0, rgba(0, 0, 0, 0.5) 100%), var(--bg-hover);
    height: 340px;
    gap: 24px;
}

.hero-art {
    width: 232px;
    height: 232px;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

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

.hero-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
}

.hero-info h1 {
    font-size: 60px;
    /* Reduced to fit better */
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

#heroDescription {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
}

/* Action Bar */
.action-bar {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.play-btn-large {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

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

.action-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    /* Larger */
    cursor: pointer;
    transition: var(--transition);
}

.action-icon:hover {
    color: var(--text-primary);
}

/* Song List */
.song-list-header {
    display: grid;
    grid-template-columns: 50px 4fr 3fr 100px;
    padding: 0 32px 12px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#songListView {
    width: 100%;
    display: block;
}

.song-list {
    padding: 0 32px;
    display: flex;
    flex-direction: column;
}

.song-row {
    display: grid;
    grid-template-columns: 50px 4fr 3fr 100px;
    padding: 8px 16px;
    /* Inner padding for hover effect */
    margin: 0 -16px;
    /* Negative margin to align with header */
    border-radius: 4px;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--text-secondary);
}

.song-row:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.song-row.active {
    background-color: rgba(255, 255, 255, 0.1);
}

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

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

.col-num {
    text-align: center;
}

.col-title {
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.col-title .sub-artist {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.col-album {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-duration {
    text-align: right;
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: #181818;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 30%;
}

.player-track-info img {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
}

.track-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

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

.like-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-left: 12px;
}

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

.control-buttons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

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

.play-pause-btn {
    background: var(--text-primary);
    color: #000;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.play-pause-btn:hover {
    transform: scale(1.1);
    background: #FFF;
    color: #000;
    /* Ensure icon stays black */
}

.progress-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

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

.progress-bar-fill {
    height: 100%;
    background: var(--text-primary);
    /* Use white for progress bar */
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-bar-bg:hover .progress-bar-fill {
    background: var(--accent);
    /* Turn accent color on hover */
}

.player-volume-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 30%;
    gap: 8px;
    color: var(--text-secondary);
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    visibility: hidden;
    /* Hide thumb until hover */
}

.player-volume-right:hover .volume-slider::-webkit-slider-thumb {
    visibility: visible;
}

/* Footer Info */
.footer-info {
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Mobile Navigation Base */
.mobile-nav,
.mobile-albums {
    display: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
        height: calc(100vh - 120px);
        /* Adjust for player + nav */
    }

    .sidebar {
        display: none;
    }

    /* Mobile Navigation Bar */
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: rgba(10, 10, 10, 0.95);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 102;
        /* Highest priority */
        justify-content: space-around;
        align-items: center;
        backdrop-filter: blur(10px);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-secondary);
        font-size: 10px;
        gap: 4px;
        flex: 1;
        height: 100%;
        text-decoration: none;
    }

    .mobile-nav-item.active {
        color: var(--text-primary);
    }

    .mobile-nav-item i {
        font-size: 20px;
    }

    /* Main Content Adjustments */
    .main-content {
        padding-bottom: 0;
    }



    /* Hero Section Mobile */
    .hero-section {
        flex-direction: column;
        align-items: center;
        height: auto;
        padding: 32px 16px;
        text-align: center;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.8) 100%), var(--bg-hover);
        gap: 16px;
    }

    .hero-art {
        width: 160px;
        height: 160px;
        margin: 0 auto;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .hero-info {
        align-items: center;
        width: 100%;
    }

    .hero-info h1 {
        font-size: 28px;
        line-height: 1.2;
        margin-bottom: 4px;
    }

    #heroDescription {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 13px;
    }

    .action-bar {
        justify-content: center;
        padding: 8px 16px 24px;
        gap: 24px;
    }

    .play-btn-large {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    /* Song List Mobile */
    .song-list-header {
        display: none;
    }

    .song-list {
        padding: 0 12px;
    }

    .song-row {
        grid-template-columns: 32px 1fr 40px;
        /* Index, Title, Menu/Time */
        padding: 12px 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    .col-album {
        display: none;
    }

    .col-duration {
        font-size: 12px;
    }

    /* Compact Player Bar */
    .player-bar {
        bottom: 60px;
        /* Sit on top of nav */
        height: 60px;
        padding: 0 12px;
        background: rgba(24, 24, 24, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 101;
    }

    .player-track-info {
        width: 65%;
        gap: 12px;
    }

    .player-track-info img {
        width: 42px;
        height: 42px;
    }

    .like-btn {
        display: none;
        /* Hide hearts on mini player to save space */
    }

    /* Simplified Controls */
    .player-controls-center {
        width: 35%;
        align-items: flex-end;
        flex-direction: row;
        justify-content: flex-end;
        gap: 0;
    }

    .control-buttons {
        gap: 16px;
    }

    #prevBtn,
    #shuffleBtn,
    #repeatBtn {
        display: none;
    }

    #nextBtn {
        display: block;
        /* Show next button */
        font-size: 20px;
    }

    .play-pause-btn {
        width: 32px;
        height: 32px;
        background: transparent;
        color: var(--text-primary);
        font-size: 24px;
    }

    .play-pause-btn:hover {
        transform: none;
        background: transparent;
        color: var(--text-primary);
    }

    /* Progress Bar as thin line at top */
    .progress-bar-container {
        position: absolute;
        top: -2px;
        left: 0;
        width: 100%;
        height: 2px;
        gap: 0;
    }

    .time {
        display: none;
    }

    .progress-bar-bg {
        background: transparent;
        height: 2px;
        border-radius: 0;
    }

    .progress-bar-fill {
        background: var(--accent);
        border-radius: 0;
    }

    .player-volume-right {
        display: none;
    }
}
