/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    font-family: 'Inter', sans-serif;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    line-height: 1;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

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

button {
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

i {
    line-height: 1;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* vars */
:root {
    --primary-color: #000;
    --secondary-color: #fff;
    --tertiary-color: #a1a1a1;
    --bg-color: #fff;
    --bg-color-rgb: 255, 255, 255;
    --text-color: #000;
    --border-color: #a1a1a1;
    --hover-bg: #f5f5f5;
    --info-bg: #f9f9f9;
    --selected-color: #000000;

    /* Element Family Colors */
    --color-one: #d8e48b;
    --color-two: #60836c;
    --color-three: #CEB6B6;
    --color-four: #0c2553;
    --color-five: #756CAB;
    --color-six: hsl(68, 33%, 32%);
    --color-seven: #445177;
    --color-eight: #7870d1;
    --color-nine: #A95766;
    --color-ten: #523c57;
    --color-eleven: #C4C4C4;
    --color-twelve: #406170;
    --color-thirteen: #767B79;
    --color-fourteen: #add0be;
    --color-fifteen: #635D2E;
    --color-sixteen: #474F3E;
    --color-seventeen: #424A4B;
    --color-eighteen: #7C372E;
    --color-nineteen: #3D748E;
    --color-twenty: #F1D034;
    --color-twenty-one: #61BC59;
    --color-twenty-two: #34BDAF;
    --color-twenty-three: #7FD3B9;
    --color-twenty-four: #243749;
    --color-twenty-five: #18B37F;
    --color-twenty-six: #7E574A;
    --color-twenty-seven: #8F846E;
    --color-twenty-eight: #1D4C66;
    --color-twenty-nine: #266559;
    --color-thirty: #F9F8B8;
    --unknown: #a4b0be;
}

[data-theme="dark"] {
    --primary-color: #fff;
    --secondary-color: #1a1a1a;
    --tertiary-color: #666;
    --bg-color: #1a1a1a;
    --bg-color-rgb: 26, 26, 26;
    --text-color: #fff;
    --border-color: #666;
    --hover-bg: #333;
    --info-bg: #2a2a2a;
    --selected-color: #ffffff;

    /* Element Family Colors - Dark Theme */
    --color-one: #2B1E26;
    --color-two: #60836c;
    --color-three: #CEB6B6;
    --color-four: #20191A;
    --color-five: #756CAB;
    --color-six: #4d1717;
    --color-seven: #445177;
    --color-eight: #D17770;
    --color-nine: #A95766;
    --color-ten: #523c57;
    --color-eleven: #C4C4C4;
    --color-twelve: #406170;
    --color-thirteen: #767B79;
    --color-fourteen: #add0be;
    --color-fifteen: #635D2E;
    --color-sixteen: #474F3E;
    --color-seventeen: #424A4B;
    --color-eighteen: #7C372E;
    --color-nineteen: #3D748E;
    --color-twenty: #F1D034;
    --color-twenty-one: #61BC59;
    --color-twenty-two: #34BDAF;
    --color-twenty-three: #7FD3B9;
    --color-twenty-four: #243749;
    --color-twenty-five: #18B37F;
    --color-twenty-six: #7E574A;
    --color-twenty-seven: #8F846E;
    --color-twenty-eight: #1D4C66;
    --color-twenty-nine: #266559;
    --color-thirty: #F9F8B8;
    --unknown: #a4b0be;
}

.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    padding: 5px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    position: relative;
}

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

.logo {
    width: 25px;
    height: 25px;
    max-width: 25px;
    max-height: 25px;
}

.search-container {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.search-container.active {
    opacity: 1;
    visibility: visible;
}

.search-container.active ~ #header-title {
    opacity: 0;
    visibility: hidden;
}

#search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    outline: none;
}

#search-input:focus {
    outline: none;
}

.search-toggle, .search-close {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.search-toggle:hover, .search-close:hover {
    background-color: var(--hover-bg);
}

#header-title {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: var(--tertiary-color);
    font-style: italic;
}

.canvas-section {
    position: relative;
}

.canvas-tooltip {
    position: fixed;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 250px;
}

.tooltip-artwork {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.tooltip-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tooltip-artist {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooltip-element {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.canvas-legend-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    background: rgba(var(--bg-color-rgb), 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    z-index: 10;
    pointer-events: auto;
}

.legend-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-color);
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.legend-item:hover {
    background-color: var(--hover-bg);
    transform: scale(1.05);
}

.legend-item.active {
    background-color: var(--selected-color);
    color: var(--bg-color);
}

.legend-item.active::after {
    content: '×';
    margin-left: 8px;
    font-size: 16px;
    font-weight: bold;
    opacity: 0.8;
}

.legend-item.dimmed {
    opacity: 0.4;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-color.alkali-metal { background-color: var(--family-alkali-metal); }
.legend-color.alkaline-earth-metal { background-color: var(--family-alkaline-earth-metal); }
.legend-color.transition-metal { background-color: var(--family-transition-metal); }
.legend-color.post-transition-metal { background-color: var(--family-post-transition-metal); }
.legend-color.metalloid { background-color: var(--family-metalloid); }
.legend-color.diatomic-nonmetal { background-color: var(--family-diatomic-nonmetal); }
.legend-color.polyatomic-nonmetal { background-color: var(--family-polyatomic-nonmetal); }
.legend-color.noble-gas { background-color: var(--family-noble-gas); }
.legend-color.lanthanide { background-color: var(--family-lanthanide); }
.legend-color.actinide { background-color: var(--family-actinide); }

.theme-toggle {
    background: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
}

.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-player {
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 5px;
    flex-shrink: 0;
}

.player-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 5px;
    color: var(--text-color);
}

.player-track-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.track-artwork {
    width: 40px;
    height: 40px;
    background: var(--hover-bg);
    overflow: hidden;
}

.track-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.track-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.track-artist {
    font-size: 12px;
    color: var(--tertiary-color);
}

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

.control-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.1s ease;
}

.control-btn:hover {
    background-color: var(--hover-bg);
}

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

.time-current, .time-total {
    font-size: 12px;
    color: var(--tertiary-color);
    min-width: 50px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--hover-bg);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: #ee2483;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: -6px;
    left: 0%;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transform: translateX(-50%);
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 4px;
    transition: background-color 0.1s ease;
}

.action-btn:hover {
    background-color: var(--hover-bg);
}

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

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--hover-bg);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-color);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--text-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.sidebar {
    width: 400px;
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--tertiary-color);
}

.sidebar ul {
    list-style: none;
}

.sidebar li a {
    display: block;
    position: relative;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.1s ease;
    min-height: 200px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar li a:hover {
    background-color: var(--hover-bg);
}

.sidebar li a.active {
    background-color: transparent;
}

.element-info-left {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    width: 100%;
    height: 200px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, #1a1a1a, transparent);
    color: #fff;
}

.element-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.element-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.element-number {
    font-weight: 600;
    font-size: 16px;
}

.element-symbol {
    font-size: 16px;
    font-weight: 600;
}

.symbol-bold {
    font-weight: 600;
}

.artist-name {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.sidebar li a.active .artist-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    margin-right: 6px;
}

.element-name {
    font-size: 14px;
    font-weight: 500;
    text-align: right;
}

.element-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transform: scale(1.5);
    position: relative;
    z-index: 0;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar li a:hover .element-image {
        animation: floatEntry 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards, float 4s ease-in-out 0.8s infinite;
    }
}

@keyframes floatEntry {
    0% {
        transform: scale(1.5) translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: scale(1.55) translateY(-3px) translateX(0);
        opacity: 0.85;
    }
}

@keyframes float {
    0%, 100% {
        transform: scale(1.55) translateY(-3px) translateX(0);
        opacity: 0.85;
    }
    33% {
        transform: scale(1.55) translateY(-5px) translateX(2px);
        opacity: 0.82;
    }
    66% {
        transform: scale(1.55) translateY(-1px) translateX(-2px);
        opacity: 0.88;
    }
}

.element-image-placeholder {
    width: 100%;
    height: 200px;
    background-color: var(--hover-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: block;
    position: relative;
    z-index: 0;
}

/* Now Playing Badge */
.now-playing-badge {
    position: absolute;
    top: 5px;
    left: calc(50% - 30px);
    background: var(--selected-color);
    color: var(--bg-color);
    font-size: 8px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    animation: pulse 2s infinite;
}

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

.element-hover-actions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 12px;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar li a:hover .element-hover-actions {
        opacity: 1;
        pointer-events: auto;
    }
}

.element-action-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.1s ease;
    font-size: 16px;
}

.element-action-btn:hover {
    background-color: var(--hover-bg);
}

.element-action-btn:active {
    opacity: 0.7;
}

.sidebar li {
    position: relative;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--tertiary-color);
}

.canvas-section {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    order: 1;
}

.audio-section {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-height: 200px;
    background: rgba(var(--bg-color-rgb), 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    order: 2;
}

#main-canvas {
    width: 100%;
    height: 100%;
}

.element-info {
    margin-top: 5px;
}

.element-info h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.element-info p {
    margin-bottom: 5px;
    line-height: 1.6;
}

.element-info strong {
    font-weight: 600;
}

.bio, .summary {
    margin-top: 5px;
    padding: 5px;
    background-color: var(--info-bg);
    border-radius: 6px;
    border-left: 3px solid var(--border-color);
}

.bio h4, .summary h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.artist-main {
    display: flex;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.artist-main-left {
    width: 80%;
    display: flex;
    flex-direction: column;
}

.artist-main-content {
    flex: 1;
    display: flex;
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.artist-main-content::-webkit-scrollbar {
    width: 4px;
}

.artist-main-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

.artist-main-controls {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: rgba(var(--bg-color-rgb), 0.5);
    backdrop-filter: blur(10px);
}

.artist-main-right {
    width: 30%;
    min-width: 180px;
    padding: 12px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.artist-main-right::-webkit-scrollbar {
    width: 4px;
}

.artist-main-right::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

.cover-large {
    flex-shrink: 0;
}

.cover-large img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cover-large img:hover {
    transform: scale(1.05);
}

.artist-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.artist-title h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    color: var(--text-color);
}

.artist-title p {
    font-size: 11px;
    color: var(--tertiary-color);
    margin: 4px 0 0 0;
    font-weight: 500;
}

.artist-title .element-summary {
    display: none;
}

.element-info-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.element-info-panel .element-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.element-info-panel .element-symbol {
    font-size: 9px;
    color: var(--tertiary-color);
    font-weight: 500;
}

.element-info-panel .element-description {
    font-size: 12px;
    line-height: 1.3;
    color: var(--tertiary-color);
    margin: 4px 0 8px 0;
}

.artist-bio {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.artist-bio::-webkit-scrollbar {
    width: 4px;
}

.artist-bio::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

.artist-bio p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    margin: 0;
}

.play-link, .play-set-link, .play-pause-link, .add-to-queue-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 11px;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.play-link:hover, .play-set-link:hover, .play-pause-link:hover, .add-to-queue-link:hover {
    background-color: var(--selected-color);
    color: var(--bg-color);
    border-color: var(--selected-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wiki-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 10px;
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    margin-top: auto;
}

.wiki-link:hover {
    background-color: var(--selected-color);
    color: var(--bg-color);
    border-color: var(--selected-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Queue Popup Styles */
.queue-popup {
    position: fixed;
    bottom: 70px;
    right: 10px;
    width: 350px;
    max-height: 500px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.queue-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.queue-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.queue-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.queue-close:hover {
    background-color: var(--hover-color);
}

.queue-content {
    max-height: 400px;
    overflow-y: auto;
}

.queue-list {
    padding: 10px 0;
}

.queue-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.queue-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    cursor: pointer;
    gap: 10px;
}

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

.queue-item.current {
    background-color: rgba(var(--selected-color-rgb), 0.1);
    border-left: 3px solid var(--selected-color);
}

.queue-item-number {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
}

.queue-item-image {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.queue-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item-placeholder {
    width: 100%;
    height: 100%;
    background: var(--hover-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
}

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

.queue-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-duration {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-family: monospace;
}

.queue-item-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0;
}

.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-remove:hover {
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff4444;
}

.queue-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

.queue-action-btn {
    width: 100%;
    padding: 8px 16px;
    background: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.queue-action-btn:hover {
    background: var(--selected-color);
    color: var(--bg-color);
}

/* Dark theme adjustments */
[data-theme="dark"] .queue-popup {
    background: rgba(30, 30, 30, 0.95);
    border-color: #444;
}

[data-theme="dark"] .queue-header {
    border-bottom-color: #444;
}

[data-theme="dark"] .queue-item {
    border-bottom-color: #333;
}

[data-theme="dark"] .queue-actions {
    border-top-color: #444;
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 10001;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.info-toggle {
    background: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
}

.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.info-modal.active {
    display: flex;
}

.info-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.info-modal-content {
    position: relative;
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    background: var(--bg-color);
    border-radius: 12px;
    overflow-y: auto;
    z-index: 10001;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.info-modal-body {
    padding: 40px 30px 30px 30px;
    color: var(--text-color);
}

.info-modal-body h2 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 600;
}

.info-modal-body h3 {
    margin: 24px 0 12px 0;
    font-size: 18px;
    font-weight: 600;
}

.info-modal-body p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    font-size: 14px;
}

.info-contact {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.info-contact h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--selected-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-submit {
    padding: 10px 20px;
    background: var(--selected-color);
    color: var(--bg-color);
    border: 1px solid var(--selected-color);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.form-submit:active {
    transform: translateY(0);
}

.form-message {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 16px;
}

.form-message.success {
    background: rgba(24, 179, 127, 0.1);
    border: 1px solid #18B37F;
    color: #18B37F;
}

.form-message.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
}

.info-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.info-footer p {
    margin: 8px 0;
    font-size: 13px;
}

.info-footer a {
    color: var(--text-color);
    text-decoration: underline;
}

.info-footer a:hover {
    opacity: 0.7;
}

.info-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.info-modal-close:hover {
    transform: scale(1.1);
}

.menu-toggle {
    display: none;
    background: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background-color: var(--hover-bg);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .app-layout {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    .app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .app-main {
        margin-left: 0;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        margin-top: 36px;
        margin-bottom: 70px;
    }

    .main-content {
        order: 1;
        flex: 0 0 auto;
        position: fixed;
        top: 36px;
        left: 0;
        right: 0;
        z-index: 50;
    }

    .canvas-section {
        height: 180px;
    }

    .canvas-legend-overlay {
        display: none;
    }

    .audio-section {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        max-height: none;
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        flex: 0 0 auto;
        order: 0;
    }

    .sidebar {
        position: fixed;
        top: 325px;
        left: 0;
        right: 0;
        bottom: 70px;
        width: 100%;
        height: auto;
        border-right: none;
        border-top: 1px solid var(--border-color);
        overflow-y: auto;
        order: 2;
    }

    .sidebar li a {
        min-height: 125px;
    }

    .element-info-left {
        height: 125px;
    }

    .element-image {
        height: 125px;
    }

    .element-image-placeholder {
        height: 125px;
    }

    .app-player {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .artist-main {
        flex-direction: column;
    }

    .artist-main-left {
        width: 100%;
    }

    .artist-main-right {
        display: none;
    }

    .artist-main-content {
        padding: 8px 12px;
        gap: 10px;
        flex-direction: row;
        align-items: center;
    }

    .cover-large {
        flex-shrink: 0;
    }

    .cover-large img {
        width: 50px;
        height: 50px;
    }

    .artist-content {
        flex: 1;
        min-width: 0;
    }

    .artist-title h1 {
        font-size: 13px;
        line-height: 1.2;
        margin: 0;
    }

    .artist-title p {
        font-size: 10px;
        margin: 2px 0 0 0;
    }

    .artist-bio {
        display: none;
    }

    .artist-bio p {
        display: none;
    }

    .artist-main-controls {
        padding: 8px 12px 10px 12px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .play-set-link, .play-pause-link, .add-to-queue-link, .play-link {
        font-size: 10px;
        padding: 6px 10px;
        flex: 1 1 auto;
        min-width: 100px;
        justify-content: center;
    }

    .player-content {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 10px 12px;
        align-items: center;
    }

    .player-track-info {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

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

    .track-title {
        font-size: 12px;
    }

    .track-artist {
        font-size: 10px;
    }

    .player-actions {
        grid-column: 2;
        grid-row: 1;
        gap: 4px;
    }

    .action-btn {
        padding: 8px;
        font-size: 16px;
    }

    .control-btn {
        padding: 8px 12px;
        font-size: 16px;
    }

    .player-controls {
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 6px;
    }

    .progress-container {
        gap: 6px;
    }

    .time-current, .time-total {
        font-size: 9px;
        min-width: 38px;
    }

    .progress-bar {
        height: 4px;
    }

    .progress-fill {
        height: 100%;
    }

    .progress-handle {
        width: 16px;
        height: 16px;
        top: -6px;
    }

    .queue-popup {
        width: 90%;
        right: 5%;
        bottom: 60px;
    }
}

@media (max-width: 480px) {
    .header-left {
        gap: 8px;
    }

    .logo {
        width: 20px;
        height: 20px;
        max-width: 20px;
        max-height: 20px;
    }

    #header-title {
        font-size: 14px;
    }

    .canvas-legend-overlay {
        display: none;
    }

    .canvas-section {
        height: 180px;
    }

    .artist-main-content {
        padding: 6px 10px;
        gap: 8px;
    }

    .cover-large img {
        width: 45px;
        height: 45px;
    }

    .artist-title h1 {
        font-size: 12px;
    }

    .artist-title p {
        font-size: 9px;
    }

    .artist-main-controls {
        padding: 6px 10px 8px 10px;
        gap: 5px;
    }

    .play-set-link, .play-pause-link, .add-to-queue-link, .play-link {
        font-size: 9px;
        padding: 5px 8px;
        min-width: 90px;
    }

    .player-content {
        padding: 8px 10px;
        gap: 6px;
    }

    .track-artwork {
        width: 36px;
        height: 36px;
    }

    .track-title {
        font-size: 11px;
    }

    .track-artist {
        font-size: 9px;
    }

    .action-btn {
        padding: 6px;
        font-size: 14px;
    }

    .control-btn {
        padding: 6px 10px;
        font-size: 14px;
    }

    .time-current, .time-total {
        font-size: 8px;
        min-width: 36px;
    }

    .progress-bar {
        height: 3px;
    }

    .progress-handle {
        width: 14px;
        height: 14px;
        top: -5.5px;
    }
}|
