:root {
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #e0e0e0;
    --text-main: #f0f0f0;
    --text-muted: #888;
    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow: hidden;
    background-color: #050505;
    font-family: var(--font-sans);
    color: var(--text-main);
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* UI Container - Minimalist Floating */
#ui-container {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 10;
    width: 320px;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.glass-panel {
    background: transparent; /* Remove heavy background */
    backdrop-filter: blur(0px); /* Initially clear */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0;
}

/* Hover State: Reveal background for readability */
#ui-container:hover .glass-panel {
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Header Typography */
h1 {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -1px;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 40px;
    opacity: 0.8;
}

/* Hide complex controls when not hovering */
#ui-container:not(:hover) .controls,
#ui-container:not(:hover) .upload-section,
#ui-container:not(:hover) .netease-panel,
#ui-container:not(:hover) #theme-select,
#ui-container:not(:hover) .tabs,
#ui-container:not(:hover) .progress-container,
#ui-container:not(:hover) .playlist-container {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

/* Controls Transition */
.controls, .upload-section, .netease-panel, #theme-select, .tabs, .progress-container, .playlist-container {
    transition: all 0.3s ease;
    transform: translateY(0);
}

/* Theme Selector */
select.theme-selector {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 0;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    cursor: pointer;
    margin-bottom: 30px;
    outline: none;
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 8px;
}

option {
    background: #111;
    color: #fff;
    padding: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px 10px;
    transition: all 0.2s;
    border-radius: 4px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    color: var(--accent);
    font-weight: bold;
    background: rgba(255,255,255,0.1);
}

.tab-content {
    display: none;
    animation: fadeContent 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Playback Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    position: relative; /* Ensure context for absolute children if needed, though we will fix volume */
}

.icon-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white;
    font-size: 1rem;
}

.icon-btn.small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
    border-color: rgba(255,255,255,0.1);
}

.icon-btn:hover {
    background: white;
    color: black;
    border-color: white;
    transform: scale(1.1);
}

.volume-control {
    /* Removed absolute positioning to fix layout bug */
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100px;
    margin-left: 10px; /* Separate from playback buttons */
}
.volume-control .icon { font-size: 0.8rem; }

/* Progress Bar */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.time-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    width: 35px;
    text-align: center;
}

/* Common Range Input Styles */
input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* Playlist */
.playlist-container {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Custom Scrollbar */
.playlist-container::-webkit-scrollbar { width: 4px; }
.playlist-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.playlist-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.playlist-header {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 0 5px;
}

.playlist {
    list-style: none;
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.playlist-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.playlist-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--accent);
    font-weight: 500;
}

.playlist-item.active .song-title::before {
    content: "▶ ";
    font-size: 0.7rem;
}

.song-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.song-duration {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Upload & Buttons */
.upload-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-bottom: 20px;
}

.custom-file-upload {
    display: block;
    padding: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.8rem;
    transition: all 0.2s;
    text-align: center;
    color: var(--text-muted);
}

.custom-file-upload:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: white;
    color: white;
}

input[type="file"] { display: none; }

#track-name {
    margin-top: 10px;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    text-align: center;
}

/* Netease Panel */
.netease-panel {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}

.netease-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.netease-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 0;
    flex: 1;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.3s;
}

.netease-input:focus {
    border-bottom-color: white;
}

.netease-btn {
    background: white;
    color: black;
    border: none;
    border-radius: 2px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s;
}

.netease-btn:hover {
    transform: translateY(-1px);
}

.netease-frame-container {
    margin-top: 15px;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.netease-frame-container:hover { opacity: 1; }

.tips {
    font-size: 0.7rem;
    color: #666;
    margin-top: 10px;
    line-height: 1.5;
}
