:root {
  --bg: #0a0a0a;
  --bg-elevated: #121212;
  --bg-hover: #1a1a1a;
  --border: #2a2a2a;
  --text: #f2f2f2;
  --text-muted: #9a9a9a;
  --accent: #f5c518;
  --accent-hover: #ffd84a;
  --accent-dim: rgba(245, 197, 24, 0.15);
  --danger: #ff5c5c;
  --success: #3dd68c;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 10px;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245, 197, 24, 0.08), transparent),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.25rem 4rem;
}

.hidden {
  display: none !important;
}

.app {
  width: min(920px, 100%);
}

.brand {
  margin-bottom: 2rem;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.logout-btn {
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.brand h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.tagline {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

.login-form label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #111;
  margin-top: 0.35rem;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 92, 92, 0.35);
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
}

.btn-danger:hover {
  background: rgba(255, 92, 92, 0.12);
}

.drop-zone {
  border: 1.5px dashed #3a3a3a;
  border-radius: var(--radius);
  background: var(--bg);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.drop-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.drop-hint {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.upload-progress {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#progress-percent {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
}

.progress-track {
  height: 6px;
  background: #222;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c9a000, var(--accent));
  border-radius: 999px;
  transition: width 0.15s linear;
}

.progress-eta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.table-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.files-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.files-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.files-table tbody tr:hover td {
  background: var(--bg-hover);
}

.files-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0.75rem;
}

.file-name {
  font-weight: 500;
  word-break: break-all;
}

.file-size,
.file-date {
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.file-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.file-link:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(360px, calc(100vw - 2.5rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  background: #161616;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(120%);
  opacity: 0;
  animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.toast.hiding {
  animation: toast-out 0.3s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--accent);
}

.toast-body {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
}

.toast-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.toast-close:hover {
  color: var(--text);
}

@keyframes toast-in {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  body {
    padding: 1.5rem 0.85rem 3rem;
  }

  .panel {
    padding: 1.1rem;
  }

  .files-table th:nth-child(3),
  .files-table td:nth-child(3) {
    display: none;
  }
}
