/* ── Reset & base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1a1a2e;
  --bg-surface: #16213e;
  --bg-hover: #1a2a4a;
  --bg-input: #0f1a2e;
  --text: #e0e0e0;
  --text-muted: #8892a4;
  --accent: #4a9eff;
  --accent-hover: #3a8eef;
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --border: #2a3a5e;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ── Login page ────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 360px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card h1 { margin-bottom: 0.25rem; font-size: 1.8rem; }
.login-card .subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }

.login-card input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.login-card input:focus { border-color: var(--accent); }

.login-card button {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.login-card button:hover { background: var(--accent-hover); }

.error { color: var(--danger); margin-top: 0.5rem; font-size: 0.9rem; }
.hidden { display: none !important; }

/* ── Header ────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

header h1 { font-size: 1.3rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.header-right span { color: var(--text-muted); font-size: 0.9rem; }

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
}
.btn-text:hover { text-decoration: underline; }

/* ── Breadcrumbs ───────────────────────────────────────────────── */
.breadcrumbs {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 0.4rem; color: var(--text-muted); }

/* ── Toolbar ───────────────────────────────────────────────────── */
.toolbar {
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-surface); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }

/* ── File table ────────────────────────────────────────────────── */
main { padding: 0 1.5rem 2rem; }

.drop-zone { position: relative; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  vertical-align: middle;
}

.col-icon { width: 2rem; text-align: center; }
.col-name { min-width: 200px; }
.col-size { width: 100px; color: var(--text-muted); }
.col-modified { width: 180px; color: var(--text-muted); font-size: 0.85rem; }
.col-actions { width: 160px; text-align: right; }

.file-name { cursor: pointer; color: var(--text); text-decoration: none; }
.file-name:hover { color: var(--accent); }
.folder-name { font-weight: 500; }

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.action-btn:hover { background: var(--bg-surface); color: var(--text); }
.action-btn.danger:hover { color: var(--danger); }

/* ── Empty state ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state p:first-child { font-size: 1.2rem; margin-bottom: 0.5rem; }
.empty-state .hint { font-size: 0.85rem; }

/* ── Drag & drop overlay ──────────────────────────────────────── */
.drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(74, 158, 255, 0.1);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  font-size: 1.2rem;
  color: var(--accent);
  pointer-events: none;
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 360px;
  box-shadow: var(--shadow);
}
.modal-content h3 { margin-bottom: 1rem; }
.modal-content input {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.modal-content input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .col-modified { display: none; }
  .col-size { display: none; }
  header { padding: 0.5rem 1rem; }
  .toolbar { padding: 0.5rem 1rem; }
  main { padding: 0 0.5rem 1rem; }
}
