@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
  --bg:         #0d0d0d;
  --bg2:        #111111;
  --bg3:        #161616;
  --border:     #2a2a2a;
  --border2:    #333333;
  --fg:         #c8c8c8;
  --fg-dim:     #555555;
  --fg-dimmer:  #333333;
  --accent:     #EAAC34;
  --accent2:    #b8891a;
  --accent-dim: #352606;
  --green:      #EAAC34;
  --green-dim:  #352606;
  --red:        #e85858;
  --font:       'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  --radius:     2px;
  --titlebar-h: 36px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 13px; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Splash Screen ── */
#splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.4s ease;
}
#splash.hidden {
  opacity: 0;
  pointer-events: none;
}
#splash-logo {
  display: none;
}
#splash-canvas {
  display: block;
  width: 100%;
  max-width: 640px;
}
#splash-hint {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  font-family: var(--font);
  transition: opacity 0.3s;
}
.splash-arrow { color: var(--accent); margin-right: 4px; }

/* ── Titlebar ── */
#titlebar {
  height: var(--titlebar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  -webkit-app-region: drag;
  user-select: none;
  flex-shrink: 0;
}
#titlebar-controls { display: flex; gap: 7px; -webkit-app-region: no-drag; }
.tb-btn {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: filter .15s, box-shadow .15s;
  outline: none;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(234,172,52,0.4);
}
.tb-btn:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 10px rgba(234,172,52,0.7);
}
#titlebar-right { display: flex; justify-content: flex-end; -webkit-app-region: no-drag; }
.tb-icon-btn { background: transparent; border: none; color: var(--fg-dim); font-size: 14px; cursor: pointer; padding: 2px 4px; border-radius: var(--radius); transition: color .15s; -webkit-app-region: no-drag; }
.tb-icon-btn:hover { color: var(--accent); }

/* ── Layout ── */
#app { display: flex; height: calc(100vh - var(--titlebar-h)); overflow: hidden; }

/* ── Playlist Panel ── */
#playlist-panel {
  width: 300px;
  min-width: 220px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Panel Logo ── */
#panel-logo {
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#panel-logo-pre {
  font-family: var(--font);
  font-size: 9.5px;
  line-height: 1.8;
  white-space: pre;
  text-align: center;
  transform-origin: center center;
}

/* ── Search Area ── */
#search-area {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#search-box {
  display: flex;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 0 8px;
  gap: 6px;
  transition: border-color .15s;
}
#search-box:focus-within { border-color: var(--accent); }
.search-icon { font-size: 14px; color: var(--fg-dim); flex-shrink: 0; }
#search-input { flex: 1; background: transparent; border: none; outline: none; font-family: var(--font); font-size: 12px; color: var(--fg); padding: 7px 0; }
#search-input::placeholder { color: var(--fg-dimmer); }
#btn-clear-search { background: transparent; border: none; color: var(--fg-dimmer); font-size: 11px; cursor: pointer; padding: 2px; line-height: 1; border-radius: var(--radius); transition: color .12s; }
#btn-clear-search:hover { color: var(--red); }

/* ── No Root Prompt ── */
#no-root { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 20px; gap: 10px; }
.empty-art pre { color: var(--fg-dimmer); font-size: 11px; line-height: 1.4; text-align: center; }
.empty-hint { font-size: 11px; color: var(--fg-dimmer); text-align: center; }

/* ── Search Results ── */
#search-results { flex-shrink: 0; max-height: 45%; overflow-y: auto; border-bottom: 1px solid var(--border); }
.sr-section-label { font-size: 9px; letter-spacing: .14em; color: var(--fg-dimmer); padding: 6px 12px 3px; text-transform: uppercase; }
.sr-item { display: flex; align-items: center; padding: 5px 10px; cursor: pointer; gap: 8px; border-left: 2px solid transparent; transition: all .1s; }
.sr-item:hover { background: var(--bg3); border-left-color: var(--border2); }
.sr-icon { font-size: 11px; color: var(--fg-dimmer); flex-shrink: 0; width: 14px; text-align: center; }
.sr-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--fg); }
.sr-meta { font-size: 10px; color: var(--fg-dimmer); flex-shrink: 0; }
.sr-sub { font-size: 10px; color: var(--fg-dimmer); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.sr-add-btn { background: transparent; border: 1px solid var(--border2); color: var(--fg-dimmer); font-family: var(--font); font-size: 9px; padding: 2px 6px; border-radius: var(--radius); cursor: pointer; transition: all .12s; flex-shrink: 0; opacity: 0; }
.sr-item:hover .sr-add-btn { opacity: 1; }
.sr-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.sr-empty { font-size: 11px; color: var(--fg-dimmer); padding: 10px 12px; }
.sr-folder-tracks { display: none; }
.sr-folder-tracks.open { display: block; }
.sr-sub-item { display: flex; align-items: center; padding: 4px 10px 4px 28px; cursor: pointer; gap: 8px; border-left: 2px solid transparent; transition: all .1s; }
.sr-sub-item:hover { background: var(--bg3); border-left-color: var(--border2); }
.sr-sub-item .sr-add-btn { opacity: 0; }
.sr-sub-item:hover .sr-add-btn { opacity: 1; }

/* ── Queue Section ── */
#queue-section { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
#queue-header { padding: 7px 10px 6px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.panel-label { font-size: 9px; color: var(--fg-dim); letter-spacing: .12em; }
.panel-actions { display: flex; gap: 5px; }
.cmd-btn { background: transparent; border: 1px solid var(--border2); color: var(--fg-dim); font-family: var(--font); font-size: 10px; padding: 2px 8px; border-radius: var(--radius); cursor: pointer; transition: all .12s; letter-spacing: .05em; }
.cmd-btn:hover { border-color: var(--accent); color: var(--accent); }
.cmd-btn.danger:hover { border-color: var(--red); color: var(--red); }
.cmd-btn.accent { border-color: var(--accent); color: var(--accent); margin-top: 4px; }
.cmd-btn.accent:hover { background: var(--accent-dim); }

#playlist { flex: 1; overflow-y: auto; padding: 3px 0; }
#playlist-empty { padding: 12px; }
.pl-item { display: flex; align-items: center; padding: 5px 10px; cursor: pointer; border-left: 2px solid transparent; transition: all .1s; gap: 7px; }
.pl-item:hover { background: var(--bg3); border-left-color: var(--border2); }
.pl-item.active { background: var(--accent-dim); border-left-color: var(--accent); }
.pl-item.active .pl-name { color: var(--accent); }
.pl-num { font-size: 9px; color: var(--fg-dimmer); width: 20px; flex-shrink: 0; text-align: right; }
.pl-item.active .pl-num { color: var(--accent2); }
.pl-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.pl-playing-icon { font-size: 9px; color: var(--accent); width: 10px; animation: pulse-icon 1.2s ease-in-out infinite; }
@keyframes pulse-icon { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ── Player Panel ── */
#player-panel { flex: 1; background: var(--bg2); display: flex; flex-direction: column; padding: 20px 24px 16px; gap: 16px; overflow: hidden; }
#now-playing { flex-shrink: 0; }
.np-label { font-size: 10px; letter-spacing: .2em; color: var(--fg-dim); margin-bottom: 6px; }
#track-name { font-size: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; line-height: 1.3; transition: color .2s; }
#track-name.playing { color: var(--accent); }
#track-meta { margin-top: 4px; font-size: 11px; color: var(--fg-dim); letter-spacing: .08em; }

#visualizer-wrap { flex: 1; min-height: 80px; position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
#visualizer { width: 100%; height: 100%; display: block; }
#vis-mode-label { position: absolute; top: 6px; right: 8px; font-size: 9px; letter-spacing: .15em; color: var(--fg-dimmer); pointer-events: none; }

#seek-row { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 11px; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
#seek-bar-wrap { flex: 1; cursor: pointer; padding: 8px 0; }
#seek-bar-bg { position: relative; height: 3px; background: var(--border); border-radius: 2px; }
#seek-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--accent); border-radius: 2px; transition: width .1s linear; }
#seek-bar-thumb { position: absolute; top: 50%; left: 0%; transform: translate(-50%,-50%); width: 10px; height: 10px; background: var(--accent); border-radius: 50%; opacity: 0; transition: opacity .15s, left .1s linear; box-shadow: 0 0 6px var(--accent); }
#seek-bar-wrap:hover #seek-bar-thumb { opacity: 1; }

#controls { display: flex; align-items: center; justify-content: center; gap: 8px; flex-shrink: 0; }
.ctrl-btn { background: transparent; border: 1px solid var(--border2); color: var(--fg-dim); font-family: var(--font); font-size: 16px; width: 40px; height: 40px; border-radius: var(--radius); cursor: pointer; transition: all .12s; display: flex; align-items: center; justify-content: center; }
.ctrl-btn:hover { border-color: var(--fg-dim); color: var(--fg); }
.ctrl-btn.primary { border-color: var(--accent); color: var(--accent); width: 52px; height: 52px; font-size: 20px; }
.ctrl-btn.primary:hover { background: var(--accent-dim); }
.ctrl-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

#volume-row { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.vol-label { font-size: 10px; letter-spacing: .15em; color: var(--fg-dim); width: 26px; }
#vol-bar-wrap { flex: 1; cursor: pointer; padding: 8px 0; }
#vol-bar-bg { position: relative; height: 3px; background: var(--border); border-radius: 2px; }
#vol-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 80%; background: var(--green); border-radius: 2px; }
#vol-bar-thumb { position: absolute; top: 50%; left: 80%; transform: translate(-50%,-50%); width: 10px; height: 10px; background: var(--green); border-radius: 50%; opacity: 0; transition: opacity .15s; box-shadow: 0 0 6px var(--green); }
#vol-bar-wrap:hover #vol-bar-thumb { opacity: 1; }
#vol-value { font-size: 11px; color: var(--fg-dim); width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

#statusbar { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); font-size: 11px; color: var(--fg-dimmer); flex-shrink: 0; letter-spacing: .06em; }
#status-msg { color: var(--fg-dim); }
#status-mode { color: var(--accent); }

body::after { content: ''; position: fixed; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0px, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px); pointer-events: none; z-index: 9999; }


