/*
 * Mantis Music - A self-hosted artist discography player
 * Copyright (C) 2026 Martin Dougiamas
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
 */

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

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #1db954;
    --accent-hover: #1ed760;
    --border: #333;
    --shadow: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Subtle background texture from banner image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../../artist/banner.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: blur(40px) brightness(0.3);
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: border-color 0.3s ease;
}

.logo-group:hover .header-avatar {
    border-color: var(--accent);
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #b3b3b3 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-btn.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.rss-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    padding: 0.4rem;
    border-radius: 6px;
    transition: color 0.2s;
}

.rss-link:hover {
    color: #f8a100;
}

/* Hero Banner */
.hero-section {
    position: relative;
    height: 340px;
    background-image: url('../../artist/banner.png');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0.3) 0%,
        rgba(10, 10, 10, 0.6) 60%,
        var(--bg-primary) 100%
    );
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 2.5rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* Main */
.main {
    padding: 3rem 0;
    min-height: calc(100vh - 200px);
}

/* Pull main up to overlap hero fade */
.hero-section:not(.hidden) + .main {
    margin-top: -2rem;
}

/* About Section */
.about-section {
    margin-bottom: 4rem;
    animation: fadeIn 0.5s ease;
}

.about-banner {
    position: relative;
    height: 280px;
    background-size: cover;
    background-position: center;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

.about-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        var(--bg-secondary) 100%
    );
}

.about-profile {
    width: 270px;
    height: 270px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-secondary);
    display: block;
    margin: -35px auto 1.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.about-content {
    background: var(--bg-secondary);
    padding: 0 3rem 3rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, #b3b3b3 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.about-content .streaming-links {
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Controls */
.controls-section {
    margin-bottom: 3rem;
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.filter-row input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.filter-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.1);
}

.filter-row select {
    padding: 0.75rem 1.25rem;
    height: 46px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.filter-row select:hover {
    border-color: var(--accent);
}

.reset-btn {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Releases Section */
.releases-section {
    margin-bottom: 4rem;
    animation: fadeIn 0.5s ease;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-header .section-title {
    margin-bottom: 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.releases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Release Card */
.release-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    animation: fadeInUp 0.5s ease;
}

.release-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent);
}

.release-cover {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.release-info {
    padding: 1.5rem;
}

.release-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.release-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.release-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.release-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.tag-link {
    cursor: pointer;
}

.tag-link:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.track-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.track-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.track-number {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 25px;
}

.track-name {
    flex: 1;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.track-name:hover {
    color: var(--accent);
}

.track-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-content.large {
    max-width: 1200px;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

.modal-body {
    padding: 3rem;
}

/* Track Details */
.track-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.track-cover-container {
    flex-shrink: 0;
}

.track-cover {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.track-info h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.track-album {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.track-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.track-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.track-lyrics, .track-credits {
    margin-top: 2rem;
}

.track-lyrics h3, .track-credits h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.track-lyrics pre {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.credits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.credit-item {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.credit-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.credit-names {
    font-weight: 600;
    color: var(--text-primary);
}

/* Release Details */
.release-header {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
}

.release-header .release-cover-container {
    flex-shrink: 0;
}

.release-header .release-cover {
    width: 300px;
    height: 300px;
    border-radius: 12px;
}

.release-info h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.release-year {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.release-description {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.release-streaming {
    margin-top: 1.5rem;
}

.streaming-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.streaming-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.streaming-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.streaming-link svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
    transition: fill 0.3s ease;
}

.streaming-link:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.streaming-link:hover svg {
    fill: var(--text-primary);
}

.release-tracklist h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero-section {
        height: 200px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-content {
        padding-bottom: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .about-banner {
        height: 160px;
    }

    .about-profile {
        width: 180px;
        height: 180px;
        margin-top: -90px;
    }

    .about-content {
        padding: 0 1.5rem 2rem;
    }

    .about-content h2 {
        font-size: 2rem;
    }

    .nav {
        width: 100%;
        justify-content: center;
    }

    .nav-btn {
        flex: 1;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .releases-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .filter-row {
        flex-wrap: wrap;
    }

    .filter-row input {
        flex-basis: 100%;
    }

    .filter-row select {
        flex: 1;
    }

    .track-header, .release-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .track-cover, .release-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .modal-body {
        padding: 2rem 1.5rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 35px;
        height: 35px;
    }

    .about-content {
        padding: 2rem;
    }

    .about-content h2 {
        font-size: 2rem;
    }



    /* Detail page responsive */
    .detail-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .detail-cover {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 300px;
        margin: 0 auto;
    }

    .detail-info h1 {
        font-size: 2rem;
        text-align: center;
    }

    .detail-year,
    .detail-description {
        text-align: center;
    }

    .detail-meta {
        justify-content: center;
    }

    .detail-tags {
        justify-content: center;
    }

    .detail-streaming {
        text-align: center;
    }

    .streaming-links {
        justify-content: center;
    }

    .single-controls {
        justify-content: center;
    }

    /* Extra bottom padding for taller mobile player */
    .main {
        padding-bottom: 140px;
    }

    /* Queue popup responsive */
    .queue-popup {
        position: fixed;
        bottom: 110px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .queue-notification {
        bottom: 120px;
        left: 20px;
        right: 20px;
        transform: none;
        text-align: center;
    }

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

/* Detail Page */
.detail-section {
    animation: fadeIn 0.3s ease;
    position: relative;
}

.detail-gradient {
    position: absolute;
    top: -3rem;
    left: -2rem;
    right: -2rem;
    height: 550px;
    z-index: -1;
    pointer-events: none;
    transition: background 0.5s ease;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.detail-header {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
}

.detail-cover {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.detail-info {
    flex: 1;
}

.detail-info h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.detail-year {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.detail-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.detail-streaming {
    margin-top: 1.5rem;
}

.detail-tracklist h2,
.detail-lyrics h2,
.detail-credits h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.detail-tracklist {
    margin-top: 2rem;
}

.tracklist-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tracklist-header h2 {
    margin-bottom: 0;
}

.tracklist-header .queue-all-btn {
    margin-bottom: 0;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
}

.detail-lyrics pre {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 1rem;
}

.detail-credits {
    margin-top: 2rem;
}

/* Track Play Button */
.track-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

/* Single Controls (for single-track releases) */
.single-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
}

.single-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

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

.single-play-btn.playing-now {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: default;
    border: 1px solid var(--border);
}

.single-play-btn.playing-now:hover {
    background: var(--bg-tertiary);
    transform: none;
}

.single-queue-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.single-queue-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.single-download-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.single-download-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.single-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Lyrics Section */
.detail-lyrics-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.detail-lyrics-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.lyrics-text {
    font-family: inherit;
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Track Meta Line */
.track-meta-line {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* Appears On Section */
.track-appears-on-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.track-appears-on-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.track-appears-on {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.appears-on-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.appears-on-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

.appears-on-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.appears-on-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.appears-on-title {
    font-weight: 600;
    color: var(--text-primary);
}

.appears-on-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Credits Section */
.detail-credits-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.detail-credits-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.credit-item {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.credit-role {
    color: var(--text-primary);
    font-weight: 500;
}

.credit-people {
    color: var(--text-secondary);
}

/* Player Bar */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.player-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
    flex: 1.5;
}

.player-cover,
.player-title,
.player-artist {
    cursor: pointer;
}

.player-title:hover,
.player-artist:hover {
    color: var(--accent);
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.player-text {
    overflow: hidden;
}

.player-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.player-btn:hover {
    background: var(--bg-tertiary);
}

.player-btn.play-btn {
    width: 48px;
    height: 48px;
    background: var(--accent);
    font-size: 1.2rem;
}

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

.player-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 2;
    max-width: 600px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.progress-bar:hover .progress-fill {
    background: var(--accent-hover);
}

.time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.volume-icon {
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: 2px;
    cursor: pointer;
}

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

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

/* Track Queue Button */
.track-queue-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.track-queue-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Card Queue Button */
.release-cover-container {
    position: relative;
}

.card-btn-group {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.release-card:hover .card-btn-group {
    opacity: 1;
    transform: translateY(0);
}

.card-play-btn,
.card-queue-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card-play-btn {
    background: var(--accent);
    color: white;
    font-size: 0.9rem;
}

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

.card-queue-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.2rem;
    border: 1px solid var(--border);
}

.card-queue-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

/* Play All Button */
.play-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    width: fit-content;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 50px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.play-all-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: scale(1.03);
}

/* Queue All Button */
.queue-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.queue-all-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Player Mode Button */
.player-mode {
    display: flex;
    align-items: center;
}

.mode-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.5;
}

.mode-btn:hover {
    background: var(--bg-tertiary);
    opacity: 0.8;
}

.mode-btn.active {
    opacity: 1;
}

.mode-btn.active svg {
    fill: var(--accent);
}

.mode-btn.active:hover svg {
    fill: var(--accent-hover);
}

/* Player Queue Section */
.player-queue {
    position: relative;
}

.queue-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.queue-btn:hover {
    background: var(--accent);
}

.queue-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Queue Popup */
.queue-popup {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    z-index: 1001;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.queue-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.clear-queue-btn {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-queue-btn:hover {
    background: #ff4444;
    border-color: #ff4444;
    color: white;
}

.queue-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 0.5rem;
}

.queue-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
    margin: 0;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.queue-item:hover {
    background: var(--bg-tertiary);
}

.queue-item-info {
    flex: 1;
    overflow: hidden;
}

.queue-item-title {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-controls {
    display: flex;
    gap: 0.25rem;
    margin-left: 0.5rem;
}

.queue-control-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.queue-control-btn:hover:not(:disabled) {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.queue-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.queue-control-btn.remove:hover {
    background: #ff4444;
    color: white;
}

/* Queue Notification */
.queue-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.4);
    z-index: 1002;
    animation: slideUpFade 0.3s ease;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Adjust main content to account for player bar */
.main {
    padding-bottom: 100px;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Mobile player - must be at the end to override base player styles */
@media (max-width: 768px) {
    .player-bar {
        padding: 0.5rem 1rem;
    }

    .player-content {
        display: grid;
        grid-template-columns: 1fr auto auto auto;
        grid-template-rows: auto auto;
        gap: 0.4rem 0.5rem;
        align-items: center;
    }

    /* Row 1: track info (left), playback controls (right) */
    .player-track-info {
        grid-row: 1;
        grid-column: 1 / 3;
        min-width: 0;
        flex: unset;
    }

    .player-controls {
        grid-row: 1;
        grid-column: 3 / 5;
        justify-self: end;
    }

    /* Row 2: progress bar, mode, queue */
    .player-progress {
        grid-row: 2;
        grid-column: 1 / 3;
        display: flex;
        flex: unset;
        max-width: 100%;
        gap: 0.5rem;
    }

    .player-mode {
        grid-row: 2;
        grid-column: 3;
    }

    .player-queue {
        grid-row: 2;
        grid-column: 4;
        justify-self: end;
    }

    /* Hide volume on mobile */
    .player-volume {
        display: none !important;
    }

    .player-cover {
        width: 40px;
        height: 40px;
    }

    .player-title {
        font-size: 0.85rem;
    }

    .player-artist {
        font-size: 0.75rem;
    }

    .player-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .player-btn.play-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .main {
        padding-bottom: 140px;
    }

    /* Queue popup - anchor to right edge of screen */
    .queue-popup {
        position: fixed;
        bottom: 100px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}
