:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-dark: #0a0e27;
    --bg-darker: #050818;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #b8b8d1;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-bottom: 140px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
}

.menu-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-icon span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: 0.3s;
}

.app-title {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dropdown-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(30px);
    z-index: 2000;
    transition: 0.3s;
    padding: 80px 0 20px;
    border-right: 1px solid var(--glass-border);
}

.dropdown-menu.active {
    left: 0;
}

.menu-item {
    padding: 18px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--glass-bg);
    border-left-color: var(--accent-purple);
}

.menu-item svg {
    width: 22px;
    height: 22px;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.main-content {
    margin-top: 60px;
    padding: 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 25px 0 15px;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.song-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 12px;
    cursor: pointer;
    transition: 0.3s;
    backdrop-filter: blur(10px);
}

.song-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.song-card img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 10px;
}

.song-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.song-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.song-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: 0.2s;
    backdrop-filter: blur(10px);
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.song-item.playing {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.song-item img {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    object-fit: cover;
}

.song-info {
    flex: 1;
    min-width: 0;
}

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

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

.song-menu {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s;
}

.song-menu:hover {
    background: var(--glass-bg);
}

.search-bar {
    position: sticky;
    top: 60px;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(20px);
    padding: 15px 0;
    margin: -20px -20px 20px;
    padding-left: 20px;
    padding-right: 20px;
    z-index: 100;
}

.search-input-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 45px 14px 45px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}

.search-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    opacity: 0.4;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    z-index: 900;
    transition: 0.3s;
}

.bottom-nav.with-mini {
    bottom: 70px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: 0.2s;
}

.nav-item.active {
    color: var(--accent-purple);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.mini-player {
    position: fixed;
    bottom: -80px;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 12px;
    z-index: 950;
    transition: 0.3s;
}

.mini-player.active {
    bottom: 70px;
}

.mini-album {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
}

.mini-album.playing {
    animation-play-state: running;
}

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

.mini-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

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

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

.mini-play-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

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

.full-player {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    height: 100vh;
    background: var(--bg-darker);
    z-index: 3000;
    transition: 0.4s;
    overflow-y: auto;
}

.full-player.active {
    top: 0;
}

.player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background-size: cover;
    background-position: center;
    filter: blur(80px);
    opacity: 0.3;
}

.player-content {
    position: relative;
    padding: 20px;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

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

.album-art-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.album-disk {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    position: relative;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
}

.album-disk.playing {
    animation-play-state: running;
}

.album-disk::before {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: var(--primary-gradient);
    opacity: 0.3;
    filter: blur(20px);
}

.album-disk img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.player-info {
    text-align: center;
    margin: 30px 0;
}

.player-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.player-artist {
    font-size: 16px;
    color: var(--text-secondary);
}

.like-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: none;
    margin-top: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.like-btn.liked {
    animation: heartBeat 0.3s;
}

.like-btn.liked svg {
    fill: var(--accent-pink);
    stroke: var(--accent-pink);
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

.progress-section {
    margin: 40px 0 30px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--glass-bg);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s;
}

.time-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

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

.control-btn.active {
    background: var(--primary-gradient);
}

.play-btn {
    width: 70px;
    height: 70px;
    background: var(--primary-gradient);
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state {
    text-align: center;
    padding: 40px;
}

/* ===== PWA INSTALL POPUP CSS ===== */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    z-index: 350;
}
.popup-content {
    background: #0a0e27;
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.3), 0 25px 50px -12px rgba(0,0,0,0.6);
    position: relative;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.3s ease;
    color: #fff;
}
.popup-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.popup-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}
.max-w-sm { max-width: 24rem; }
.text-center { text-align: center; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }
.rounded-2xl { border-radius: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: #6b7280; }
.btn-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1em;
    font-family: inherit;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 8px 15px rgba(102,126,234,0.3);
    transition: all 0.3s ease;
    margin-bottom: 12px;
}
.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(102,126,234,0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
}
.not-now-btn {
    background: none;
    border: none;
    color: #b8b8d1;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    text-decoration: underline;
    transition: all 0.3s ease;
    padding: 5px 10px;
}
.not-now-btn:hover {
    color: #fff;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}