/* FILEDROP — a Windows 11 File Explorer style window (details view).
   Self-contained: no external fonts / CDNs. Background image lives in images/. */

:root {
  --win: rgba(32, 32, 32, 0.86);
  --bar: rgba(43, 43, 43, 0.55);
  --text: #ffffff;
  --sub: #c8c8c8;
  --dim: #8a8a8a;
  --accent: #60cdff;
  --hover: rgba(255, 255, 255, 0.06);
  --sel: rgba(96, 205, 255, 0.16);
  --line: rgba(255, 255, 255, 0.09);
  --close: #c42b1c;
  --danger: #f0708a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  font: 400 14px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* ---------- Background (server room) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(5,12,24,.45), rgba(5,12,24,.7)),
    url('images/bg_filedrop.webp') center / cover no-repeat,
    #0a1420;
}

.stage {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3.5vh, 44px) 18px;
}

/* ---------- Window ---------- */
.window {
  width: min(880px, 100%);
  height: min(580px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--win);
  backdrop-filter: blur(40px) saturate(1.3);
  -webkit-backdrop-filter: blur(40px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
  overflow: hidden;
}

/* Title bar with a single tab */
.titlebar {
  height: 40px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 0 0 8px;
  background: var(--bar);
  user-select: none;
}
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: 8px 8px 0 0;
  background: var(--win);
  font-size: 12.5px;
  color: var(--text);
}
.tab svg { width: 15px; height: 15px; color: #ffd166; }
.drag-space { flex: 1; height: 100%; }
.caption { display: flex; height: 100%; align-self: flex-start; }
.caption .cap {
  width: 46px; height: 40px; border: 0; background: transparent; padding: 0;
  display: grid; place-items: center; cursor: default; color: var(--sub);
  transition: background .12s, color .12s;
}
.caption .cap svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1; fill: none; shape-rendering: geometricPrecision; }
.caption .cap:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.caption .cap.close { cursor: pointer; }
.caption .cap.close:hover { background: var(--close); color: #fff; }

/* Command bar (fewer buttons than a real Explorer) */
.toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.tb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 14px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--text); font: inherit; font-size: 13.5px;
  transition: background .12s;
}
.tb-btn:hover { background: var(--hover); }
.tb-btn svg { width: 16px; height: 16px; }
.tb-btn.primary svg { color: var(--accent); }
.tb-icon {
  width: 34px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 6px;
  background: transparent; color: var(--sub); cursor: pointer; transition: background .12s, color .12s;
}
.tb-icon:hover { background: var(--hover); color: var(--text); }
.tb-icon svg { width: 16px; height: 16px; }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.grow { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; min-width: 210px;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 6px;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 15px; height: 15px; color: var(--dim); flex: none; }
.search input { border: 0; background: transparent; outline: none; color: var(--text); font: inherit; font-size: 13px; width: 100%; }
.search input::placeholder { color: var(--dim); }
.tb-link { color: var(--sub); text-decoration: none; font-size: 13px; padding: 7px 10px; border-radius: 6px; }
.tb-link:hover { background: var(--hover); color: var(--text); }

.selinfo { display: flex; align-items: center; gap: 4px; }
.selinfo[hidden] { display: none; }
.selinfo .cnt { color: var(--accent); font-size: 13px; margin-right: 4px; }
.tb-btn.danger:hover { background: rgba(196, 43, 28, .22); color: #ff9b8a; }

/* Upload progress bar (under the toolbar) */
.progress { height: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; display: none; }
.progress.active { display: block; }
.progress .bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--accent));
  transition: width .15s ease;
}
.progress.indeterminate .bar { width: 40%; animation: prog-slide 1.1s infinite ease-in-out; }
@keyframes prog-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* Column header + rows share one grid */
.colhead, .row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 140px 150px 88px 104px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
}
.col-check, .cell-check { display: flex; align-items: center; justify-content: center; }
.col-check input, .cell-check input {
  width: 16px; height: 16px; margin: 0; cursor: pointer;
  accent-color: var(--accent);
}
/* W11 feel: unchecked boxes are subtle until you hover the row or check them */
.cell-check input:not(:checked) { opacity: .35; transition: opacity .12s; }
.row:hover .cell-check input, .cell-check input:checked { opacity: 1; }
.colhead {
  height: 32px;
  font-size: 12px;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
}
.colhead .col-size { text-align: right; }

.filelist {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
  position: relative;
}
.filelist::-webkit-scrollbar { width: 12px; }
.filelist::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }

.row {
  height: 36px;
  border-radius: 4px;
  cursor: default;
  position: relative;
}
.row:hover { background: var(--hover); }
.row.selected { background: var(--sel); }
.row .cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row .cell-name .ico { width: 20px; height: 20px; flex: none; }
.row .cell-name .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .cell-user, .row .cell-date { color: var(--sub); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .cell-size { color: var(--sub); font-size: 13px; text-align: right; }
.row .actions {
  display: flex; gap: 4px; justify-content: flex-end;
  opacity: 0; transition: opacity .12s;
}
.row:hover .actions { opacity: 1; }
.row .actions button {
  width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 5px;
  background: rgba(255,255,255,.08); color: var(--sub); cursor: pointer; transition: .12s;
}
.row .actions button svg { width: 15px; height: 15px; }
.row .actions .act-dl:hover { background: var(--accent); color: #04121f; }
.row .actions .act-share:hover { background: #a970ff; color: #fff; }
.row .actions .act-del:hover { background: var(--close); color: #fff; }

/* Empty state */
.empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  gap: 12px; color: var(--dim); text-align: center; pointer-events: none;
}
.empty svg { width: 60px; height: 60px; opacity: .5; }
.empty b { color: var(--sub); font-weight: 600; }

/* Drag overlay */
.dragmask {
  position: absolute; inset: 8px; z-index: 5; display: none;
  place-content: center; justify-items: center; gap: 12px;
  border: 2px dashed var(--accent); border-radius: 8px;
  background: rgba(10, 26, 48, .72); backdrop-filter: blur(3px);
  color: #fff; text-align: center; pointer-events: none;
}
.dragmask svg { width: 52px; height: 52px; color: var(--accent); }
.window.dragging .dragmask { display: grid; }

/* Status bar */
.statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 26px; padding: 0 14px; font-size: 12px; color: var(--dim);
  border-top: 1px solid var(--line); background: var(--bar);
}
.statusbar .msg { color: var(--sub); }
.statusbar .msg.err { color: var(--danger); }

/* ---------- Login (same theme) ---------- */
.login-wrap { position: relative; z-index: 1; min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-box {
  background: var(--win); backdrop-filter: blur(40px) saturate(1.3);
  -webkit-backdrop-filter: blur(40px) saturate(1.3);
  border: 1px solid var(--line); border-radius: 12px; padding: 42px 46px;
  max-width: 430px; text-align: center; box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.login-box h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: .5px; }
.login-box .sub { color: var(--sub); font-size: 14px; margin-bottom: 24px; }
.login-box .err { color: var(--danger); }
.btn {
  display: inline-block; text-decoration: none; border: 0; cursor: pointer;
  border-radius: 8px; padding: 12px 22px; font: inherit; font-weight: 600; font-size: 14px;
}
.btn.discord { background: #5865F2; color: #fff; }
.btn.ghost { background: rgba(255,255,255,.06); color: var(--sub); border: 1px solid var(--line); margin-left: 8px; }

@media (max-width: 720px) {
  .colhead, .row { grid-template-columns: 34px minmax(0, 1fr) 70px 100px; }
  .col-user, .cell-user, .col-date, .cell-date { display: none; }
  .search { min-width: 44px; width: 44px; }
  .search input { display: none; }
  .window { height: 100%; border-radius: 0; }
  .stage { padding: 0; }
}
