:root {
    --bg-color: #0d0d12;
    --card-bg: rgba(255, 255, 255, 0.03);
    --accent: #7c4dff;
    --accent-glow: rgba(124, 77, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.06);
    --glass: rgba(255, 255, 255, 0.02);
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(124, 77, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 229, 255, 0.03) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 450px;
    /* Enforced global mobile constraint */
    margin: 0 auto;
    position: relative;
}

/* Notification */
.notification {
    position: absolute;
    top: -20px;
    left: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transform: translateY(-100%);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-120%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
}

/* Player Card */
.player-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: clamp(20px, 5vw, 30px);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
    overflow: visible;
}

/* Header */
.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-header button {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-header button:hover {
    color: var(--text-primary);
    background: var(--border);
}

.header-info {
    text-align: center;
}

.status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    color: var(--accent);
}

/* Visual Section */
.visual-section {
    text-align: center;
}

.album-art-wrapper {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 20px;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: transparent;
}

.album-art-container {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    background: transparent;
}

#currentArtwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
}

.album-art-container:hover #currentArtwork {
    transform: scale(1.05);
}

.artwork-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.album-art-container:hover .artwork-overlay {
    opacity: 1;
}

.artwork-overlay i {
    font-size: 32px;
    color: white;
}

.brand-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.brand-logo-top {
    height: 80px;
    width: auto;
    max-width: 220px;
}

.track-meta {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.track-meta h1 {
    font-size: clamp(18px, 5vw, 22px);
    font-weight: 600;
    margin-bottom: 4px;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    display: block;
    text-align: center;
    padding: 0 10px;
    line-height: 1.2;
}

.track-meta p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Playback Section */
.playback-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.waveform-container {
    height: 50px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
    overflow: hidden;
}

.progress-info {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    color: var(--text-secondary);
    height: 40px;
    padding-bottom: 5px;
}

.progress-track {
    flex: 1;
    position: relative;
    height: 25px;
    display: flex;
    align-items: flex-end;
}

#currentTime {
    position: absolute;
    bottom: 18px;
    left: 0;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
    transition: left 0.1s linear;
    width: fit-content;
    white-space: nowrap;
}

#currentTime::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--accent);
}

#progressBar {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

#progressBar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Main Controls */
.main-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.play-pause-wrapper {
    position: relative;
    width: 70px;
    height: 70px;
}

.btn-primary {
    position: absolute;
    inset: 0;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 30px var(--accent-glow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px var(--accent-glow);
}

/* Volume */
.volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    padding: 0 5px;
}

#volumeControl {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

#volumeControl::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
}

/* Playlist Section */
.playlist-section {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 5px;
}

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

.playlist-header h3 {
    font-size: 14px;
    font-weight: 600;
}

#trackCount {
    color: var(--accent);
    margin-left: 4px;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.playlist-container {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 5px;
}

.playlist-container::-webkit-scrollbar {
    width: 3px;
}

.playlist-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.track-item:hover {
    background: var(--glass);
}

.track-item.playing {
    background: var(--glass);
    border: 1px solid var(--border);
}

.track-item img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

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

.track-info-small h4 {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.track-info-small p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Global Dropzone */
.global-dropzone {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 18, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.global-dropzone.active {
    opacity: 1;
    pointer-events: all;
}

.drop-hint {
    text-align: center;
}

.drop-hint i {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 15px;
}

/* Force Mobile Aspect on Desktop */
@media (min-width: 480px) {
    body {
        background-attachment: fixed;
    }

    .player-card {
        /* aspect-ratio removed to allow content to dictate height */
        height: auto;
        /* min/max height removed to prevent clipping */
    }
}

/* Scrollbar styling for desktop view around the app */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: var(--bg-color);
}

body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}