/* ==========================================
   Music Page - Now Playing Styles
   Integrated with main site theme
   ========================================== */

/* Groq Brand Font: Montserrat */
@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../assets/fonts/Montserrat/Montserrat-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

:root {
    --card-width-desktop: 480px;
}

/* Custom Scrollbar with Dynamic Colors */
.music-hero ::-webkit-scrollbar,
.recent-tracks ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.music-hero ::-webkit-scrollbar-track,
.recent-tracks ::-webkit-scrollbar-track {
    background: rgba(var(--bg-tertiary-rgb), 0.3);
    border-radius: var(--radius-md);
}

.music-hero ::-webkit-scrollbar-thumb,
.recent-tracks ::-webkit-scrollbar-thumb {
    background: var(--dynamic-scrollbar-color, rgba(var(--neon-gold-rgb), 0.5));
    border-radius: var(--radius-md);
    box-shadow: 0 0 10px var(--dynamic-glow-color, rgba(var(--neon-gold-rgb), 0.3));
    transition: all var(--spring-snappy);
}

.music-hero ::-webkit-scrollbar-thumb:hover,
.recent-tracks ::-webkit-scrollbar-thumb:hover {
    background: var(--dynamic-scrollbar-color-bright, rgba(var(--neon-gold-rgb), 0.8));
    box-shadow: 0 0 15px var(--dynamic-glow-color, rgba(var(--neon-gold-rgb), 0.5));
}

/* Page scrollbar should follow the same dynamic music palette */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

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

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        var(--music-page-scrollbar-color-bright, var(--neon-gold)),
        var(--music-page-scrollbar-color, var(--neon-amber))
    );
    border-radius: var(--radius-full);
    box-shadow: 0 0 12px var(--music-page-scrollbar-glow, rgba(var(--neon-gold-rgb), 0.25));
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        var(--music-page-scrollbar-hover-color, var(--neon-amber)),
        var(--music-page-scrollbar-color-bright, var(--neon-cyan))
    );
}

.music-hero {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 2rem;
    position: relative;
    z-index: 1;
}

.music-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.split-content-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    width: 100%;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   Source Indicator Pills (Glassmorphic)
   Matches main site's social-badge style
   ========================================== */
.source-indicators {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.source-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    /* Glassmorphism - matches .social-badge from main.css */
    background: var(--bg-glass);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    border: 1px solid rgba(var(--neon-gold-rgb), var(--glass-border-opacity));
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--spring-snappy);
    /* Match header element opacity and shadow */
    opacity: 1;
    box-shadow: var(--drop-shadow-deep), var(--drop-shadow-subtle);
}

.source-pill:hover {
    background: var(--bg-card);
    border-color: var(--border-color-hover);
    box-shadow: 0 8px 30px rgba(var(--neon-gold-rgb), 0.15);
    transform: translateY(-2px);
}

.source-pill svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.source-pill .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all var(--spring-snappy);
    will-change: transform, opacity;
}

/* Active source state */
.source-pill.active {
    color: var(--text-primary);
}

.source-pill.active .status-dot {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Source-specific active colors */
.source-pill[data-source="lastfm"].active {
    border-color: rgba(var(--netflix-red-rgb), 0.5);
    box-shadow: var(--drop-shadow-deep), 
                0 0 25px rgba(var(--netflix-red-rgb), 0.4),
                0 0 40px rgba(var(--netflix-red-rgb), 0.2);
}

.source-pill[data-source="lastfm"].active .status-dot {
    background: var(--netflix-red);
    box-shadow: 0 0 15px rgba(var(--netflix-red-rgb), 0.9),
                0 0 25px rgba(var(--netflix-red-rgb), 0.6);
}

.source-pill[data-source="spotify"].active {
    border-color: rgba(var(--spotify-green-rgb), 0.5);
    box-shadow: var(--drop-shadow-deep), 
                0 0 25px rgba(var(--spotify-green-rgb), 0.4),
                0 0 40px rgba(var(--spotify-green-rgb), 0.2);
}

.source-pill[data-source="spotify"].active .status-dot {
    background: var(--spotify-green);
    box-shadow: 0 0 15px rgba(var(--spotify-green-rgb), 0.9),
                0 0 25px rgba(var(--spotify-green-rgb), 0.6);
}



/* Connected but not playing state */
.source-pill.connected {
    opacity: 0.85;
    border-color: rgba(var(--neon-cyan-rgb), 0.3);
}

.source-pill.connected .status-dot {
    background: var(--neon-cyan);
    box-shadow: 0 0 6px rgba(var(--neon-cyan-rgb), 0.5);
}

/* Spotify connected = GREEN (it's providing enrichment data) */
.source-pill[data-source="spotify"].connected {
    border-color: rgba(var(--spotify-green-rgb), 0.3);
}

.source-pill[data-source="spotify"].connected .status-dot {
    background: var(--spotify-green);
    box-shadow: 0 0 8px rgba(var(--spotify-green-rgb), 0.5);
}

@keyframes pulse-dot {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.7;
    }
}

/* ==========================================
   Now Playing Card - Enhanced
   ========================================== */
.now-playing-card {
    position: relative;
    width: 100%;
    background:
        radial-gradient(circle at 18% 0%, var(--dynamic-surface-a, rgba(var(--neon-gold-rgb), 0.16)), transparent 48%),
        radial-gradient(circle at 92% 100%, var(--dynamic-surface-b, rgba(var(--neon-cyan-rgb), 0.14)), transparent 52%),
        rgba(var(--bg-tertiary-rgb), 0.34);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    border: 1px solid var(--dynamic-border-color, rgba(var(--neon-gold-rgb), var(--glass-border-opacity)));
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--dynamic-glow-color, rgba(var(--neon-gold-rgb), 0.15));
    transition: all var(--spring-smooth);
    /* Promote to layer to avoid re-rendering backdrop filter on child animation */
    transform: translateZ(0);
}

.now-playing-card:hover {
    background: rgba(var(--bg-tertiary-rgb), 0.4);
    border-color: rgba(var(--neon-gold-rgb), 0.3);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.5),
        0 0 50px var(--dynamic-glow-color, rgba(var(--neon-gold-rgb), 0.25));
}

/* Card should remain static on hover for the music page */

/* Artist Backdrop (blurred background) */
.artist-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(50px) brightness(0.52) saturate(1.55);
    opacity: 0;
    transition: opacity var(--spring-smooth), background-image 1s ease-in-out;
    z-index: 0;
    /* Hardware acceleration for the massive blur */
    transform: translateZ(0);
}

.artist-backdrop.loaded {
    opacity: 0.92;
}

.card-content {
    position: relative;
    z-index: 1;
    padding: var(--space-lg);
}

/* Album Art Section */
.album-art-section {
    position: relative;
    margin-bottom: var(--space-lg);
}

.album-art-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.album-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity var(--spring-smooth);
}

.album-art.loaded {
    opacity: 1;
}

.album-art-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--neon-gold-rgb), 0.1), rgba(var(--neon-cyan-rgb), 0.1));
    transition: opacity var(--spring-smooth);
}

.album-art-placeholder svg {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    opacity: 0.5;
}

.album-art.loaded+.album-art-placeholder {
    opacity: 0;
    pointer-events: none;
}

/* Artist Thumbnail (circular, overlapping album art) */
.artist-thumbnail {
    position: absolute;
    bottom: -16px;
    right: 16px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 3px solid rgba(var(--bg-tertiary-rgb), 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--spring-bouncy);
}

.artist-thumbnail.loaded {
    opacity: 1;
    transform: scale(1);
}

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

/* Playing Indicator (Sound Bars) */
.playing-indicator {
    position: absolute;
    bottom: var(--space-md);
    left: var(--space-md);
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity var(--spring-snappy);
}

.playing-indicator.active {
    opacity: 1;
}

.playing-indicator span {
    width: 3px;
    background: var(--neon-gold);
    border-radius: 2px;
    animation: soundBar 0.8s ease-in-out infinite;
    will-change: transform;
}

.playing-indicator span:nth-child(1) {
    height: 8px;
    animation-delay: 0s;
}

.playing-indicator span:nth-child(2) {
    height: 14px;
    animation-delay: 0.2s;
}

.playing-indicator span:nth-child(3) {
    height: 10px;
    animation-delay: 0.4s;
}

@keyframes soundBar {

    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1);
    }
}

/* Track Info */
.track-info {
    text-align: center;
    margin-bottom: var(--space-md);
    padding-top: var(--space-sm);
}

.track-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.artist-name {
    font-size: var(--text-base);
    color: var(--neon-amber);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.album-name {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-style: italic;
}

/* Track Meta */
.track-meta {
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.listening-status {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.listening-status.now-playing {
    color: var(--spotify-green);
}

.spotify-code-link {
    display: block;
    margin-top: var(--space-xs);
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--spring-smooth);
    max-width: 160px;
}

.spotify-code-link.has-code {
    opacity: 0.8;
    transform: translateY(0);
}

.spotify-code-link.has-code:hover {
    opacity: 1;
    transform: scale(1.05);
}

.spotify-code-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   Loading States
   ========================================== */
@keyframes loadingPulse {
    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.9;
    }
}

.music-hero.is-loading .album-art-placeholder,
.music-hero.is-loading .recent-tracks li.loading-item {
    animation: loadingPulse 1.6s ease-in-out infinite;
}

.music-hero.is-loading .playing-indicator {
    opacity: 0;
}

.recent-tracks li.loading-item {
    background: rgba(var(--bg-tertiary-rgb), 0.35);
    border-color: rgba(var(--neon-gold-rgb), 0.1);
}

.recent-tracks li.loading-item .track-thumb {
    background: linear-gradient(135deg, rgba(var(--neon-gold-rgb), 0.2), rgba(var(--neon-gold-rgb), 0.05));
    border-radius: var(--radius-sm);
}

.recent-tracks li.loading-item .track-details .name,
.recent-tracks li.loading-item .track-details .artist,
.recent-tracks li.loading-item .track-time {
    color: transparent;
}

/* ==========================================
   Recent Tracks
   ========================================== */
.recent-tracks {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: var(--space-lg);
    background:
        radial-gradient(circle at 12% 0%, var(--dynamic-surface-a, rgba(var(--neon-gold-rgb), 0.14)), transparent 46%),
        radial-gradient(circle at 88% 100%, var(--dynamic-surface-b, rgba(var(--neon-cyan-rgb), 0.12)), transparent 52%),
        rgba(var(--bg-tertiary-rgb), 0.34);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    border: 1px solid var(--dynamic-border-color, rgba(var(--neon-gold-rgb), var(--glass-border-opacity)));
    border-radius: var(--radius-xl);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--dynamic-glow-color, rgba(var(--neon-gold-rgb), 0.15));
    transition: all var(--spring-smooth);
}

.recent-tracks-header,
.recent-tracks ul {
    position: relative;
    z-index: 1;
}

.recent-tracks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.recent-tracks-title {
    font-size: var(--text-sm);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.recent-tracks-badge {
    font-size: 0.65rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(var(--neon-gold-rgb), 0.1);
    border: 1px solid rgba(var(--neon-gold-rgb), 0.2);
    color: var(--text-muted);
    font-weight: 600;
    opacity: 0.8;
}

.recent-tracks ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
}

.recent-tracks li {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0; /* Remove padding to handle it within the link */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    transition: all var(--spring-snappy);
    width: 100%;
    cursor: pointer;
    overflow: hidden;
}

.recent-tracks li:hover {
    background: rgba(var(--bg-tertiary-rgb), 0.6);
    border-color: rgba(var(--neon-gold-rgb), 0.3);
    transform: translateX(4px);
}

.recent-tracks .track-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.recent-tracks .track-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.recent-tracks .track-details {
    flex: 1;
    min-width: 0;
}

.recent-tracks .track-details .name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-tracks .track-details .artist {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-tracks .track-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ==========================================
   AI Summary Card
   ========================================== */
.ai-summary-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Max width matches the two cards above (480px * 2) + gap (var(--space-2xl)) */
    max-width: calc(480px * 2 + var(--space-2xl));
    margin: 0 auto;
    
    background:
        radial-gradient(circle at 16% 0%, var(--dynamic-surface-a, rgba(var(--neon-gold-rgb), 0.14)), transparent 48%),
        radial-gradient(circle at 90% 100%, var(--dynamic-surface-b, rgba(var(--neon-cyan-rgb), 0.12)), transparent 54%),
        rgba(var(--bg-tertiary-rgb), 0.34);
    -webkit-backdrop-filter: var(--glass-filter);
    backdrop-filter: var(--glass-filter);
    border: 1px solid var(--dynamic-border-color, rgba(var(--neon-gold-rgb), var(--glass-border-opacity)));
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px var(--dynamic-glow-color, rgba(var(--neon-gold-rgb), 0.15));
    transition: all var(--spring-smooth);
}

/* Header, Body, Footer need to be relative to stay above backdrop */
.ai-summary-header,
.ai-summary-body,
.ai-summary-footer {
    position: relative;
    z-index: 1;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.ai-summary-title {
    font-size: var(--text-sm);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.ai-summary-badge {
    font-size: 0.65rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(var(--neon-cyan-rgb), 0.15);
    border: 1px solid rgba(var(--neon-cyan-rgb), 0.35);
    color: var(--neon-cyan);
    font-weight: 600;
}

.ai-summary-body {
    min-height: 72px;
    position: relative;
}

.ai-summary-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-primary);
    margin: 0;
    white-space: pre-wrap;
}

.ai-summary-text::before,
.ai-summary-text::after {
    color: var(--text-muted);
    opacity: 0.7;
}

.ai-summary-text::before {
    content: '" ';
}

.ai-summary-text::after {
    content: ' "';
}

.ai-summary-loading {
    font-size: 0.9rem;
    color: var(--text-muted);
    opacity: 0.8;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(120deg, rgba(var(--bg-tertiary-rgb), 0.2), rgba(var(--neon-gold-rgb), 0.08), rgba(var(--bg-tertiary-rgb), 0.2));
    border-radius: var(--radius-lg);
    animation: aiLoadingPulse 1.8s ease-in-out infinite;
}

.ai-summary-card.is-loading .ai-summary-text {
    opacity: 0;
}

.ai-summary-card.is-loading .ai-summary-text::before,
.ai-summary-card.is-loading .ai-summary-text::after {
    content: '';
}

.ai-summary-card:not(.is-loading) .ai-summary-loading {
    display: none;
}

.ai-summary-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: var(--space-md);
    color: var(--text-muted);
    font-family: 'Montserrat', sans-serif; /* Brand font for Groq attribution */
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.ai-summary-powered {
    /* Slight fade for the "Powered by" text to prioritize trademark */
    opacity: 0.8;
}

.groq-logo {
    display: block;
    height: 14px; /* Scaled to look elegant with Montserrat */
    width: auto;
    transition: filter 0.5s ease;
    will-change: filter;
}

/* Use data attribute from app.js to switch logos based on card backdrop brightness */
.ai-summary-card[data-light-mode="true"] .groq-logo {
    content: url('../assets/icons/groq-black.svg');
}

.ai-summary-card[data-light-mode="false"] .groq-logo {
    content: url('../assets/icons/groq-white.svg');
}

@media (max-width: 900px) {
    .ai-summary-card,
    .recent-tracks {
        max-width: 420px;
        padding: var(--space-md);
    }

    .ai-summary-body {
        min-height: 56px;
    }

    .ai-summary-text {
        font-size: 0.95rem;
        line-height: 1.55;
    }
}

.ai-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(4px) scale(0.96);
    animation: aiCharPop 0.32s ease-out forwards;
}

@keyframes aiCharPop {
    0% {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    70% {
        opacity: 1;
        transform: translateY(0) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes aiLoadingPulse {
    0% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        opacity: 0.5;
    }
}

/* ==========================================
   Responsive
   ========================================== */
/* ==========================================
   Immersive Background
   ========================================== */
.immersive-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: var(--bg-primary);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Massive blur for the "universal" feel */
    filter: blur(80px) brightness(0.52) saturate(1.55);
    /* Scale up slightly to hide blurred edges */
    transform: scale(1.2) translateZ(0);
    opacity: 0;
    transition: opacity 1.5s ease, background-image 2s ease-in-out;
    pointer-events: none;
    will-change: opacity, background-image;
}

.immersive-bg.loaded {
    opacity: 0.5;
}

/* Mobile adjustments */
@media (max-width: 899px) {
    .now-playing-card, 
    .recent-tracks, 
    .ai-summary-card {
        max-width: 420px;
    }
}

@media (max-width: 600px) {
    .music-hero {
        min-height: 100dvh;
        padding: 7rem 1.25rem;
    }

    .now-playing-card {
        width: min(100%, 360px);
    }

    .recent-tracks {
        width: min(100%, 360px);
    }

    .card-content {
        padding: var(--space-md);
    }

    .track-name {
        font-size: var(--text-xl);
    }

    .artist-thumbnail {
        width: 56px;
        height: 56px;
        bottom: -12px;
        right: 12px;
    }

    .source-pill span {
        display: none;
    }

    .source-pill {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 12px;
    }

    .source-pill svg {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================
   Desktop Layout Consolidation & Morph Points
   ========================================== */
@media (min-width: 900px) {
    .split-content-row {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        gap: var(--space-2xl);
    }

    /* Column Consistency */
    .now-playing-card, 
    .recent-tracks {
        flex: 1;
        max-width: var(--card-width-desktop);
        width: 100%;
        margin-top: 0;
        display: flex;
        flex-direction: column;
    }

    .card-content, .recent-tracks {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Fixed alignment for AI Card: card1.width + card2.width + gap */
    .ai-summary-card {
        max-width: calc(var(--card-width-desktop) * 2 + var(--space-2xl));
        margin: 0 auto;
    }

    .artist-thumbnail {
        width: 100px;
        height: 100px;
        bottom: -25px;
        right: 25px;
    }

    .recent-tracks-header {
        margin-bottom: var(--space-lg);
    }
}
