
:root {
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --radius: 0.5rem;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.8);
}

:root[data-theme="monochrome"] {
    --background: #000;
    --foreground: #fafafa;
    --card: #111;
    --card-foreground: #fafafa;
    --primary: #fafafa;
    --primary-foreground: #111;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --input: #27272a;
    --ring: #fafafa;
    --highlight: #fff;
    --highlight-rgb: 255, 255, 255;
    --active-highlight: var(--highlight);
    --explicit-badge: #fafafa;
}

:root[data-theme="dark"] {
    --background: #0a0a0a;
    --foreground: #ededed;
    --card: #1a1a1a;
    --card-foreground: #ededed;
    --primary: #3b82f6;
    --primary-foreground: #fff;
    --secondary: #2a2a2a;
    --secondary-foreground: #ededed;
    --muted: #2a2a2a;
    --muted-foreground: #a0a0a0;
    --border: #2a2a2a;
    --input: #2a2a2a;
    --ring: #3b82f6;
    --highlight: #3b82f6;
    --highlight-rgb: 59, 130, 246;
    --active-highlight: #3b82f6;
    --explicit-badge: #ef4444;
}

:root[data-theme="ocean"] {
    --background: #0c1821;
    --foreground: #e0f4ff;
    --card: #1b2838;
    --card-foreground: #e0f4ff;
    --primary: #06b6d4;
    --primary-foreground: #0c1821;
    --secondary: #1e3a52;
    --secondary-foreground: #e0f4ff;
    --muted: #1e3a52;
    --muted-foreground: #94c5e0;
    --border: #1e3a52;
    --input: #1e3a52;
    --ring: #06b6d4;
    --highlight: #06b6d4;
    --highlight-rgb: 6, 182, 212;
    --active-highlight: #06b6d4;
    --explicit-badge: #f43f5e;
}

:root[data-theme="purple"] {
    --background: #0f0514;
    --foreground: #f3e8ff;
    --card: #1e0a2e;
    --card-foreground: #f3e8ff;
    --primary: #a855f7;
    --primary-foreground: #fff;
    --secondary: #2d1545;
    --secondary-foreground: #f3e8ff;
    --muted: #2d1545;
    --muted-foreground: #c4b5fd;
    --border: #2d1545;
    --input: #2d1545;
    --ring: #a855f7;
    --highlight: #a855f7;
    --highlight-rgb: 168, 85, 247;
    --active-highlight: #a855f7;
    --explicit-badge: #ec4899;
}

:root[data-theme="forest"] {
    --background: #0a1409;
    --foreground: #e8f5e9;
    --card: #1a2e1a;
    --card-foreground: #e8f5e9;
    --primary: #22c55e;
    --primary-foreground: #0a1409;
    --secondary: #2d4a2d;
    --secondary-foreground: #e8f5e9;
    --muted: #2d4a2d;
    --muted-foreground: #86efac;
    --border: #2d4a2d;
    --input: #2d4a2d;
    --ring: #22c55e;
    --highlight: #22c55e;
    --highlight-rgb: 34, 197, 94;
    --active-highlight: #22c55e;
    --explicit-badge: #f59e0b;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100%;
    position: fixed;
    width: 100%;
}

img {
    max-width: 100%;
    display: block;
    background-color: var(--muted);
    border: none;
}

a {
    color: inherit;
    text-decoration: none;
}

kbd {
    background-color: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-container {
    display: grid;
    height: 100vh;
    height: 100dvh;
    grid-template:
        "sidebar main" 1fr
        "player player" auto / 280px 1fr;
}

.sidebar {
    grid-area: sidebar;
    background-color: var(--background);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

.main-content {
    grid-area: main;
    overflow-y: auto;
    padding: var(--spacing-xl);
    scroll-behavior: smooth;
}

.now-playing-bar {
    grid-area: player;
    background-color: #050505;
    border-top: 1px solid var(--border);
    padding: var(--spacing-md) var(--spacing-lg);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: var(--spacing-xl);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sidebar-logo svg {
    width: 15px;
    height: 15px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
}

.sidebar-nav .nav-item a:hover {
    background-color: var(--secondary);
    color: var(--foreground);
}

.sidebar-nav .nav-item a.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.sidebar-nav .nav-item a svg {
    width: 20px;
    height: 20px;
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    backdrop-filter: blur(2px);
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    gap: var(--spacing-md);
}

.hamburger-menu {
    display: none;
    background: transparent;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background-color var(--transition);
}

.hamburger-menu:hover {
    background-color: var(--secondary);
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-bar svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    background-color: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 1rem;
    transition: border-color var(--transition);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--ring);
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

.content-section {
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
}

.search-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.search-tab {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    padding: var(--spacing-sm) var(--spacing-lg);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}

.search-tab:hover {
    color: var(--foreground);
}

.search-tab.active {
    color: var(--foreground);
    border-bottom-color: var(--highlight);
}

.search-tab-content {
    display: none;
}

.search-tab-content.active {
    display: block;
    animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-lg);
}

.card {
    display: block;
    background-color: var(--card);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all var(--transition);
}

.card:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.card-image {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: var(--muted);
    border-radius: calc(var(--radius) - 4px);
    object-fit: cover;
}

.card.artist .card-image {
    border-radius: 50%;
}

.card-image-wrapper .explicit-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.explicit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--explicit-badge);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 2px;
    margin-left: 0.5rem;
    vertical-align: middle;
    line-height: 1;
}

.track-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.track-list-header {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    color: var(--muted-foreground);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-xs);
}

.track-list-header .duration-header {
    justify-self: flex-end;
}

.track-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

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

.track-item.playing {
    background-color: rgba(var(--highlight-rgb), 0.15);
    border-left: 3px solid var(--highlight);
    padding-left: calc(var(--spacing-sm) - 3px);
}

.track-item.playing .track-number,
.track-item.playing .track-item-details .title {
    color: var(--highlight);
    font-weight: 600;
}

.track-number {
    color: var(--muted-foreground);
    text-align: center;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ensure that album cover fit*/
.track-number .track-item-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    display: block;
}

.track-item-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
}

.track-item-cover {
    width: 40px;
    height: 40px;
    background-color: var(--muted);
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.track-item-details .title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.track-item-details .artist {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-item-duration {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    justify-self: flex-end;
}

.track-menu-btn {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 10;
}

.track-item:hover .track-menu-btn {
    opacity: 1;
}

@media (hover: none) {
    .track-menu-btn {
        opacity: 1;
    }
}

.track-menu-btn:hover {
    background-color: var(--secondary);
    color: var(--foreground);
}

.detail-header {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
}

.detail-header-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    background-color: var(--muted);
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.3s ease-in-out;
}

.detail-header-image.loading {
    opacity: 0.3;
}

.detail-header-image.artist {
    border-radius: 50%;
}

.detail-header-info .type {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.detail-header-info .title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-header-info .meta {
    color: var(--muted-foreground);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-header-info .meta a {
    color: var(--foreground);
    text-decoration: none;
    transition: color var(--transition);
}

.detail-header-info .meta a:hover {
    color: var(--highlight);
}

.detail-header-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary svg {
    flex-shrink: 0;
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background-color: var(--secondary);
    color: var(--foreground);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-secondary:hover {
    background-color: var(--muted);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary.danger {
    background: #ef4444;
    color: #fff;
}

.btn-secondary.danger:hover {
    background: #dc2626;
}

.settings-list {
    max-width: 800px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--border);
    gap: var(--spacing-lg);
}

.setting-item .info {
    display: flex;
    flex-direction: column;
}

.setting-item .label {
    font-weight: 500;
}

.setting-item .description {
    font-size: 0.9rem;
    color: var(--muted-foreground);
}

.setting-item select,
.setting-item input[type="number"] {
    background-color: var(--input);
    color: var(--foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
}

.setting-item input[type="number"] {
    width: 100px;
}

.template-input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem;
    background-color: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.template-input:focus {
    outline: none;
    border-color: var(--ring);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--secondary);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: var(--foreground);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider::before {
    transform: translateX(16px);
    background-color: var(--primary-foreground);
}

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

.track-info .cover {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background-color: var(--muted);
    object-fit: cover;
    flex-shrink: 0;
}

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

.track-info .details .title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color var(--transition);
}

.track-info .details .title:hover {
    color: var(--highlight);
}

.track-info .details .artist {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color var(--transition);
}

.track-info .details .artist:hover {
    color: var(--highlight);
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.player-controls .buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.player-controls .buttons button {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    position: relative;
}

.player-controls .buttons button:hover {
    color: var(--foreground);
    background-color: var(--secondary);
}

.player-controls .buttons button.active {
    color: var(--active-highlight);
}

.player-controls .buttons button#repeat-btn.repeat-one::after {
    content: '1';
    position: absolute;
    font-size: 0.6rem;
    font-weight: bold;
    bottom: 4px;
    right: 6px;
}

.player-controls .buttons .play-pause-btn {
    background-color: var(--primary);
    color: var(--primary-foreground);
    width: 36px;
    height: 36px;
}

.player-controls .buttons .play-pause-btn:hover {
    transform: scale(1.05);
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.player-controls .progress-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.progress-bar,
.volume-bar {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: var(--secondary);
    border-radius: 3px;
    transition: height 0.2s ease;
}

.progress-bar:hover {
    height: 8px;
}

.progress-bar .progress-fill {
    width: 0;
    height: 100%;
    background-color: var(--foreground);
    border-radius: 3px;
    transition: background-color 0.2s ease;
    position: relative;
    pointer-events: none;
}

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

.progress-bar:hover .progress-fill::after,
.progress-bar:active .progress-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: var(--highlight);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
}

.volume-controls button {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-controls button:hover {
    color: var(--foreground);
    background-color: var(--secondary);
}

.volume-controls .volume-bar {
    width: 100px;
    height: 4px;
    background-color: var(--secondary);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.volume-controls .volume-bar:hover {
    height: 6px;
}

.volume-controls .volume-bar .volume-fill {
    width: var(--volume-level, 70%);
    height: 100%;
    background-color: var(--foreground);
    border-radius: 2px;
    transition: background-color 0.2s ease;
    position: relative;
    pointer-events: none;
}

.volume-controls .volume-bar:hover .volume-fill {
    background-color: var(--highlight);
}

.volume-controls .volume-bar:hover .volume-fill::after,
.volume-controls .volume-bar:active .volume-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: var(--highlight);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#context-menu,
.queue-track-menu {
    display: none;
    position: fixed;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 160px;
}

.queue-track-menu.show {
    display: block;
    z-index: 1001;
    min-width: 120px;
}

#context-menu ul,
.queue-track-menu ul {
    list-style: none;
}

#context-menu li,
.queue-track-menu li {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color var(--transition);
    font-size: 0.9rem;
}

#context-menu li:hover,
.queue-track-menu li:hover {
    background-color: var(--secondary);
}

#queue-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#queue-modal {
    background-color: var(--card);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

#queue-modal-header h3 {
    margin: 0;
}

#queue-modal-header button {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--transition);
}

#queue-modal-header button:hover {
    background-color: var(--secondary);
    color: var(--foreground);
}

#queue-list {
    overflow-y: auto;
    padding: 0.5rem;
}

.queue-track-item {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--radius);
    cursor: grab;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.queue-track-item:active {
    cursor: grabbing;
}

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

.queue-track-item.playing {
    background-color: rgba(var(--highlight-rgb), 0.15);
    border-left: 3px solid var(--highlight);
    padding-left: calc(var(--spacing-sm) - 3px);
}

.queue-track-item .drag-handle {
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}

.queue-track-item .track-menu-btn {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-track-item .track-menu-btn:hover {
    background-color: var(--muted);
    color: var(--foreground);
}

.placeholder-text {
    padding: 2rem 1rem;
    color: var(--muted-foreground);
    text-align: center;
}

.placeholder-text.loading {
    animation: pulse 1.5s infinite ease-in-out;
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--secondary) 0%,
        var(--muted) 50%,
        var(--secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

.skeleton-track {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    margin-bottom: 2px;
}

.skeleton-track-number {
    width: 24px;
    height: 20px;
    margin: 0 auto;
}

.skeleton-track-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
}

.skeleton-track-cover {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 4px;
}

.skeleton-track-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.skeleton-track-title {
    height: 16px;
    width: 60%;
    max-width: 200px;
}

.skeleton-track-artist {
    height: 14px;
    width: 40%;
    max-width: 150px;
}

.skeleton-track-duration {
    width: 40px;
    height: 14px;
}

.skeleton-card {
    background-color: var(--card);
    border-radius: var(--radius);
    padding: var(--spacing-md);
}

.skeleton-card-image {
    width: 100%;
    aspect-ratio: 1/1;
    margin-bottom: var(--spacing-md);
    border-radius: calc(var(--radius) - 4px);
}

.skeleton-card.artist .skeleton-card-image {
    border-radius: 50%;
}

.skeleton-card-title {
    height: 18px;
    width: 80%;
    margin-bottom: var(--spacing-xs);
}

.skeleton-card-subtitle {
    height: 14px;
    width: 60%;
}

.skeleton-container {
    width: 100%;
}

#api-instance-manager {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

#api-instance-list {
    list-style: none;
    margin-bottom: 1rem;
}

#api-instance-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: var(--secondary);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

#api-instance-list li .instance-url {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

#api-instance-list li .controls {
    display: flex;
    gap: 0.5rem;
}

#api-instance-list li button {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition);
}

#api-instance-list li button:hover {
    color: var(--foreground);
    background-color: var(--muted);
}

#api-instance-list li button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.theme-option {
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    font-weight: 500;
}

.theme-option:hover {
    border-color: var(--highlight);
    background-color: var(--secondary);
}

.theme-option.active {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.custom-theme-editor {
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--secondary);
    border-radius: var(--radius);
    display: none;
}

.custom-theme-editor.show {
    display: block;
}

.theme-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.theme-color-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.theme-color-input label {
    font-size: 0.9rem;
    color: var(--muted-foreground);
}

.theme-color-input input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}

.theme-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.about-content {
    padding: 1rem 0;
}

.about-description {
    color: var(--foreground);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.about-features,
.about-tech {
    margin-bottom: 1.5rem;
}

.about-features h4,
.about-tech h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--foreground);
}

.about-features ul {
    list-style: none;
    padding: 0;
}

.about-features li {
    padding: 0.5rem 0 0.5rem 1.5rem;
    position: relative;
    color: var(--foreground);
    line-height: 1.5;
}

.about-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--highlight);
    font-weight: bold;
}

.about-tech p {
    color: var(--muted-foreground);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.about-links {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--foreground);
    font-weight: 500;
    transition: all var(--transition);
}

.github-link:hover {
    background-color: var(--secondary);
    border-color: var(--highlight);
    transform: translateY(-2px);
}

.github-link svg {
    flex-shrink: 0;
}

.about-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.about-footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.about-footer .version {
    color: var(--foreground);
    font-weight: 600;
}

.about-footer .license {
    color: var(--muted-foreground);
}

.about-footer .disclaimer {
    color: var(--muted-foreground);
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: var(--secondary);
    border-radius: var(--radius);
    border-left: 3px solid var(--muted-foreground);
}

#download-notifications {
    position: fixed;
    bottom: 120px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.download-task {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.download-cancel:hover {
    background: var(--secondary) !important;
    color: var(--foreground) !important;
}

#lastfm-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.desktop-only {
    display: flex;
}

#cast-btn {
    position: relative;
}

#cast-btn.available {
    color: var(--highlight);
}

#cast-btn.available::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background-color: var(--highlight);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

#cast-btn.connected {
    color: #10b981;
}

#cast-btn.connected::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

#download-current-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.template-guide {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.template-guide th,
.template-guide td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.template-guide th {
    font-weight: 600;
    background-color: var(--secondary);
}

.template-guide code {
    background-color: var(--secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.offline-notification,
.update-notification,
.install-prompt {
    position: fixed;
    bottom: 130px;
    right: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 350px;
    animation: slideIn 0.3s ease;
}

.offline-notification svg {
    flex-shrink: 0;
    color: #f59e0b;
}

.update-notification,
.install-prompt {
    flex-direction: column;
    align-items: stretch;
}

.shortcuts-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.shortcuts-modal {
    background: var(--card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.2s ease;
}

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

.shortcuts-header h3 {
    margin: 0;
}

.close-shortcuts {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.close-shortcuts:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.shortcuts-content {
    padding: 1rem;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.shortcut-item:last-child {
    border-bottom: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 240px 1fr;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--spacing-md);
    }

    .detail-header-info .title {
        font-size: 3rem;
    }

    .main-content {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template:
            "header" auto
            "main" 1fr
            "player" auto / 1fr;
        height: 100vh;
        height: 100dvh;
    }

    .main-content {
        padding: var(--spacing-md);
        grid-area: main;
    }

    .main-header {
        grid-area: header;
        padding: var(--spacing-md) var(--spacing-md) 0;
        margin-bottom: var(--spacing-md);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .hamburger-menu {
        display: block;
    }

    #sidebar-overlay.is-visible {
        display: block;
    }

    .search-bar {
        max-width: none;
    }

    .content-section {
        margin-bottom: var(--spacing-xl);
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--spacing-md);
    }

    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-lg);
        padding-bottom: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    .detail-header-image {
        width: 150px;
        height: 150px;
    }

    .detail-header-info .title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .detail-header-info .meta {
        font-size: 0.85rem;
        gap: 0.35rem;
    }

    .detail-header-actions,
    .btn-primary {
        width: 100%;
    }

    .now-playing-bar {
        grid-template:
            "track controls" auto
            "progress progress" auto / 1fr auto;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
        height: auto;
    }

    .now-playing-bar .track-info {
        grid-area: track;
        min-width: 0;
    }

    .track-info {
        gap: var(--spacing-sm);
    }

    .track-info .cover {
        width: 48px;
        height: 48px;
    }

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

    .track-info .details .title {
        font-size: 0.9rem;
    }

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

    .now-playing-bar .volume-controls {
        grid-area: controls;
        display: flex;
        gap: 0.25rem;
        justify-content: flex-end;
    }

    .now-playing-bar .player-controls {
        grid-area: progress;
        width: 100%;
    }

    .player-controls .buttons {
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-xs);
    }

    .player-controls .buttons button {
        width: 28px;
        height: 28px;
    }

    .player-controls .buttons .play-pause-btn {
        width: 32px;
        height: 32px;
    }

    .player-controls .progress-container {
        max-width: none;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .desktop-only {
        display: none !important;
    }

    .volume-controls button:not(.desktop-only) {
        display: flex;
    }

    .volume-controls button {
        padding: 0.375rem;
        min-width: 32px;
        min-height: 32px;
    }

    .volume-controls button svg {
        width: 18px;
        height: 18px;
    }

    #download-notifications {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .track-menu-btn {
        opacity: 1;
    }

    .about-links {
        flex-direction: column;
    }

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

    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .setting-item .info {
        width: 100%;
    }

    .template-input {
        max-width: none;
        font-size: 0.85rem;
    }

    .track-item {
        grid-template-columns: 28px 1fr 45px 32px;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .track-number {
        font-size: 0.8rem;
        width: 28px;
    }

    .track-item-info {
        gap: var(--spacing-sm);
        min-width: 0;
        overflow: hidden;
    }

    .track-item-cover {
        width: 36px;
        height: 36px;
    }

    .track-item-details {
        min-width: 0;
        overflow: hidden;
    }

    .track-item-details .title {
        font-size: 0.85rem;
    }

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

    .track-item-duration {
        font-size: 0.75rem;
        text-align: right;
        white-space: nowrap;
    }

    .track-menu-btn {
        padding: 0.5rem;
        margin: 0;
    }

    .track-menu-btn svg {
        width: 18px;
        height: 18px;
    }

    .queue-track-item {
        grid-template-columns: 24px 1fr 40px 28px;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .queue-track-item .drag-handle {
        width: 24px;
    }

    .queue-track-item .drag-handle svg {
        width: 14px;
        height: 14px;
    }

    .queue-track-item .track-item-cover {
        width: 36px;
        height: 36px;
    }

    .queue-track-item .track-menu-btn {
        padding: 0.5rem;
    }

    .sidebar-nav .nav-item a {
        padding: 1rem 0.75rem;
    }

    .offline-notification,
    .update-notification,
    .install-prompt {
        left: 10px;
        right: 10px;
        max-width: none;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--spacing-sm);
    }

    .section-title {
        font-size: 1.25rem;
    }

    .detail-header-info .title {
        font-size: 1.75rem;
    }

    .search-tab {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }

    .player-controls .buttons {
        gap: 0.25rem;
    }

    .player-controls .buttons button {
        width: 24px;
        height: 24px;
    }

    .player-controls .buttons button svg {
        width: 16px;
        height: 16px;
    }

    .player-controls .buttons .play-pause-btn {
        width: 28px;
        height: 28px;
    }

    .player-controls .buttons .play-pause-btn svg {
        width: 18px;
        height: 18px;
    }

    .volume-controls button {
        padding: 0.25rem;
        min-width: 28px;
        min-height: 28px;
    }

    .volume-controls button svg {
        width: 16px;
        height: 16px;
    }

    .track-item {
        grid-template-columns: 24px 1fr 40px 28px;
        gap: 0.375rem;
        padding: 0.5rem;
    }

    .track-number {
        font-size: 0.75rem;
        width: 24px;
    }

    .track-item-cover {
        width: 32px;
        height: 32px;
    }

    .track-item-details .title {
        font-size: 0.8rem;
    }

    .track-item-details .artist {
        font-size: 0.7rem;
    }

    .track-item-duration {
        font-size: 0.7rem;
    }

    .track-menu-btn {
        padding: 0.25rem;
    }

    .track-menu-btn svg {
        width: 16px;
        height: 16px;
    }

    .queue-track-item {
        grid-template-columns: 20px 1fr 36px 24px;
        gap: 0.375rem;
        padding: 0.5rem;
    }

    .queue-track-item .drag-handle {
        width: 20px;
    }

    .queue-track-item .track-item-cover {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 360px) {
    .player-controls .buttons {
        justify-content: space-between;
        width: 100%;
    }

    #shuffle-btn,
    #repeat-btn {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .now-playing-bar {
        grid-template-columns: 1fr 2fr auto;
        padding: var(--spacing-md);
    }

    .volume-controls {
        display: flex;
    }

    .desktop-only {
        display: flex;
    }
}

@media (min-width: 1440px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1920px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (hover: none) and (pointer: coarse) {
    .progress-bar,
    .volume-bar {
        height: 8px;
    }

    .progress-bar .progress-fill::after,
    .volume-bar .volume-fill::after {
        content: '';
        position: absolute;
        right: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        background-color: var(--highlight);
        border-radius: 50%;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }

    .track-item,
    .queue-track-item {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    button {
        min-height: 44px;
        min-width: 44px;
    }

    .player-controls .buttons button {
        min-height: 36px;
        min-width: 36px;
    }
}

@supports (padding-top: env(safe-area-inset-top)) {
    .main-header {
        padding-top: max(var(--spacing-md), env(safe-area-inset-top));
    }

    .now-playing-bar {
        padding-bottom: max(var(--spacing-md), env(safe-area-inset-bottom));
    }

    .sidebar {
        padding-top: max(1.5rem, env(safe-area-inset-top));
    }
}
/* Lyrics Panel */
.lyrics-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: var(--card);
    border-left: 1px solid var(--border);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
}

.lyrics-panel:not(.hidden) {
    transform: translateX(0);
}

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

.lyrics-header h3 {
    margin: 0;
}

.lyrics-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.lyrics-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

.lyrics-line {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: var(--foreground);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Synced lyrics styling with Apple Music animations */
.synced-line {
    padding: 0.5rem 0;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--muted-foreground);
    opacity: 0.5;
    transform: scale(0.95);
    filter: blur(0.5px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.synced-line.active {
    color: var(--highlight);
    font-weight: 600;
    font-size: 1.25rem;
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
    text-shadow: 0 0 20px rgba(var(--highlight-rgb), 0.3);
}

.synced-line.upcoming {
    opacity: 0.7;
    transform: scale(0.98);
    filter: blur(0.3px);
}

.synced-line.past {
    opacity: 0.3;
    transform: scale(0.93);
    filter: blur(1px);
}

.lyrics-loading,
.lyrics-error {
    text-align: center;
    padding: 2rem;
    color: var(--muted-foreground);
}

/* Karaoke View */
.karaoke-view {
    position: fixed;
    inset: 0;
    background: var(--background);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.karaoke-header {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
}

.karaoke-track-info {
    text-align: center;
    padding: 2rem 1rem;
}

.karaoke-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.karaoke-artist {
    font-size: 1.25rem;
    color: var(--muted-foreground);
}

.karaoke-lyrics-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    scroll-behavior: smooth;
}

.karaoke-line {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--muted-foreground);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    max-width: 800px;
    opacity: 0.35;
    transform: scale(0.92);
    filter: blur(1px);
    padding: 0.5rem 1rem;
}

.karaoke-line.active {
    color: var(--highlight);
    font-size: 2.25rem;
    font-weight: 700;
    opacity: 1;
    transform: scale(1.05);
    filter: blur(0);
    text-shadow: 0 0 30px rgba(var(--highlight-rgb), 0.4),
                 0 0 60px rgba(var(--highlight-rgb), 0.2);
    letter-spacing: 0.02em;
}

.karaoke-line.upcoming {
    opacity: 0.55;
    transform: scale(0.96);
    filter: blur(0.5px);
}

.karaoke-line.past {
    opacity: 0.25;
    transform: scale(0.88);
    filter: blur(1.5px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .lyrics-panel {
        width: 100vw;
    }

    .synced-line {
        font-size: 1rem;
    }

    .synced-line.active {
        font-size: 1.125rem;
    }

    .karaoke-title {
        font-size: 1.5rem;
    }

    .karaoke-artist {
        font-size: 1rem;
    }

    .karaoke-line {
        font-size: 1.25rem;
    }

    .karaoke-line.active {
        font-size: 1.75rem;
    }
}

/* Clickable album cover indicator */
.now-playing-bar .cover {
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.now-playing-bar .cover:hover {
    transform: scale(1.05);
}

.now-playing-bar .cover::after {
    content: '🎵';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity var(--transition);
    font-size: 1.5rem;
}

.now-playing-bar .cover:hover::after {
    opacity: 1;
}
#page-playlist .detail-header {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
}

#playlist-detail-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    background-color: var(--muted);
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    transition: opacity 0.3s ease-in-out;
}

#playlist-detail-image.loading {
    opacity: 0.3;
}

#page-playlist .detail-info {
    flex: 1;
    min-width: 0;
}

#page-playlist .detail-info .type {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--muted-foreground);
}

#playlist-detail-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#playlist-detail-meta {
    color: var(--muted-foreground);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#playlist-detail-description {
    color: var(--foreground);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 1rem;
    max-width: 600px;
}

#page-playlist .detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

#play-playlist-btn,
#download-playlist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

#play-playlist-btn {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

#download-playlist-btn {
    background-color: var(--secondary);
    color: var(--foreground);
}

#play-playlist-btn:hover,
#download-playlist-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

#play-playlist-btn:disabled,
#download-playlist-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#play-playlist-btn svg,
#download-playlist-btn svg {
    flex-shrink: 0;
}

#playlist-detail-tracklist {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#playlist-detail-tracklist .track-list-header {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    color: var(--muted-foreground);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-xs);
}

#playlist-detail-tracklist .track-list-header .duration-header {
    justify-self: flex-end;
}

@media (max-width: 768px) {
    #page-playlist .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-lg);
        padding-bottom: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }

    #playlist-detail-image {
        width: 150px;
        height: 150px;
    }

    #playlist-detail-title {
        font-size: 2rem;
        line-height: 1.2;
    }

    #playlist-detail-meta {
        font-size: 0.85rem;
        gap: 0.35rem;
    }

    #playlist-detail-description {
        font-size: 0.85rem;
        max-width: none;
    }

    #page-playlist .detail-actions {
        width: 100%;
        flex-direction: column;
    }

    #play-playlist-btn,
    #download-playlist-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #playlist-detail-title {
        font-size: 1.75rem;
    }
}

@media (min-width: 1024px) {
    #playlist-detail-title {
        font-size: 4rem;
    }
}
