:root {
    --bg-deep: #0a1628;
    --bg-card: #112240;
    --bg-hover: #1a3a5c;
    --accent-blue: #5cb8ff;
    --accent-cyan: #64dfdf;
    --accent-light: #89c4f4;
    --text-primary: #e8f4fc;
    --text-muted: #8ba3b9;
    --gradient-sky: linear-gradient(135deg, #5cb8ff 0%, #64dfdf 50%, #89c4f4 100%);
    --shadow-glow: 0 0 40px rgba(92, 184, 255, 0.15);
}

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

body {
    font-family: 'Libre Franklin', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(92, 184, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(100, 223, 223, 0.25) 0%, transparent 50%);
    opacity: 1;
    pointer-events: none;
    z-index: -1;
}

.music-wave {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.4;
}

.music-wave svg {
    width: 100%;
    height: 100%;
}

.floating-notes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.note {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(92, 184, 255, 0.35);
    animation: floatUp 15s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(92, 184, 255, 0.5);
}

.note-1 { left: 10%; animation-delay: 0s; font-size: 2rem; color: rgba(255, 100, 150, 0.35); }
.note-2 { left: 25%; animation-delay: 2s; font-size: 3rem; color: rgba(100, 223, 223, 0.35); }
.note-3 { left: 45%; animation-delay: 4s; font-size: 2.2rem; color: rgba(255, 200, 100, 0.35); }
.note-4 { left: 65%; animation-delay: 1s; font-size: 2.8rem; color: rgba(150, 100, 255, 0.35); }
.note-5 { left: 80%; animation-delay: 3s; font-size: 2rem; color: rgba(100, 255, 150, 0.35); }
.note-6 { left: 90%; animation-delay: 5s; font-size: 2.5rem; color: rgba(255, 150, 200, 0.35); }

@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg) scale(0.5); opacity: 0; }
    10% { opacity: 0.5; transform: translateY(80vh) rotate(20deg) scale(1); }
    90% { opacity: 0.5; transform: translateY(10vh) rotate(340deg) scale(1); }
    100% { transform: translateY(-100px) rotate(360deg) scale(0.5); opacity: 0; }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 24px;
}

header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-sky);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    fill: var(--bg-deep);
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    background: var(--gradient-sky);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
    margin-top: 8px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.visualizer-section {
    display: none;
    margin-bottom: 32px;
    animation: fadeIn 0.5s ease-out;
}

.visualizer-section.active {
    display: block;
}

.visualizer-container {
    width: 100%;
    height: 100px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-glow);
    border: 1px solid rgba(92, 184, 255, 0.15);
}

#visualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.now-playing {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-glow);
    border: 1px solid rgba(92, 184, 255, 0.15);
    animation: fadeIn 0.8s ease-out 0.2s both;
    display: none;
}

.now-playing.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.now-playing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--accent-blue);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.current-track-info {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.album-art {
    width: 120px;
    height: 120px;
    background: var(--gradient-sky);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.album-art::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(13, 10, 15, 0.3);
    border-radius: 50%;
}

.album-art.playing::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.track-details h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.progress-container { margin-bottom: 24px; }

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.control-btn svg { width: 24px; height: 24px; }

.shuffle-btn.active {
    color: var(--accent-blue);
    background: rgba(92, 184, 255, 0.15);
}

.shuffle-btn.active svg {
    filter: drop-shadow(0 0 4px var(--accent-blue));
}

.play-pause-btn {
    width: 64px;
    height: 64px;
    background: var(--gradient-sky);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(92, 184, 255, 0.3);
}

.play-pause-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(92, 184, 255, 0.4);
}

.play-pause-btn svg {
    fill: var(--bg-deep);
    width: 28px;
    height: 28px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-blue);
    border-radius: 50%;
    cursor: pointer;
}

.ios-volume-notice {
    display: none;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.is-ios .volume-control {
    display: none;
}

.is-ios .ios-volume-notice {
    display: flex;
    align-items: center;
    gap: 6px;
}

.playlist-section { animation: fadeIn 0.8s ease-out 0.4s both; }

.playlist-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
}

.playlist-selector::-webkit-scrollbar {
    display: none;
}

.playlist-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.playlist-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.playlist-tab.active {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.playlist-tab-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(92, 184, 255, 0.15);
    border-radius: 10px;
    color: var(--accent-blue);
}

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

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.track-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.playlist {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.track-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.track-item:hover {
    background: var(--bg-hover);
    border-color: rgba(92, 184, 255, 0.25);
    transform: translateX(8px);
}

.track-item.active {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
}

.track-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.track-item.active .track-number span,
.track-item:hover .track-number span { display: none; }

.track-item.active .track-number::after,
.track-item:hover .track-number::after {
    content: '▶';
    color: var(--accent-blue);
    font-size: 0.75rem;
}

.track-item.active.playing .track-number::after {
    content: '♫';
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

.track-thumbnail {
    width: 48px;
    height: 48px;
    background: var(--gradient-sky);
    border-radius: 8px;
    flex-shrink: 0;
    opacity: 0.8;
}

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

.track-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-duration {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gradient-sky);
    color: var(--bg-deep);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(92, 184, 255, 0.4);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.share-modal.active {
    visibility: visible;
    opacity: 1;
}

.share-modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 28px;
    max-width: 360px;
    width: 90%;
    border: 1px solid rgba(92, 184, 255, 0.2);
    box-shadow: 0 0 40px rgba(92, 184, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.share-modal.active .share-modal-content {
    transform: scale(1);
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.share-modal-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.share-modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.share-song-name {
    color: var(--accent-blue);
    font-weight: 500;
    margin-bottom: 16px;
    font-size: 1rem;
}

.share-message-container {
    margin-bottom: 20px;
}

.share-message-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-deep);
    border: 1px solid rgba(92, 184, 255, 0.25);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.share-message-input::placeholder {
    color: var(--text-muted);
}

.share-message-input:focus {
    border-color: var(--accent-blue);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn-social {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn-social svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.share-btn-social:hover {
    transform: scale(1.1);
}

.share-btn-social.whatsapp {
    background: #25D366;
}

.share-btn-social.viber {
    background: #7360F2;
}

.share-btn-social.telegram {
    background: #0088cc;
}

.share-btn-social.facebook {
    background: #1877F2;
}

.share-btn-social.twitter {
    background: #000;
}

.share-btn-social.email {
    background: #EA4335;
}

.share-btn-social.copy {
    background: var(--accent-blue);
}

/* Share Button */
.track-share-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.track-share-btn:hover {
    color: var(--accent-blue);
    background: rgba(92, 184, 255, 0.15);
}

.track-share-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 640px) {
    .container { padding: 40px 16px; }
    .now-playing { padding: 24px; }
    .current-track-info { flex-direction: column; text-align: center; }
    .controls { flex-wrap: wrap; }
    .volume-control { margin: 16px auto 0; }
    .track-item { padding: 12px 16px; }
    .track-thumbnail { width: 40px; height: 40px; }
}
