/* ============================================
   Corporate Memphis / Professional Style
   Warm tones, flat geometry, friendly shapes
   ============================================ */

body {
    overflow-x: hidden;
    position: relative;
}

/* ---- Background decoration ---- */
.memphis-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--amber);
    top: -120px;
    right: -100px;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--sky);
    bottom: -80px;
    left: -80px;
    animation: blobFloat 25s ease-in-out infinite reverse;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--lavender);
    top: 50%;
    left: 60%;
    animation: blobFloat 18s ease-in-out infinite 5s;
}

.grid-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(26, 26, 46, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ---- Container ---- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    position: relative;
}

/* ---- Header ---- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.logo-text span {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.pill-btn:hover {
    border-color: var(--sky);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.pill-btn .icon-sm {
    opacity: 0.7;
}

.pill-label {
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-secondary);
}

.pill-btn--danger {
    padding: 10px 14px;
}

.pill-btn--danger:hover {
    border-color: var(--coral);
    background: var(--accent-soft);
}

.pill-btn--danger:hover .icon-sm {
    filter: brightness(0) saturate(100%) invert(40%) sepia(80%) saturate(2000%) hue-rotate(340deg) brightness(90%) contrast(100%);
}

/* ---- IP Warning ---- */
.ip-warning-banner {
    display: none;
    background: #FFF8E1;
    border: 2px solid var(--amber);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 32px;
    align-items: flex-start;
    gap: 16px;
}

.ip-warning-banner.show {
    display: flex;
}

.ip-warning-icon-wrap {
    width: 40px;
    height: 40px;
    background: var(--amber);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ip-warning-icon {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

.ip-warning-content { flex: 1; }

.ip-warning-title {
    font-weight: 700;
    color: #B8860B;
    margin-bottom: 4px;
    font-size: 0.95em;
}

.ip-warning-text {
    color: var(--text-secondary);
    font-size: 0.85em;
    line-height: 1.5;
}

.ip-warning-text code {
    background: rgba(26, 26, 46, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9em;
    color: var(--text-primary);
}

.ip-warning-dismiss {
    width: 32px;
    height: 32px;
    background: rgba(26, 26, 46, 0.04);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ip-warning-dismiss:hover {
    background: rgba(26, 26, 46, 0.08);
}

.ip-warning-dismiss img {
    width: 16px;
    height: 16px;
    filter: brightness(0);
    opacity: 0.4;
}

/* ---- Feedback panel ---- */
.feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.2);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.feedback-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.feedback-panel {
    position: fixed;
    left: -440px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 2px solid var(--border);
    z-index: 1000;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 36px 32px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.feedback-panel.open {
    left: 0;
}

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

.feedback-header h2 {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
}

.feedback-close {
    width: 36px;
    height: 36px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-close:hover {
    background: rgba(26, 26, 46, 0.08);
    transform: scale(1.05);
}

.feedback-subtitle {
    color: var(--text-tertiary);
    font-size: 0.92em;
    margin-bottom: 28px;
    line-height: 1.5;
}

.feedback-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 0;
}

.feedback-success.show { display: flex; }

.feedback-success-icon {
    width: 56px;
    height: 56px;
    filter: brightness(0) saturate(100%) invert(65%) sepia(40%) saturate(500%) hue-rotate(100deg);
}

.feedback-success p {
    margin-top: 16px;
    font-size: 1.15em;
    color: var(--mint);
    font-weight: 600;
}

/* ---- Main Player Card ---- */
.player-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 48px;
    animation: cardEnter 0.6s ease-out;
}

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

.player-card__inner {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
}

.album-section {
    padding: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    position: relative;
}

.album-frame {
    position: relative;
    width: 100%;
    max-width: 310px;
}

.album-frame__deco {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    z-index: 0;
}

.album-frame__deco--tl {
    top: -12px;
    left: -12px;
    background: var(--amber);
    opacity: 0.6;
}

.album-frame__deco--br {
    bottom: -12px;
    right: -12px;
    background: var(--sky);
    opacity: 0.5;
}

.album-art {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    object-fit: cover;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
    border: 3px solid #fff;
}

.album-art:hover {
    transform: scale(1.02) rotate(-0.5deg);
}

.info-section {
    padding: 40px 44px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    justify-content: center;
}

/* Now playing badge */
.now-playing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 10px;
    background: var(--accent-soft);
    color: var(--coral);
    border-radius: var(--radius-full);
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    width: fit-content;
}

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

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

/* Track info */
.track-info h1 {
    font-size: 2.4em;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.track-info .artist {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.album-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.track-info .album {
    font-size: 0.95em;
    color: var(--text-tertiary);
    font-style: italic;
}

.track-info .year {
    font-size: 0.88em;
    color: var(--text-tertiary);
}

/* Visualizer */
.visualizer-container {
    width: 100%;
    height: 80px;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    border: 2px solid var(--border);
}

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

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.play-btn {
    width: 64px;
    height: 64px;
    background: var(--coral);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(235, 87, 87, 0.35);
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(235, 87, 87, 0.4);
}

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

.play-btn.playing {
    background: var(--text-primary);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.25);
}

.play-btn img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-subtle);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.volume-btn:hover {
    background: #fff;
    border-color: var(--sky);
}

.volume-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0);
    opacity: 0.5;
}

.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.volume-control:hover .volume-slider-container {
    opacity: 1;
    pointer-events: all;
}

.volume-slider {
    width: 110px;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border);
}

.volume-slider-fill {
    height: 100%;
    background: var(--sky);
    border-radius: var(--radius-full);
    width: 100%;
    position: relative;
}

.volume-slider-thumb {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--sky);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease;
}

.volume-slider:hover .volume-slider-thumb {
    transform: translateY(-50%) scale(1.15);
}

.volume-percentage {
    font-size: 0.82em;
    color: var(--text-tertiary);
    min-width: 36px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ---- Lyrics toggle button ---- */
.lyrics-toggle-btn {
    width: 44px;
    height: 44px;
    background: #FFFFFF;
    border: 2px solid rgba(26, 26, 46, 0.12);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.06);
}

.lyrics-toggle-btn:hover {
    background: #F5EDE3;
    border-color: #BB6BD9;
    box-shadow: 0 2px 12px rgba(187, 107, 217, 0.15);
    transform: scale(1.05);
}

.lyrics-toggle-btn.active {
    background: #BB6BD9;
    border-color: #BB6BD9;
    box-shadow: 0 4px 14px rgba(187, 107, 217, 0.35);
}

.lyrics-toggle-btn.active img {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

.lyrics-toggle-btn img {
    width: 22px;
    height: 22px;
    filter: brightness(0);
    opacity: 0.55;
}

/* ---- Lyrics Panel (fixed side panel, slides in from right) ---- */
.lyrics-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.2);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lyrics-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.lyrics-card {
    position: fixed;
    right: -440px;
    top: 0;
    width: 420px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 2px solid var(--border);
    z-index: 1000;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.lyrics-card.show {
    right: 0;
}

.lyrics-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 36px 32px 20px;
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.lyrics-card__header h3 {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.lyrics-card__close {
    width: 36px;
    height: 36px;
    background: var(--bg-subtle);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.lyrics-card__close img {
    width: 20px;
    height: 20px;
    filter: brightness(0);
    opacity: 0.75;
}

.lyrics-card__close:hover {
    background: rgba(26, 26, 46, 0.08);
    transform: scale(1.05);
}

.lyrics-card__close:hover img {
    opacity: 1;
}

.lyrics-card__body {
    padding: 24px 32px 32px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 26, 46, 0.12) transparent;
}

.lyrics-card__body::-webkit-scrollbar {
    width: 6px;
}

.lyrics-card__body::-webkit-scrollbar-track {
    background: transparent;
}

.lyrics-card__body::-webkit-scrollbar-thumb {
    background: rgba(26, 26, 46, 0.12);
    border-radius: 3px;
}

/* Lyrics states */
.lyrics-state {
    text-align: center;
    padding: 28px 0;
}

.lyrics-state p {
    color: #9494A8;
    font-size: 0.95em;
    font-style: italic;
    margin: 0;
}

#lyrics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.lyrics-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #F5EDE3;
    border-top-color: #BB6BD9;
    border-radius: 50%;
    animation: lyricsSpin 0.8s linear infinite;
}

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

/* Lyrics text content */
#lyrics-content .lyrics-line {
    font-size: 1em;
    line-height: 2;
    color: #5C5C76;
    margin: 0;
    padding: 0;
    transition: color 0.15s;
}

#lyrics-content .lyrics-line:hover {
    color: #1A1A2E;
}

#lyrics-content .lyrics-line--empty {
    height: 16px;
    line-height: 16px;
}

/* ---- History ---- */
.history-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-card);
    animation: cardEnter 0.6s ease-out 0.15s both;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.history-header h2 {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.history-decoration {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--amber) 0%, var(--coral) 33%, var(--lavender) 66%, var(--sky) 100%);
    opacity: 0.4;
}

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

.history-item {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    cursor: default;
}

.history-item:hover {
    background: #fff;
    border-color: var(--border);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.history-item__art-wrap {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.history-item__art-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-meta {
    flex: 1;
    min-width: 0;
}

.history-meta .title {
    font-weight: 700;
    font-size: 0.95em;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.history-meta .artist {
    color: var(--text-secondary);
    font-size: 0.88em;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.history-meta .album {
    color: var(--text-tertiary);
    font-size: 0.82em;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Footer ---- */
.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 0 20px;
    color: var(--text-tertiary);
    font-size: 0.82em;
    font-weight: 500;
}

.footer-dot {
    width: 4px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: 50%;
    opacity: 0.5;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
    .player-card__inner {
        grid-template-columns: 1fr;
    }

    .album-section {
        padding: 28px;
    }

    .album-frame {
        max-width: 260px;
    }

    .info-section {
        padding: 28px 28px 36px;
    }

    .track-info h1 {
        font-size: 1.8em;
    }

    .history-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 20px 16px 40px;
    }

    header {
        margin-bottom: 32px;
    }
}

@media (max-width: 600px) {
    .feedback-panel {
        width: 100%;
        left: -100%;
    }

    .lyrics-card {
        width: 100%;
        right: -100%;
    }

    .pill-label {
        display: none;
    }

    .pill-btn {
        padding: 10px 14px;
    }

    .ip-warning-banner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        position: relative;
        padding-top: 28px;
    }

    .ip-warning-dismiss {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .track-info h1 {
        font-size: 1.5em;
    }

    .album-frame__deco { display: none; }
}
