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

body {
    font-family: 'Poppins', sans-serif;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 1m ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

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

#player {
    width: 100%;
    max-width: 1000px;
    max-height: calc(100vh - 40px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 40px;
}

.player-main {
    flex: 1;
    min-width: 400px;
    display: flex;
    flex-direction: column;
}

.player-sidebar {
    flex: 1;
    min-width: 300px;
    border-left: 2px solid rgba(102, 126, 234, 0.2);
    padding-left: 40px;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    font-weight: 700;
    font-size: 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.now-playing {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #d11077 0%, #eb8507 50%, #dfbe01 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(255, 140, 0, 0.4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.album-art-container {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.album-art-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.album-art-placeholder {
    font-size: 80px;
    opacity: 0.5;
}

.now-playing-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-info {
    display: flex;
    flex-direction: column;
}

.now-playing-bottom {
    margin-top: auto;
}

.now-playing h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.now-playing p {
    font-size: 18px;
    opacity: 0.9;
    font-weight: 400;
}

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

button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #667eea;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 1);
}

button:active {
    transform: translateY(0) scale(0.98);
}

.amplitude-prev,
.amplitude-next {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.amplitude-play-pause {
    width: 70px;
    height: 70px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.amplitude-play-pause:hover {
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 1);
}

/* Button symbols */
.amplitude-prev::before {
    content: '◀◀';
    font-size: 16px;
}

.amplitude-next::before {
    content: '▶▶';
    font-size: 16px;
}

.amplitude-play-pause::before {
    content: '▶';
    font-size: 20px;
}

.amplitude-play-pause.amplitude-playing::before {
    content: '❚❚';
    font-size: 18px;
}

.playlist-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.playlist {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.playlist::-webkit-scrollbar {
    width: 6px;
}

.playlist::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.playlist::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.song-item {
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    border-radius: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}

.song-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.song-item:hover::before {
    opacity: 0.1;
}

.song-item.amplitude-active-song-container {
    background: linear-gradient(135deg, #9eafff 0%, #c790ff 100%);
    color: white;
}

.song-item.amplitude-active-song-container::before {
    opacity: 0;
}

.song-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.song-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.song-artist {
    font-size: 13px;
    opacity: 0.8;
}

.song-thumbnail {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.song-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0.3;
}

.external-link-icon {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-weight: bold;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    text-decoration: none;
    font-size: 12px;
    color: #667eea;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: auto;
    position: relative;
}

.external-link-icon:hover {
    background: rgba(102, 126, 234, 0.25);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.external-link-icon:active {
    transform: translateY(0) scale(1.05);
}

.song-item.amplitude-active-song-container .external-link-icon {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.song-item.amplitude-active-song-container .external-link-icon:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.progress-container {
    margin: 25px 0;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.amplitude-song-played-progress {
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    transition: width 0.1s linear;
}

/* Responsive layout */
@media (max-width: 900px) {
    body {
        padding: 0;
        margin: 0;
        overflow: hidden;
        align-items: stretch;
        height: 100vh;
        background: #ffffff;
    }

    #player {
        flex-direction: column;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        padding: 0;
        border-radius: 0;
        margin: 0;
        background: #ffffff;
        box-shadow: none;
    }

    .player-main {
        min-width: 0;
        flex: none;
        padding: 20px;
        padding-bottom: 15px;
    }

    .player-sidebar {
        min-width: auto;
        flex: 1;
        border-left: none;
        border-top: none;
        padding: 0 20px 20px 20px;
        margin: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .playlist {
        flex: 1;
        overflow-y: auto;
        padding-right: 0;
    }

    /* Hide scrollbar on mobile */
    .playlist::-webkit-scrollbar {
        display: none;
    }

    .playlist {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Compact now-playing display */
    .now-playing {
        padding: 15px 20px;
        flex: none;
    }

    .now-playing-top {
        flex-direction: row;
        gap: 15px;
        align-items: center;
        text-align: left;
        flex: none;
        min-height: 0;
    }

    .track-info {
        flex: 1;
        text-align: left;
    }

    .album-art-container {
        max-width: 80px;
        min-width: 80px;
        margin: 0;
        flex-shrink: 0;
    }

    .now-playing h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .now-playing p {
        font-size: 14px;
    }

    .controls button {
        width: 45px;
        height: 45px;
    }

    .amplitude-play-pause {
        width: 55px !important;
        height: 55px !important;
    }

    .external-link-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 14px;
    }
}

/* Dark mode for mobile */
@media (max-width: 900px) and (prefers-color-scheme: dark) {
    body {
        background: #868686;
    }

    #player {
        background: transparent;
    }

    .playlist-header {
        color: #e0e0e0;
    }

    .song-item {
        background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
        color: #e0e0e0;
    }

    .song-item.amplitude-active-song-container {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
}
