/* Spotify Page Styles */
.spotify-page {
    min-height: 100vh;
    padding-top: 80px;
}

.spotify-heading {
    text-align: center;
    padding: 40px 20px 20px;
}

.spotify-heading h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Auth Section */
.spotify-auth {
    text-align: center;
    padding: 60px 20px;
}

.spotify-auth .btn-spotify {
    background-color: #1DB954;
    border-color: #1DB954;
    color: #fff;
    padding: 12px 32px;
    font-size: 1.1rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.spotify-auth .btn-spotify:hover {
    background-color: #1ed760;
    transform: scale(1.05);
}

/* Sections */
.spotify-section {
    margin-bottom: 40px;
    padding: 0 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bs-border-color);
}

.section-header h3 {
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header .icon {
    font-size: 1.6rem;
}

/* Playlist Grid */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.playlist-card {
    background: var(--bs-card-bg, var(--bs-body-bg));
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.playlist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.playlist-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.playlist-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-tracks-count {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* Track List */
.track-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
    gap: 12px;
}

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

.track-item.playing {
    background: rgba(29, 185, 84, 0.1);
}

.track-number {
    width: 24px;
    text-align: center;
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
}

.track-item.playing .track-number {
    color: #1DB954;
}

.track-cover {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

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

.track-name {
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.track-duration {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Artist Grid */
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.artist-card {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.artist-card:hover {
    background: var(--bs-tertiary-bg);
}

/* 歌手头像和文字样式，补充缺失的选择器 */
.artist-image {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.artist-name {
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-genres {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

/* Genre Pills */
.genre-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.genre-pill {
    background: linear-gradient(135deg, #1DB954 0%, #191414 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Playlist Detail Modal/View -> 改为抽屉/底部弹层通用容器 */
.playlist-detail {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none; /* 通过 is-visible 控制 */
    background: rgba(0, 0, 0, 0.35); /* 遮罩层 */
    backdrop-filter: blur(2px);
}

.playlist-detail.is-visible {
    display: block;
}

/* 内部面板，桌面端默认右侧抽屉 */
.playlist-detail-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 90vw);
    background: var(--bs-body-bg);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.25);
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.playlist-detail.is-open .playlist-detail-panel {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

/* 保留原有 header 样式，但改为相对 panel 布局 */
.playlist-detail-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 24px 20px 20px;
    background: linear-gradient(180deg, rgba(29, 185, 84, 0.3) 0%, transparent 100%);
    flex-shrink: 0;
}

.playlist-detail-cover {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.playlist-detail-info h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.playlist-detail-info .description {
    color: var(--bs-secondary-color);
    margin-bottom: 8px;
}

.playlist-detail-info .meta {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

/* 关闭按钮改为相对 panel 内定位 */
.playlist-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 列表区域在抽屉内滚动 */
.playlist-detail-body {
    flex: 1;
    overflow-y: auto;
}

/* 移动端：改为底部弹层 Bottom Sheet */
@media (max-width: 768px) {
    .playlist-detail-panel {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-height: 80vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
        transform: translateY(100%);
    }

    .playlist-detail.is-open .playlist-detail-panel {
        transform: translateY(0);
    }

    .playlist-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 28px;
    }

    .playlist-detail-cover {
        width: 140px;
        height: 140px;
    }

    /* Artist Grid */
    .artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .artist-image {
        width: 80px;
        height: 80px;
    }
}

/* Player Bar */
.spotify-player {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 0);
    width: calc(100% - 32px);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1040;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 24px;
}

@media (min-width: 576px) { .spotify-player { max-width: 540px; } }
@media (min-width: 768px) { .spotify-player { max-width: 720px; } }
@media (min-width: 992px) { .spotify-player { max-width: 960px; } }
@media (min-width: 1200px) { .spotify-player { max-width: 1140px; } }
@media (min-width: 1400px) { .spotify-player { max-width: 1320px; } }

/* 折叠时完全隐藏播放器，只保留顶部切换条高度（由 JS 控制文字） */
.spotify-player.collapsed {
    transform: translate(-50%, calc(100% + 28px));
}

.player-toggle {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    padding: 4px 20px;
    cursor: pointer;
    font-size: 0.8rem;
}

.player-content {
    padding: 16px 20px;
}

.player-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.player-track-cover {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    /* 为封面添加柔和的背景，避免空白或破图时太突兀 */
    background: radial-gradient(circle at 30% 30%, rgba(29, 185, 84, 0.45), rgba(25, 20, 20, 0.95));
}

.player-track-details {
    min-width: 0;
}

.player-track-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

.player-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--bs-body-color);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.player-btn.play-pause {
    background: #1DB954;
    color: #fff;
    font-size: 1.2rem;
    width: 48px;
    height: 48px;
}

.player-btn.play-pause:hover {
    background: #1ed760;
    transform: scale(1.05);
}

.player-btn.active {
    color: #1DB954;
}

.player-progress {
    margin-top: 12px;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

.progress-bar-fill {
    height: 100%;
    background: #1DB954;
    border-radius: 3px;
    width: 0;
    transition: width 0.1s linear;
}

.progress-bar-wrapper:hover .progress-bar-fill {
    background: #1ed760;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bs-tertiary-bg);
    border-radius: 3px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #1DB954;
    border-radius: 50%;
}

/* Player Queue */
.player-queue {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 16px;
    border-top: 1px solid var(--bs-border-color);
    padding-top: 12px;
}

.queue-header {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

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

.queue-item.current {
    background: rgba(29, 185, 84, 0.1);
}

/* Loading States */
.spotify-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
}

.spotify-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bs-border-color);
    border-top-color: #1DB954;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Skeleton Loaders */
.skeleton-playlist {
    background: var(--bs-tertiary-bg);
    border-radius: 12px;
    padding: 16px;
}

.skeleton-cover {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, var(--bs-tertiary-bg) 25%, var(--bs-secondary-bg) 50%, var(--bs-tertiary-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
    margin-bottom: 12px;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, var(--bs-tertiary-bg) 25%, var(--bs-secondary-bg) 50%, var(--bs-tertiary-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }

    .artist-image {
        width: 80px;
        height: 80px;
    }

    .playlist-detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .playlist-detail-cover {
        width: 160px;
        height: 160px;
    }

    .player-main {
        flex-wrap: wrap;
    }

    .player-volume {
        display: none;
    }

    .player-queue {
        max-height: 150px;
    }
}

/* Tabs */
.spotify-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.spotify-tab {
    padding: 8px 20px;
    border: 1px solid var(--bs-border-color);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.spotify-tab:hover {
    background: var(--bs-tertiary-bg);
}

.spotify-tab.active {
    background: #1DB954;
    color: #fff;
    border-color: #1DB954;
}

/* Time Range Selector */
.time-range-selector {
    display: flex;
    gap: 8px;
}

.time-range-btn {
    padding: 4px 12px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.time-range-btn:hover {
    background: var(--bs-tertiary-bg);
}

.time-range-btn.active {
    background: #1DB954;
    color: #fff;
    border-color: #1DB954;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--bs-secondary-color);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* User Info */
.spotify-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bs-tertiary-bg);
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
}

.user-email {
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.btn-logout {
    margin-left: auto;
    padding: 6px 16px;
    border: 1px solid var(--bs-border-color);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-logout:hover {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
    color: #dc3545;
}

/* Artist drawer specific styles */
.artist-detail-panel .playlist-detail-header {
    align-items: flex-start;
}

.artist-detail-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.artist-genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.artist-genre-pill {
    background: var(--bs-tertiary-bg);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
}

.artist-drawer-section {
    padding: 16px 20px 8px;
}

.artist-drawer-section h4 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.artist-drawer-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 0 20px 20px;
}

.artist-album-card {
    cursor: pointer;
    border-radius: 10px;
    padding: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.artist-album-card:hover {
    background: var(--bs-tertiary-bg);
    transform: translateY(-2px);
}

.artist-album-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 6px;
}

.artist-album-name {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
}

.artist-album-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.artist-loading-state,
.artist-error-state {
    padding: 20px;
    text-align: center;
    color: var(--bs-secondary-color);
}

.artist-error-state button {
    margin-top: 10px;
}

/* =========================================================
   Spotify page redesign — Linear-inspired dark dashboard
   Appended to override the legacy styles above without
   changing any existing JavaScript hooks.
   ========================================================= */

.spotify-page {
    --spotify-bg: #08090a;
    --spotify-panel: #0f1011;
    --spotify-surface: #191a1b;
    --spotify-surface-hover: #202124;
    --spotify-border: rgba(255, 255, 255, 0.08);
    --spotify-border-soft: rgba(255, 255, 255, 0.05);
    --spotify-text: #f7f8f8;
    --spotify-text-secondary: #d0d6e0;
    --spotify-text-tertiary: #8a8f98;
    --spotify-text-quaternary: #62666d;
    --spotify-accent: #7170ff;
    --spotify-accent-hover: #828fff;
    --spotify-accent-bg: #5e6ad2;
    --spotify-success: #10b981;
    --spotify-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.16) 0px 0px 0px 1px;
    min-height: 100vh;
    padding-top: 88px;
    background:
        radial-gradient(circle at top left, rgba(94, 106, 210, 0.18), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(113, 112, 255, 0.14), transparent 25%),
        linear-gradient(180deg, #08090a 0%, #060708 100%);
    color: var(--spotify-text);
    font-family: 'Inter', 'Inter Variable', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv01', 'ss03';
}

.spotify-page *,
.spotify-page *::before,
.spotify-page *::after {
    font-feature-settings: inherit;
}

.spotify-stage {
    padding: 0 0 72px;
}

.spotify-shell {
    position: relative;
    max-width: 1280px;
}

.spotify-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid var(--spotify-border);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(15, 16, 17, 0.92);
    box-shadow: var(--spotify-shadow);
    backdrop-filter: blur(16px);
}

.spotify-hero-copy {
    min-width: 0;
}

.spotify-eyebrow,
.spotify-auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 10px;
    border: 1px solid var(--spotify-border-soft);
    border-radius: 999px;
    color: var(--spotify-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.02);
}

.spotify-hero h1 {
    margin: 0;
    color: var(--spotify-text);
    font-size: clamp(2.25rem, 4vw, 4rem);
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 510;
}

.spotify-hero p {
    max-width: 62ch;
    margin: 16px 0 0;
    color: var(--spotify-text-secondary);
    font-size: 1.05rem;
    line-height: 1.65;
}

.spotify-hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.spotify-hero-pills span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--spotify-border-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--spotify-text-secondary);
    font-size: 0.85rem;
    font-weight: 510;
}

.spotify-hero-card,
.spotify-auth-card {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--spotify-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.spotify-auth-card p {
    margin: 0;
    color: var(--spotify-text-secondary);
    line-height: 1.65;
}

.spotify-auth-card .btn-spotify,
.spotify-detail-action,
.spotify-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.spotify-auth-card .btn-spotify {
    padding: 12px 16px;
    background: linear-gradient(180deg, var(--spotify-accent-bg), #4c56b5);
    color: #fff;
    box-shadow: 0 10px 26px rgba(94, 106, 210, 0.24);
}

.spotify-auth-card .btn-spotify:hover,
.spotify-detail-action:hover,
.spotify-load-more:hover {
    transform: translateY(-1px);
}

.spotify-auth-card .btn-spotify:hover {
    background: linear-gradient(180deg, var(--spotify-accent-hover), #6974dc);
}

.spotify-dashboard {
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.spotify-rail,
.spotify-main {
    min-width: 0;
}

.spotify-rail {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--spotify-border);
    border-radius: 22px;
    background: rgba(15, 16, 17, 0.88);
    backdrop-filter: blur(16px);
    box-shadow: var(--spotify-shadow);
}

.spotify-loading-panel {
    min-height: 116px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--spotify-border-soft);
}

.spotify-loading .spinner {
    width: 42px;
    height: 42px;
    border-width: 3px;
    border-color: var(--spotify-border);
    border-top-color: var(--spotify-accent);
}

.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.spotify-rail-note {
    padding: 14px 15px;
    border: 1px solid var(--spotify-border-soft);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--spotify-text-tertiary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.spotify-tabs {
    display: flex;
    gap: 8px;
}

.spotify-tabs-rail {
    flex-direction: column;
}

.spotify-tab,
.time-range-btn {
    border: 1px solid var(--spotify-border-soft);
    background: rgba(255, 255, 255, 0.02);
    color: var(--spotify-text-secondary);
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.spotify-tab {
    justify-content: flex-start;
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 510;
    text-align: left;
}

.spotify-tab:hover,
.time-range-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--spotify-text);
    transform: translateY(-1px);
}

.spotify-tab.active,
.time-range-btn.active {
    background: rgba(94, 106, 210, 0.18);
    border-color: rgba(113, 112, 255, 0.4);
    color: var(--spotify-text);
    box-shadow: inset 0 0 0 1px rgba(113, 112, 255, 0.18);
}

.spotify-main {
    display: grid;
    gap: 18px;
}

.spotify-surface,
.spotify-section.tab-content {
    padding: 22px;
    border: 1px solid var(--spotify-border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    box-shadow: var(--spotify-shadow);
}

.spotify-section {
    margin-bottom: 0;
    padding: 0;
}

.section-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--spotify-border-soft);
}

.spotify-subsection-header {
    margin-top: 28px;
}

.section-header h3 {
    color: var(--spotify-text);
    font-size: 1.05rem;
    font-weight: 590;
    letter-spacing: -0.01em;
}

.section-header .icon {
    font-size: 1.15rem;
}

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

.playlist-card,
.artist-card,
.artist-album-card {
    border: 1px solid var(--spotify-border-soft);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.playlist-card {
    padding: 14px;
    border-radius: 18px;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.playlist-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.12);
}

.playlist-cover {
    margin-bottom: 10px;
    border-radius: 14px;
    box-shadow: rgba(0, 0, 0, 0.35) 0 10px 20px;
}

.playlist-name,
.artist-name,
.track-name,
.artist-album-name,
.playlist-detail-info h2,
.artist-detail-panel h2 {
    color: var(--spotify-text);
}

.playlist-name {
    font-size: 0.98rem;
    font-weight: 590;
    letter-spacing: -0.01em;
}

.playlist-tracks-count,
.track-artist,
.track-duration,
.artist-genres,
.artist-album-meta,
.user-email,
.playlist-detail-info .description,
.playlist-detail-info .meta,
.artist-detail-header-meta,
.artist-loading-state,
.artist-error-state,
.spotify-pagination-note,
.spotify-rail-note,
.empty-state,
.progress-time,
.player-track-artist {
    color: var(--spotify-text-tertiary);
}

.track-list {
    display: grid;
    gap: 8px;
}

.track-item {
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.track-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.track-item.playing {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.22);
}

.track-number {
    width: 28px;
    color: var(--spotify-text-quaternary);
    font-variant-numeric: tabular-nums;
}

.track-item.playing .track-number {
    color: var(--spotify-success);
}

.track-cover {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.track-name {
    font-weight: 590;
}

.track-artist {
    margin-top: 2px;
}

.track-duration {
    min-width: 52px;
    text-align: right;
}

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

.artist-card {
    padding: 16px;
    border-radius: 18px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.artist-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
}

.artist-image {
    width: 92px;
    height: 92px;
    margin-bottom: 12px;
    border: 1px solid var(--spotify-border-soft);
    box-shadow: rgba(0, 0, 0, 0.35) 0 12px 24px;
}

.artist-name {
    font-size: 0.98rem;
    font-weight: 590;
}

.artist-genres {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.5;
}

.genre-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.genre-pill,
.artist-genre-pill {
    border: 1px solid var(--spotify-border-soft);
    background: rgba(255, 255, 255, 0.03);
    color: var(--spotify-text-secondary);
}

.genre-pill {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 510;
}

.playlist-detail {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
}

.playlist-detail-panel {
    width: min(760px, 92vw);
    border: 1px solid var(--spotify-border);
    border-radius: 24px 0 0 24px;
    background: linear-gradient(180deg, rgba(25, 26, 27, 0.98), rgba(15, 16, 17, 0.98));
    box-shadow: -16px 0 40px rgba(0, 0, 0, 0.4);
}

.playlist-detail-header {
    gap: 20px;
    padding: 26px 24px 22px;
    background: linear-gradient(180deg, rgba(113, 112, 255, 0.14), transparent 80%);
}

.playlist-detail-cover {
    width: 180px;
    height: 180px;
    border-radius: 18px;
    box-shadow: rgba(0, 0, 0, 0.45) 0 18px 30px;
}

.playlist-detail-info h2 {
    margin-bottom: 8px;
    font-size: clamp(1.5rem, 2vw, 2rem);
    letter-spacing: -0.03em;
}

.playlist-detail-info .description,
.playlist-detail-info .meta {
    margin-bottom: 8px;
    line-height: 1.6;
}

.playlist-detail-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--spotify-border-soft);
    color: var(--spotify-text);
}

.playlist-detail-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.playlist-detail-body {
    border-top: 1px solid var(--spotify-border-soft);
    background: rgba(255, 255, 255, 0.01);
}

.spotify-track-list {
    padding: 0;
}

.spotify-pagination {
    display: grid;
    gap: 10px;
    padding: 16px 0 0;
    text-align: center;
}

.spotify-load-more {
    min-width: 180px;
    margin: 0 auto;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--spotify-text-secondary);
    border-color: var(--spotify-border-soft);
}

.spotify-load-more:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--spotify-text);
    border-color: rgba(255, 255, 255, 0.12);
}

.spotify-loading-inline {
    padding: 4px 0 0;
}

.spotify-pagination-note {
    font-size: 0.88rem;
}

.spotify-detail-action,
.spotify-detail-secondary {
    margin-top: 10px;
}

.spotify-detail-action {
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--spotify-accent-bg), #4c56b5);
    color: #fff;
}

.spotify-detail-action:hover {
    background: linear-gradient(180deg, var(--spotify-accent-hover), #6974dc);
    color: #fff;
}

.spotify-detail-secondary {
    padding: 9px 13px;
    border-radius: 10px;
    border-color: var(--spotify-border-soft);
    background: rgba(255, 255, 255, 0.03);
    color: var(--spotify-text-secondary);
}

.spotify-detail-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--spotify-text);
}

.artist-detail-panel .playlist-detail-header {
    align-items: flex-start;
}

.artist-detail-panel .playlist-detail-cover {
    border-radius: 50%;
}

.artist-genres-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.artist-detail-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.artist-drawer-section {
    padding: 18px 24px 8px;
}

.artist-drawer-section h4 {
    margin-bottom: 12px;
    color: var(--spotify-text);
    font-size: 1rem;
    font-weight: 590;
}

.artist-drawer-albums {
    padding: 0 24px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.artist-album-card {
    padding: 10px;
    border-radius: 14px;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.artist-album-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.artist-album-cover {
    border-radius: 12px;
}

.artist-album-name {
    margin-top: 4px;
    font-size: 0.88rem;
    line-height: 1.35;
}

.artist-album-meta {
    margin-top: 3px;
}

.artist-loading-state,
.artist-error-state,
.empty-state {
    color: var(--spotify-text-secondary);
}

.spotify-player {
    left: 50%;
    bottom: 20px;
    width: min(calc(100% - 24px), 1240px);
    border: 1px solid var(--spotify-border);
    border-radius: 24px;
    background: rgba(15, 16, 17, 0.94);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
}

.spotify-player.collapsed {
    transform: translate(-50%, calc(100% + 28px));
}

.player-toggle {
    top: -32px;
    border: 1px solid var(--spotify-border);
    border-bottom: 0;
    background: rgba(15, 16, 17, 0.96);
    color: var(--spotify-text-secondary);
}

.player-content {
    padding: 16px 18px 18px;
}

.player-main {
    gap: 18px;
}

.player-track-cover {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 30%, rgba(113, 112, 255, 0.35), rgba(25, 20, 20, 0.96));
}

.player-track-name {
    color: var(--spotify-text);
    font-weight: 590;
}

.player-controls {
    gap: 12px;
}

.player-btn {
    color: var(--spotify-text-secondary);
}

.player-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--spotify-text);
}

.player-btn.play-pause {
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, var(--spotify-accent-bg), #4c56b5);
    color: #fff;
}

.player-btn.play-pause:hover {
    background: linear-gradient(180deg, var(--spotify-accent-hover), #6974dc);
}

.player-progress {
    margin-top: 14px;
}

.progress-bar-container {
    gap: 12px;
}

.progress-bar-wrapper {
    height: 7px;
    background: rgba(255, 255, 255, 0.06);
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--spotify-accent), var(--spotify-accent-hover));
}

.player-volume {
    gap: 10px;
}

.volume-slider {
    width: 120px;
    background: rgba(255, 255, 255, 0.06);
}

.volume-slider::-webkit-slider-thumb {
    background: var(--spotify-accent);
}

.spotify-loading .spinner,
.spotify-loading .spinner-sm {
    animation: spin 1s linear infinite;
}

.skeleton-playlist,
.skeleton-cover,
.skeleton-text {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
}

.skeleton-playlist {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--spotify-border-soft);
    background-color: rgba(255, 255, 255, 0.02);
}

.skeleton-cover {
    border-radius: 14px;
}

.skeleton-text {
    border-radius: 4px;
}

.spotify-auth {
    padding: 80px 20px;
}

.spotify-auth p {
    color: var(--spotify-text-secondary);
}

.spotify-auth .btn-spotify {
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(94, 106, 210, 0.24);
}

@media (max-width: 1199.98px) {
    .spotify-dashboard {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .spotify-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .spotify-hero-card,
    .spotify-auth-card {
        max-width: 100%;
    }
}

@media (max-width: 991.98px) {
    .spotify-dashboard {
        grid-template-columns: 1fr;
    }

    .spotify-rail {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .spotify-page {
        padding-top: 76px;
    }

    .spotify-hero,
    .spotify-surface,
    .spotify-section.tab-content,
    .spotify-rail {
        border-radius: 18px;
    }

    .spotify-hero {
        padding: 20px;
    }

    .spotify-hero h1 {
        font-size: clamp(1.9rem, 9vw, 2.8rem);
    }

    .spotify-main {
        gap: 14px;
    }

    .playlist-grid,
    .artist-grid,
    .artist-drawer-albums {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .playlist-detail-panel {
        width: 100%;
        max-height: 84vh;
        border-radius: 18px 18px 0 0;
    }

    .playlist-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .playlist-detail-cover {
        width: 144px;
        height: 144px;
    }

    .artist-detail-panel .playlist-detail-header {
        align-items: center;
        text-align: center;
    }

    .artist-detail-panel .playlist-detail-info {
        width: 100%;
    }

    .player-main {
        flex-wrap: wrap;
    }

    .player-volume {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .spotify-stage {
        padding-bottom: 88px;
    }

    .spotify-hero-pills {
        gap: 8px;
    }

    .spotify-hero-pills span,
    .genre-pill {
        font-size: 0.8rem;
    }

    .playlist-card,
    .artist-card,
    .artist-album-card {
        border-radius: 16px;
    }

    .playlist-grid,
    .artist-grid,
    .artist-drawer-albums {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .track-item {
        padding: 10px 12px;
    }

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

    .playlist-detail-header,
    .artist-drawer-section,
    .artist-drawer-albums,
    .player-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .spotify-player {
        width: calc(100% - 16px);
        bottom: 10px;
        border-radius: 18px;
    }
}

/* =========================================================
   Final Spotify polish overrides
   ========================================================= */

.spotify-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.spotify-hero::before,
.spotify-hero::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
    z-index: 0;
}

.spotify-hero::before {
    top: -24px;
    right: -18px;
    width: min(46%, 420px);
    height: 120%;
    background:
        radial-gradient(circle at 30% 20%, rgba(113, 112, 255, 0.26), transparent 35%),
        radial-gradient(circle at 70% 45%, rgba(94, 106, 210, 0.20), transparent 38%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    transform: rotate(-3deg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.spotify-hero::after {
    right: 22px;
    bottom: 22px;
    width: 180px;
    height: 180px;
    border-radius: 30px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at 35% 30%, rgba(113, 112, 255, 0.35), rgba(94, 106, 210, 0.12) 35%, transparent 70%);
    box-shadow:
        rgba(0, 0, 0, 0.38) 0 22px 38px,
        inset 0 1px 0 rgba(255, 255, 255, 0.09),
        inset 0 0 24px rgba(0, 0, 0, 0.18);
    transform: rotate(10deg);
    opacity: 0.95;
}

.spotify-hero > * {
    position: relative;
    z-index: 1;
}

.spotify-hero-card,
.spotify-auth-card {
    position: relative;
    overflow: hidden;
}

.spotify-hero-card::before,
.spotify-auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(113, 112, 255, 0.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(94, 106, 210, 0.14), transparent 28%);
    pointer-events: none;
}

.spotify-user-info.spotify-hero-card {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    min-width: 250px;
}

.spotify-user-info.spotify-hero-card .user-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.spotify-user-info.spotify-hero-card .user-avatar {
    width: 74px;
    height: 74px;
    border: 2px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 8px rgba(113, 112, 255, 0.08), 0 14px 26px rgba(0, 0, 0, 0.28);
}

.spotify-user-info.spotify-hero-card .user-name {
    font-size: 1.02rem;
    font-weight: 590;
    color: var(--spotify-text);
}

.spotify-user-info.spotify-hero-card .user-email {
    max-width: 100%;
    text-align: center;
}

.playlist-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow:
        rgba(0, 0, 0, 0.22) 0 10px 26px,
        rgba(0, 0, 0, 0.10) 0 0 0 1px;
    transition:
        transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
        background-color 0.22s ease,
        border-color 0.22s ease;
}

.playlist-card::before,
.playlist-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.playlist-card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%);
}

.playlist-card::after {
    background: linear-gradient(180deg, transparent 38%, rgba(0, 0, 0, 0.22) 100%);
    opacity: 0.85;
}

.playlist-card > * {
    position: relative;
    z-index: 1;
}

.playlist-card:hover {
    transform: translateY(-8px) scale(1.012);
    box-shadow:
        rgba(0, 0, 0, 0.34) 0 18px 34px,
        rgba(113, 112, 255, 0.12) 0 0 0 1px,
        rgba(0, 0, 0, 0.18) 0 0 0 1px inset;
    background: rgba(255, 255, 255, 0.05);
}

.playlist-cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    overflow: hidden;
    -webkit-mask-image: radial-gradient(circle at center, #000 92%, transparent 100%);
            mask-image: radial-gradient(circle at center, #000 92%, transparent 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.32);
    filter: saturate(1.08) contrast(1.04);
}

.playlist-card:hover .playlist-cover {
    filter: saturate(1.14) contrast(1.08) brightness(1.02);
}

.spotify-player {
    width: min(calc(100% - 20px), 1240px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        rgba(15, 16, 17, 0.94);
    box-shadow:
        rgba(0, 0, 0, 0.45) 0 24px 52px,
        rgba(0, 0, 0, 0.18) 0 0 0 1px,
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
}

.spotify-player::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    width: 72px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
}

.spotify-player.collapsed {
    transform: translate(-50%, calc(100% + 16px));
}

.player-toggle {
    top: -32px;
    padding: 6px 18px;
    border-radius: 16px 16px 0 0;
    background: rgba(15, 16, 17, 0.98);
    color: var(--spotify-text-secondary);
    letter-spacing: -0.01em;
    box-shadow: rgba(0, 0, 0, 0.28) 0 -8px 22px;
}

.player-content {
    padding: 20px 20px 18px;
}

.player-main {
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.player-track-info {
    min-width: 0;
    gap: 14px;
}

.player-track-cover {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    box-shadow: rgba(0, 0, 0, 0.34) 0 10px 18px;
}

.player-controls {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.player-volume {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.player-progress {
    margin-top: 16px;
}

.progress-bar-wrapper {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--spotify-accent), var(--spotify-accent-hover));
    box-shadow: 0 0 18px rgba(113, 112, 255, 0.38);
}

@media (max-width: 767.98px) {
    .spotify-hero::before {
        width: 64%;
        right: -28px;
    }

    .spotify-hero::after {
        width: 132px;
        height: 132px;
        right: 12px;
        bottom: 14px;
    }

    .spotify-user-info.spotify-hero-card {
        min-width: 0;
        width: 100%;
    }

    .player-controls,
    .player-volume {
        border-radius: 18px;
    }
}

/* User requested: remove the hero pattern/decorative background */
.spotify-hero::before,
.spotify-hero::after {
    content: none !important;
    display: none !important;
}

/* Light mode fixes: remove dark residue from redesign layer */
html[data-bs-theme="light"] .spotify-page {
    --spotify-bg: #f7f8f8;
    --spotify-panel: #ffffff;
    --spotify-surface: #f3f4f5;
    --spotify-surface-hover: #eceef1;
    --spotify-border: rgba(18, 22, 30, 0.12);
    --spotify-border-soft: rgba(18, 22, 30, 0.08);
    --spotify-text: #131519;
    --spotify-text-secondary: #2a2d33;
    --spotify-text-tertiary: #5a5f69;
    --spotify-text-quaternary: #6f7682;
    background:
        radial-gradient(circle at top left, rgba(94, 106, 210, 0.10), transparent 32%),
        radial-gradient(circle at 80% 0%, rgba(113, 112, 255, 0.08), transparent 26%),
        linear-gradient(180deg, #f7f8f8 0%, #eef1f5 100%);
}

html[data-bs-theme="light"] .spotify-hero,
html[data-bs-theme="light"] .spotify-rail,
html[data-bs-theme="light"] .spotify-surface,
html[data-bs-theme="light"] .spotify-section.tab-content,
html[data-bs-theme="light"] .spotify-hero-card,
html[data-bs-theme="light"] .spotify-auth-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 248, 252, 0.76));
    border-color: var(--spotify-border);
    box-shadow: rgba(28, 36, 52, 0.08) 0 10px 28px, rgba(28, 36, 52, 0.06) 0 0 0 1px;
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
}

html[data-bs-theme="light"] .spotify-eyebrow,
html[data-bs-theme="light"] .spotify-auth-kicker,
html[data-bs-theme="light"] .spotify-hero-pills span,
html[data-bs-theme="light"] .spotify-rail-note,
html[data-bs-theme="light"] .spotify-tab,
html[data-bs-theme="light"] .time-range-btn {
    background: rgba(255, 255, 255, 0.52);
    border-color: var(--spotify-border-soft);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
}

html[data-bs-theme="light"] .spotify-user-info.spotify-hero-card .user-avatar {
    border-color: rgba(18, 22, 30, 0.12);
    box-shadow: 0 0 0 6px rgba(113, 112, 255, 0.08), 0 10px 18px rgba(28, 36, 52, 0.12);
}

html[data-bs-theme="light"] .playlist-card,
html[data-bs-theme="light"] .artist-card,
html[data-bs-theme="light"] .artist-album-card,
html[data-bs-theme="light"] .track-item {
    background: rgba(255, 255, 255, 0.62);
    border-color: var(--spotify-border-soft);
    box-shadow: rgba(28, 36, 52, 0.06) 0 8px 18px, rgba(28, 36, 52, 0.04) 0 0 0 1px;
    -webkit-backdrop-filter: blur(12px) saturate(145%);
    backdrop-filter: blur(12px) saturate(145%);
}

html[data-bs-theme="light"] .playlist-card::before {
    background: linear-gradient(180deg, rgba(17, 22, 30, 0.04), transparent 42%);
}

html[data-bs-theme="light"] .playlist-card::after {
    background: linear-gradient(180deg, transparent 35%, rgba(17, 22, 30, 0.06) 100%);
    opacity: 0.5;
}

html[data-bs-theme="light"] .playlist-card:hover,
html[data-bs-theme="light"] .artist-card:hover,
html[data-bs-theme="light"] .artist-album-card:hover,
html[data-bs-theme="light"] .track-item:hover {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(113, 112, 255, 0.28);
    box-shadow: rgba(36, 46, 66, 0.12) 0 14px 26px, rgba(113, 112, 255, 0.16) 0 0 0 1px;
}

html[data-bs-theme="light"] .playlist-cover,
html[data-bs-theme="light"] .player-track-cover,
html[data-bs-theme="light"] .artist-image,
html[data-bs-theme="light"] .artist-album-cover,
html[data-bs-theme="light"] .playlist-detail-cover {
    box-shadow: rgba(34, 42, 58, 0.14) 0 10px 18px;
}

html[data-bs-theme="light"] .playlist-detail {
    background: rgba(12, 18, 28, 0.24);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

html[data-bs-theme="light"] .playlist-detail-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(246, 248, 251, 0.76) 100%);
    border-color: var(--spotify-border);
    box-shadow: -14px 0 30px rgba(32, 42, 58, 0.16);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
}

html[data-bs-theme="light"] .playlist-detail-header {
    background: linear-gradient(180deg, rgba(113, 112, 255, 0.12), rgba(113, 112, 255, 0.02) 70%, transparent 100%);
}

html[data-bs-theme="light"] .playlist-detail-close {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--spotify-border-soft);
    color: var(--spotify-text-tertiary);
}

html[data-bs-theme="light"] .spotify-player {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 247, 251, 0.74));
    border-color: var(--spotify-border);
    box-shadow: rgba(32, 42, 58, 0.16) 0 18px 36px, rgba(32, 42, 58, 0.08) 0 0 0 1px;
    -webkit-backdrop-filter: blur(20px) saturate(155%);
    backdrop-filter: blur(20px) saturate(155%);
}

html[data-bs-theme="light"] .spotify-player::before {
    background: rgba(18, 22, 30, 0.16);
}

html[data-bs-theme="light"] .player-toggle,
html[data-bs-theme="light"] .player-controls,
html[data-bs-theme="light"] .player-volume {
    background: rgba(255, 255, 255, 0.64);
    border-color: var(--spotify-border-soft);
    box-shadow: none;
    -webkit-backdrop-filter: blur(12px) saturate(145%);
    backdrop-filter: blur(12px) saturate(145%);
}

html[data-bs-theme="light"] .progress-bar-wrapper,
html[data-bs-theme="light"] .volume-slider {
    background: rgba(18, 22, 30, 0.10);
}

html[data-bs-theme="light"] .skeleton-playlist,
html[data-bs-theme="light"] .skeleton-cover,
html[data-bs-theme="light"] .skeleton-text {
    background: linear-gradient(90deg, rgba(18, 22, 30, 0.06) 25%, rgba(18, 22, 30, 0.11) 50%, rgba(18, 22, 30, 0.06) 75%);
    background-size: 200% 100%;
}

/* Final fix: make bottom player visibly translucent */
html[data-bs-theme="dark"] .spotify-page .spotify-player,
html[data-bs-theme="light"] .spotify-page .spotify-player {
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
}

html[data-bs-theme="dark"] .spotify-page .spotify-player {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        rgba(15, 16, 17, 0.62);
    border-color: rgba(255, 255, 255, 0.10);
}

html[data-bs-theme="light"] .spotify-page .spotify-player {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.60), rgba(255, 255, 255, 0.46)),
        rgba(244, 247, 251, 0.50);
    border-color: rgba(18, 22, 30, 0.14);
}

/* Strong light-mode override against linear-theme !important rules */
html[data-bs-theme="light"] .spotify-page .spotify-player {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.38)),
        rgba(244, 247, 251, 0.44) !important;
    border-color: rgba(18, 22, 30, 0.16) !important;
    box-shadow:
        rgba(32, 42, 58, 0.16) 0 18px 36px,
        rgba(32, 42, 58, 0.08) 0 0 0 1px,
        inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
    -webkit-backdrop-filter: blur(24px) saturate(165%) !important;
    backdrop-filter: blur(24px) saturate(165%) !important;
}

html[data-bs-theme="light"] .spotify-page .player-toggle {
    background: rgba(255, 255, 255, 0.58) !important;
    border-color: rgba(18, 22, 30, 0.14) !important;
    box-shadow: rgba(32, 42, 58, 0.14) 0 -8px 18px !important;
    -webkit-backdrop-filter: blur(16px) saturate(155%) !important;
    backdrop-filter: blur(16px) saturate(155%) !important;
}

/* Mobile safety spacing: keep the first card clear of the fixed navbar */
@media (max-width: 767.98px) {
    main.page.spotify-page {
        padding-top: 6.5rem;
        overflow-x: hidden;
    }

    .spotify-stage {
        padding-top: 22px;
    }

    #tab-recent,
    #recent-tracks {
        overflow-x: hidden;
    }

    #tab-recent #recent-tracks {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    #recent-tracks .track-item {
        max-width: 100%;
    }

    /* Make each recent row narrower on mobile without affecting other tabs */
    #tab-recent #recent-tracks > .track-item {
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        box-sizing: border-box;
        margin: 0;
        padding: 9px 10px;
        overflow: hidden;
    }

    #tab-recent #recent-tracks > .track-item .track-cover {
        width: 38px;
        height: 38px;
    }

    #tab-recent #recent-tracks > .track-item .track-duration {
        min-width: 44px;
        font-size: 0.8rem;
    }

    /* Touch devices can keep :hover state, which shifts rows and causes right overflow */
    #recent-tracks .track-item:hover {
        transform: none;
    }
}

