/* ================================================================
   Apple Music-Inspired Redesign
   ================================================================ */

/* ----------------------------------------------------------------
   Design Tokens & Color System
   ---------------------------------------------------------------- */
:root {
    /* Light Mode — Apple's signature clean palette */
    --body-bg-color: #f5f5f7;
    --content-bg-color: #ffffff;
    --surface-elevated: rgba(255, 255, 255, 0.72);
    --text-color-primary: #1d1d1f;
    --text-color-secondary: #6e6e73;
    --text-color-tertiary: #86868b;
    --border-color-soft: rgba(0, 0, 0, 0.06);
    --border-color-medium: rgba(0, 0, 0, 0.10);
    --divider-color: rgba(0, 0, 0, 0.08);
    --hover-overlay: rgba(0, 0, 0, 0.035);
    --active-overlay: rgba(0, 0, 0, 0.06);

    /* Apple Music Accent */
    --am-red: #fc3c44;
    --am-red-bright: #ff4d57;
    --am-pink: #fb5c74;
    --am-gradient: linear-gradient(135deg, #fc3c44 0%, #fb5c74 100%);
    --am-gradient-hover: linear-gradient(135deg, #ff4452 0%, #ff6b82 100%);

    /* Platform Colors */
    --plat-qq: #31c27c;
    --plat-qq-hover: #2eb371;
    --plat-netease: #c20c0c;
    --plat-netease-hover: #d90e0e;
    --plat-kuwo: #f58a07;
    --plat-kuwo-hover: #ff9920;
    --plat-bing: #0078d4;
    --plat-bing-hover: #1a86db;

    /* Glass */
    --glass-bg: rgba(245, 245, 247, 0.72);
    --glass-border: rgba(0, 0, 0, 0.08);

    /* Search */
    --search-bg: rgba(118, 118, 128, 0.12);
    --search-bg-focus: rgba(118, 118, 128, 0.18);

    /* Cover */
    --cover-placeholder-bg: #e8e8ed;
    --cover-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    --cover-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.08);

    /* Ambient — Apple red/pink for brand atmosphere */
    --ambient-1: rgba(252, 60, 68, 0.10);
    --ambient-2: rgba(251, 92, 116, 0.08);
    --ambient-3: rgba(120, 80, 220, 0.04);

    /* Error */
    --error-message-color: #ff3b30;

    /* Typography */
    --font-family-sans: "Manrope", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --font-family-heading: "Space Grotesk", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;

    /* Motion */
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --header-height: 56px;
    --content-max-width: 920px;
    --hero-cover-size: 260px;
}

/* ----------------------------------------------------------------
   Dark Mode — Apple Music's immersive deep dark
   ---------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        --body-bg-color: #000000;
        --content-bg-color: #1c1c1e;
        --surface-elevated: rgba(28, 28, 30, 0.72);
        --text-color-primary: #f5f5f7;
        --text-color-secondary: #98989d;
        --text-color-tertiary: #636366;
        --border-color-soft: rgba(255, 255, 255, 0.08);
        --border-color-medium: rgba(255, 255, 255, 0.12);
        --divider-color: rgba(255, 255, 255, 0.08);
        --hover-overlay: rgba(255, 255, 255, 0.05);
        --active-overlay: rgba(255, 255, 255, 0.08);

        --glass-bg: rgba(0, 0, 0, 0.72);
        --glass-border: rgba(255, 255, 255, 0.08);

        --search-bg: rgba(118, 118, 128, 0.24);
        --search-bg-focus: rgba(118, 118, 128, 0.36);

        --cover-placeholder-bg: #2c2c2e;
        --cover-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
        --cover-shadow-hover: 0 24px 64px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);

        --ambient-1: rgba(252, 60, 68, 0.08);
        --ambient-2: rgba(251, 92, 116, 0.06);
        --ambient-3: rgba(120, 80, 220, 0.04);
    }
}

/* ----------------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.5;
    background-color: var(--body-bg-color);
    color: var(--text-color-primary);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
    letter-spacing: -0.003em;
}

/* ----------------------------------------------------------------
   Ambient Atmosphere Layer
   ---------------------------------------------------------------- */
.ambient-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.ambient-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, var(--ambient-1) 0%, transparent 50%);
    opacity: 0.6;
}

.ambient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.8;
    animation: float-blob 24s ease-in-out infinite;
}

.ambient-blob--1 {
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, var(--ambient-1) 0%, transparent 70%);
    top: -240px;
    right: -180px;
}

.ambient-blob--2 {
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, var(--ambient-2) 0%, transparent 70%);
    bottom: -200px;
    left: -160px;
    animation-delay: -12s;
    animation-duration: 28s;
}

@keyframes float-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -40px) scale(1.08); }
    66% { transform: translate(-30px, 30px) scale(0.94); }
}

/* Grain — kept extremely subtle for Apple's clean aesthetic */
.grain {
    position: absolute;
    inset: 0;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .grain { opacity: 0.025; }
}

/* ----------------------------------------------------------------
   Fixed Glass Header
   ---------------------------------------------------------------- */
.fixed-header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: background 0.4s ease, border-color 0.4s ease;
}

.fixed-header-container h1 {
    margin: 0;
    font-family: var(--font-family-heading);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
    color: var(--text-color-primary);
    opacity: 0.88;
}

/* ----------------------------------------------------------------
   Main Container
   ---------------------------------------------------------------- */
.container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 40px 32px 80px;
    position: relative;
    z-index: 1;
}

/* ----------------------------------------------------------------
   Playlist Hero Header
   ---------------------------------------------------------------- */
#playlist-header {
    display: flex;
    align-items: flex-end;
    gap: 32px;
    margin-bottom: 48px;
    padding-bottom: 36px;
    position: relative;
    animation: hero-rise 0.6s var(--transition-smooth) both;
}

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

/* Playlist Info Column */
#playlist-info {
    flex: 1;
    min-width: 0;
    padding-bottom: 8px;
}

/* Eyebrow label */
.playlist-eyebrow {
    font-family: var(--font-family-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--am-red);
    margin-bottom: 10px;
    opacity: 0.9;
}

/* Playlist Name — large, bold, Apple-style */
#playlist-name {
    font-family: var(--font-family-heading);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 10px;
    letter-spacing: -0.03em;
    color: var(--text-color-primary);
    word-break: break-word;
}

/* Description */
#playlist-description {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    line-height: 1.55;
    margin-bottom: 16px;
    max-width: 520px;
}

/* Meta row */
.playlist-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-color-tertiary);
    margin-bottom: 20px;
}

.playlist-meta p {
    margin: 0;
}

.meta-owner strong {
    color: var(--text-color-primary);
    font-weight: 600;
}

.meta-dot {
    opacity: 0.5;
    font-size: 0.6rem;
}

/* ----------------------------------------------------------------
   Cover Art
   ---------------------------------------------------------------- */
.cover-art-container {
    border-radius: 10px;
    background-color: var(--cover-placeholder-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition:
        transform var(--transition-smooth),
        box-shadow var(--transition-smooth);
    flex-shrink: 0;
    position: relative;
}

/* Hero cover — large and prominent */
.cover-art-container.playlist-main-cover {
    width: var(--hero-cover-size);
    height: var(--hero-cover-size);
    min-width: var(--hero-cover-size);
    border-radius: 16px;
    box-shadow: var(--cover-shadow);
}

.cover-art-container.playlist-main-cover:hover {
    transform: scale(1.02);
    box-shadow: var(--cover-shadow-hover);
}

.cover-art-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Emoji fallback */
.cover-art-container .emoji-placeholder {
    font-size: 2.4rem;
    opacity: 0.35;
    user-select: none;
}

.playlist-main-cover .emoji-placeholder {
    font-size: 4rem;
}

/* ----------------------------------------------------------------
   Playlist Actions — Apple Music CTA Button
   ---------------------------------------------------------------- */
.playlist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.playlist-apple-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 28px;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-family-sans);
    border-radius: 100px;
    background: var(--am-gradient);
    color: #ffffff !important;
    text-decoration: none;
    border: none;
    transition:
        transform var(--transition-smooth),
        box-shadow var(--transition-smooth),
        filter var(--transition-fast);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(252, 60, 68, 0.35);
    letter-spacing: 0.005em;
}

.playlist-apple-button:hover {
    transform: translateY(-2px);
    background: var(--am-gradient-hover);
    box-shadow: 0 8px 28px rgba(252, 60, 68, 0.45);
    filter: brightness(1.05);
}

.playlist-apple-button:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 10px rgba(252, 60, 68, 0.3);
}

.playlist-apple-button::before {
    content: "";
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M23.997 6.124c0-.738-.065-1.47-.24-2.19-.317-1.31-1.062-2.31-2.18-3.043C21.003.517 20.373.285 19.703.169c-.515-.087-1.038-.114-1.56-.149C18.062.006 17.984.008 17.91 0H6.09c-.095.008-.19.014-.286.02C5.148.075 4.493.12 3.852.324 2.5 0.701 1.488 1.479.798 2.678.4 3.284.2 4.001.088 4.732.03 5.117 0 5.503 0 5.892v12.215c0 .389.03.775.088 1.16.112.731.312 1.448.71 2.054.69 1.199 1.702 1.977 3.054 2.354.641.204 1.296.249 1.962.304.096.006.191.012.287.02h11.82c.095-.008.19-.014.286-.02.66-.055 1.31-.1 1.95-.302 1.36-.377 2.38-1.155 3.07-2.354.4-.606.6-1.323.71-2.054.06-.385.09-.771.09-1.16V6.124zM12.96 16.5c-.13.32-.34.6-.6.81-.26.21-.56.37-.88.47-.32.1-.66.15-1 .15-.34 0-.68-.05-1-.15-.32-.1-.62-.26-.88-.47-.26-.21-.47-.49-.6-.81l1.2-.5c.07.19.18.36.33.5.15.14.33.25.53.32.2.07.41.11.62.11.21 0 .42-.04.62-.11.2-.07.38-.18.53-.32.15-.14.26-.31.33-.5.07-.19.11-.4.11-.62 0-.22-.04-.43-.11-.62-.07-.19-.18-.36-.33-.5-.15-.14-.33-.25-.53-.32-.2-.07-.41-.11-.62-.11-.21 0-.42.04-.62.11-.2.07-.38.18-.53.32-.15.14-.26.31-.33.5l-1.2-.5c.13-.32.34-.6.6-.81.26-.21.56-.37.88-.47.32-.1.66-.15 1-.15.34 0 .68.05 1 .15.32.1.62.26.88.47.26.21.47.49.6.81.13.32.2.66.2 1s-.07.68-.2 1zm6.4 0c-.13.32-.34.6-.6.81-.26.21-.56.37-.88.47-.32.1-.66.15-1 .15-.34 0-.68-.05-1-.15-.32-.1-.62-.26-.88-.47-.26-.21-.47-.49-.6-.81l1.2-.5c.07.19.18.36.33.5.15.14.33.25.53.32.2.07.41.11.62.11.21 0 .42-.04.62-.11.2-.07.38-.18.53-.32.15-.14.26-.31.33-.5.07-.19.11-.4.11-.62 0-.22-.04-.43-.11-.62-.07-.19-.18-.36-.33-.5-.15-.14-.33-.25-.53-.32-.2-.07-.41-.11-.62-.11-.21 0-.42.04-.62.11-.2.07-.38.18-.53.32-.15.14-.26.31-.33.5l-1.2-.5c.13-.32.34-.6.6-.81.26-.21.56-.37.88-.47.32-.1.66-.15 1-.15.34 0 .68.05 1 .15.32.1.62.26.88.47.26.21.47.49.6.81.13.32.2.66.2 1s-.07.68-.2 1z'/%3E%3C/svg%3E") no-repeat center / contain;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Track List Header & Search
   ---------------------------------------------------------------- */
.track-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 16px;
    gap: 16px;
}

.track-list-header h2 {
    font-family: var(--font-family-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-color-primary);
    white-space: nowrap;
}

.track-count-pill {
    font-weight: 500;
    color: var(--text-color-tertiary);
    font-size: 0.85em;
}

/* Apple-style rounded search field */
.search-input-material-wrapper {
    position: relative;
    min-width: 220px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-color-secondary);
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
}

#search-input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: none;
    border-radius: 100px;
    background: var(--search-bg);
    color: var(--text-color-primary);
    outline: none;
    font-size: 0.85rem;
    font-family: var(--font-family-sans);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

#search-input::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.8;
}

#search-input:focus {
    background: var(--search-bg-focus);
    box-shadow: 0 0 0 3px rgba(252, 60, 68, 0.12);
}

.search-input-material-wrapper:focus-within .search-icon {
    color: var(--am-red);
}

/* Hide the Material underline — not needed for pill style */
.search-input-underline {
    display: none;
}

/* ----------------------------------------------------------------
   Track List
   ---------------------------------------------------------------- */
#tracks {
    list-style: none;
    margin: 0;
    padding: 0 8px;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 0 -8px;
    border-radius: 10px;
    transition:
        background-color var(--transition-fast);
    position: relative;
    animation: track-fade-in 0.4s ease both;
}

@keyframes track-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entrance for first visible items */
.track-item:nth-child(1) { animation-delay: 0.04s; }
.track-item:nth-child(2) { animation-delay: 0.07s; }
.track-item:nth-child(3) { animation-delay: 0.10s; }
.track-item:nth-child(4) { animation-delay: 0.13s; }
.track-item:nth-child(5) { animation-delay: 0.16s; }
.track-item:nth-child(6) { animation-delay: 0.19s; }
.track-item:nth-child(7) { animation-delay: 0.22s; }
.track-item:nth-child(8) { animation-delay: 0.25s; }
.track-item:nth-child(9) { animation-delay: 0.28s; }
.track-item:nth-child(10) { animation-delay: 0.31s; }
.track-item:nth-child(11) { animation-delay: 0.34s; }
.track-item:nth-child(12) { animation-delay: 0.37s; }

.track-item:hover {
    background-color: var(--hover-overlay);
}

.track-item:active {
    background-color: var(--active-overlay);
}

.track-item.hidden {
    display: none;
}

/* Track thumbnail cover */
.track-item .cover-art-container {
    width: 56px;
    height: 56px;
    min-width: 56px;
    margin-right: 14px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-smooth);
}

.track-item:hover .cover-art-container {
    transform: scale(1.05);
}

/* ----------------------------------------------------------------
   Track Content
   ---------------------------------------------------------------- */
.track-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.track-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.track-name {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
    color: var(--text-color-primary);
}

.track-artist-album {
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

/* ----------------------------------------------------------------
   Track Action Buttons — Compact Platform Pills
   ---------------------------------------------------------------- */
.track-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-button {
    padding: 4px 11px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: var(--font-family-sans);
    border-radius: 100px;
    background: transparent;
    color: var(--text-color-secondary);
    border: 1px solid var(--border-color-medium);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition:
        background var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    cursor: pointer;
    line-height: 1.5;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.action-button:hover {
    transform: translateY(-1px);
    border-color: transparent;
}

.action-button:active {
    transform: translateY(0) scale(0.95);
}

/* Platform: Apple Music */
.action-button.apple {
    background: transparent;
    color: var(--am-red);
    border-color: rgba(252, 60, 68, 0.3);
}
.action-button.apple:hover {
    background: var(--am-gradient);
    color: #fff;
    box-shadow: 0 2px 10px rgba(252, 60, 68, 0.35);
}

/* Platform: QQ Music */
.action-button.qq {
    color: var(--plat-qq);
    border-color: rgba(49, 194, 124, 0.3);
}
.action-button.qq:hover {
    background: var(--plat-qq);
    color: #fff;
    box-shadow: 0 2px 10px rgba(49, 194, 124, 0.35);
}

/* Platform: NetEase */
.action-button.netease {
    color: var(--plat-netease);
    border-color: rgba(194, 12, 12, 0.3);
}
.action-button.netease:hover {
    background: var(--plat-netease);
    color: #fff;
    box-shadow: 0 2px 10px rgba(194, 12, 12, 0.35);
}

/* Platform: Kuwo */
.action-button.kuwo {
    color: var(--plat-kuwo);
    border-color: rgba(245, 138, 7, 0.3);
}
.action-button.kuwo:hover {
    background: var(--plat-kuwo);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 138, 7, 0.35);
}

/* Platform: Bing */
.action-button.bing {
    color: var(--plat-bing);
    border-color: rgba(0, 120, 212, 0.3);
}
.action-button.bing:hover {
    background: var(--plat-bing);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 120, 212, 0.35);
}

/* ----------------------------------------------------------------
   Track Duration
   ---------------------------------------------------------------- */
.track-duration {
    font-size: 0.8rem;
    color: var(--text-color-tertiary);
    margin-left: 16px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Loading & Empty States
   ---------------------------------------------------------------- */
.loading-placeholder,
.no-tracks,
.error-message,
.no-results-message {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-color-secondary);
    font-size: 0.9rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-placeholder::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--text-color-tertiary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    opacity: 0.5;
}

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

.error-message {
    color: var(--error-message-color);
    flex-direction: column;
    gap: 8px;
    line-height: 1.6;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-medium);
    border-radius: 100px;
    border: 3px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color-tertiary);
    background-clip: content-box;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color-medium) transparent;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --hero-cover-size: 200px;
    }

    .container {
        padding: 28px 20px 60px;
    }

    #playlist-header {
        gap: 20px;
        margin-bottom: 36px;
        padding-bottom: 28px;
    }

    #playlist-name {
        font-size: 1.65rem;
    }

    #playlist-description {
        font-size: 0.85rem;
    }

    .track-list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 12px;
    }

    .track-list-header h2 {
        font-size: 1.1rem;
    }

    .search-input-material-wrapper {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    :root {
        --hero-cover-size: 160px;
    }

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

    #playlist-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 18px;
        margin-bottom: 28px;
    }

    #playlist-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 0;
    }

    .playlist-eyebrow {
        margin-bottom: 8px;
    }

    #playlist-name {
        font-size: 1.4rem;
    }

    #playlist-description {
        text-align: center;
        max-width: 100%;
    }

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

    .playlist-actions {
        justify-content: center;
    }

    .track-item {
        padding: 10px 10px;
        margin: 0 -4px;
    }

    .track-item .cover-art-container {
        width: 48px;
        height: 48px;
        min-width: 48px;
        margin-right: 12px;
        border-radius: 6px;
    }

    .track-name {
        font-size: 0.88rem;
    }

    .track-artist-album {
        font-size: 0.75rem;
    }

    .action-button {
        font-size: 0.62rem;
        padding: 3px 9px;
    }

    .track-duration {
        font-size: 0.75rem;
        margin-left: 10px;
    }
}

@media (max-width: 380px) {
    :root {
        --hero-cover-size: 130px;
    }

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

    #playlist-name {
        font-size: 1.2rem;
    }

    .track-item .cover-art-container {
        width: 42px;
        height: 42px;
        min-width: 42px;
        margin-right: 10px;
    }

    .track-duration {
        display: none;
    }

    .action-button {
        font-size: 0.58rem;
        padding: 3px 7px;
    }
}

/* ----------------------------------------------------------------
   Selection
   ---------------------------------------------------------------- */
::selection {
    background: var(--am-red);
    color: #fff;
}

/* ----------------------------------------------------------------
   Focus Ring (accessibility)
   ---------------------------------------------------------------- */
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--am-red);
    outline-offset: 2px;
}

/* ----------------------------------------------------------------
   Reduced Motion
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .ambient-blob {
        animation: none;
    }
}
