/* juicearchive.xyz — dark NXE-influenced shell */

:root {
  --bg: #0b0f0d;
  --bg-2: #111713;
  --panel: #151d18;
  --panel-2: #1b241d;
  --line: #263129;
  --line-soft: #1e2721;
  --text: #e9f0ea;
  --muted: #8b9c90;
  --muted-2: #617066;
  --accent: #86c541;
  --accent-soft: rgba(134, 197, 65, 0.14);
  --accent-line: rgba(134, 197, 65, 0.4);
  --danger: #e0685c;
  --radius: 10px;
  --sidebar-w: 232px;
  --player-h: 78px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(1200px 500px at 15% -10%, rgba(134, 197, 65, 0.07), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(70, 130, 180, 0.05), transparent 55%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; }

/* ------------------------------- layout ------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 60px 1fr;
  grid-template-areas: "brand top" "side main";
  height: 100%;
  padding-bottom: var(--player-h);
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  background: var(--bg-2);
}

.brand .mark {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--accent), #4e8f22);
  box-shadow: 0 0 14px rgba(134, 197, 65, 0.35);
  flex: none;
}

.brand .name {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 14px;
  text-transform: uppercase;
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-2);
}

.search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search input {
  width: 100%;
  padding: 9px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  outline: none;
}
.search input:focus { border-color: var(--accent-line); background: var(--panel-2); }
.search input::placeholder { color: var(--muted-2); }

.spacer { flex: 1; }

.sidebar {
  grid-area: side;
  border-right: 1px solid var(--line-soft);
  background: var(--bg-2);
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-group { margin-bottom: 18px; }

.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 10px 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  font-size: 14px;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--text);
}
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--muted-2); }

.main {
  grid-area: main;
  overflow-y: auto;
  padding: 20px 24px 40px;
}

/* ---------------------------- shared bits ----------------------------- */

.btn {
  padding: 8px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--panel-2); border-color: var(--accent-line); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #10200a; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.danger { border-color: rgba(224, 104, 92, 0.4); color: var(--danger); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.page-title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.crumbs span.sep { color: var(--muted-2); }
.crumbs a { cursor: pointer; }
.crumbs a:hover { color: var(--accent); }
.crumbs .current { color: var(--text); }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.loading { padding: 40px; text-align: center; color: var(--muted); }

.banner {
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(224, 104, 92, 0.35);
  background: rgba(224, 104, 92, 0.08);
  color: #f0b4ad;
  font-size: 13.5px;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

/* ------------------------------ folders ------------------------------- */

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 10px;
  margin-bottom: 26px;
}

.folder-tile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.1s, border-color 0.12s, background 0.12s;
}
.folder-tile:hover {
  background: var(--panel-2);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}
.folder-tile .glyph { font-size: 19px; color: var(--accent); flex: none; }
.folder-tile .label {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------- files -------------------------------- */

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

.file-row {
  display: grid;
  grid-template-columns: 30px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: default;
}
.file-row:hover { background: var(--panel); border-color: var(--line-soft); }
.file-row.playing { background: var(--accent-soft); border-color: var(--accent-line); }

.file-row .idx { color: var(--muted-2); font-size: 12px; text-align: right; }
.file-row.playing .idx { color: var(--accent); }

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.file-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

.file-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.12s; }
.file-row:hover .file-actions, .file-row.playing .file-actions { opacity: 1; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}
.icon-btn:hover { background: var(--panel-2); color: var(--accent); }
.icon-btn.on { color: var(--accent); }

.size { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ------------------------------- player ------------------------------- */

.player {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 2fr) minmax(150px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: rgba(13, 19, 15, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 40;
}

.now-playing { overflow: hidden; }
.now-playing .t {
  font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.now-playing .s { font-size: 11.5px; color: var(--muted-2); }

.transport { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.transport .buttons { display: flex; align-items: center; gap: 12px; }

.play-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #10200a;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 15px;
}
.play-btn:hover { filter: brightness(1.1); }

.seek { display: flex; align-items: center; gap: 9px; width: 100%; }
.seek .time { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; min-width: 36px; }
.seek input[type="range"] { flex: 1; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border: none;
  border-radius: 50%; background: var(--accent);
}

.volume { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.volume input[type="range"] { width: 90px; }

/* ------------------------------- modal -------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid; place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal.wide { max-width: 520px; }
.modal h2 { margin: 0 0 4px; font-size: 18px; font-weight: 400; }
.modal .hint { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.field { margin-bottom: 13px; }
.field label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 5px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 14px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent-line); }

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 6px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; }
.tab {
  padding: 6px 13px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.tab.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }

/* ------------------------------ updates ------------------------------- */

.update-card {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.update-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.update-card .meta { font-size: 11.5px; color: var(--muted-2); margin-bottom: 10px; }
.update-card .body { font-size: 14px; color: #cfd9d1; white-space: pre-wrap; line-height: 1.55; }

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 8px;
}
.pill.grey { background: var(--panel-2); color: var(--muted); }

/* ------------------------------- tables ------------------------------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
th {
  text-align: left;
  padding: 11px 14px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .n { font-size: 26px; font-weight: 300; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); margin-top: 3px; }

/* ------------------------------- toast -------------------------------- */

.toast-stack {
  position: fixed;
  bottom: calc(var(--player-h) + 16px);
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--panel-2);
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 13.5px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  animation: rise 0.18s ease-out;
}
.toast.bad { border-color: rgba(224, 104, 92, 0.5); color: #f0b4ad; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ----------------------------- responsive ----------------------------- */

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 56px auto 1fr;
    grid-template-areas: "brand" "top" "main";
  }
  .brand { border-right: none; }
  .sidebar {
    grid-area: auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
    padding: 10px;
  }
  .nav-group { margin: 0; display: flex; gap: 6px; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
  .main { padding: 16px; }
  .player { grid-template-columns: 1fr; gap: 4px; padding: 8px 14px; }
  .volume { display: none; }
  .now-playing { text-align: center; }
}
