:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;          /* Solid page background fixes the "column" */
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: grid;
  place-items: center;       /* centers the card */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);       /* solid white, no frosted blur */
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field { position: relative; margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}

.toggle-password:hover { color: var(--primary); }

/* ---------- Button ---------- */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}

.btn:hover,
.btn:focus-visible { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

/* ---------- Messages ---------- */
#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}

.error { color: #d52731; }
.success { color: #269f53; }

/* ---------- Logout button ---------- */
/* Tiny logout icon (top-left of the page) */
.logout-icon {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.logout-icon i {
  font-size: 14px;   /* slightly larger than before */
  line-height: 1;
}

.logout-icon:hover { background: var(--primary-dark); }
.logout-icon:active { transform: translateY(1px); }


/* ---------- Recent Uploads FAB (above upload) ---------- */
.recent-fab {
  position: fixed;
  left: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0));
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.recent-fab i { font-size: 18px; line-height: 1; }
.recent-fab:hover { background: var(--primary-dark); }
.recent-fab:active { transform: translateY(1px); }


/* ---------- Upload FAB (bottom-left) ---------- */
.upload-fab {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.upload-fab i { font-size: 18px; line-height: 1; }
.upload-fab:hover { background: var(--primary-dark); }
.upload-fab:active { transform: translateY(1px); }


/* ---------- Bulk Upload FAB (bottom-right) ---------- */
.bulk-upload-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0));
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.18);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}
.bulk-upload-fab i { font-size: 18px; line-height: 1; }
.bulk-upload-fab:hover { background: var(--primary-dark); }
.bulk-upload-fab:active { transform: translateY(1px); }

/* ---------- Upload status pill ---------- */
.upload-status {
  position: fixed;
  right: 16px;           /* move to right */
  left: auto;            /* cancel the old left anchor */
  bottom: calc(16px + env(safe-area-inset-bottom, 0)); /* sit close to bottom */
  max-width: min(420px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14);
  z-index: 1000;
}

.upload-status a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.upload-status a:hover { text-decoration: underline; }


/* ===== Recent Uploads Modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.modal {
  width: min(900px, 92vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.35);
  overflow: hidden;
  display: flex;            /* keep header/footer fixed */
  flex-direction: column;
  max-height: 86vh;         /* cap overall height */
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid #edf0f3;
}
.modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-close {
  border: 0; background: transparent; cursor: pointer;
  color: #6b7280; font-size: 18px; padding: 6px; border-radius: 10px;
}
.modal-close:hover { background: #f3f4f6; color: #111827; }

.modal-body {
  padding: 12px 18px 6px;
  overflow: auto;           /* scroll when there are many rows */
  max-height: unset;        /* flex sizing takes over */
  flex: 1;                  /* fill available space */
}

.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; background: #fafafa;
  border-top: 1px solid #edf0f3;
}
.btn-secondary {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid #e5e7eb; background: #fff; cursor: pointer;
}
.btn-secondary:hover { background: #f8fafc; }

/* Table */
.uploads-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.uploads-table thead th {
  position: sticky; top: 0; background: #fff; z-index: 1;
  font-size: .86rem; text-transform: uppercase; letter-spacing: .02em;
  color: #64748b; border-bottom: 1px solid #edf0f3;
  padding: 10px 12px;
}
.uploads-table tbody td {
  padding: 12px; vertical-align: top; border-bottom: 1px solid #f1f5f9;
  font-size: .94rem; color: #0f172a;
}
.uploads-table tbody tr:hover { background: #f8fafc; }
.uploads-table th:nth-child(1) { width: 62%; }  /* URL */
.uploads-table th:nth-child(2) { width: 24%; }  /* Uploader */
.uploads-table th:nth-child(3) { width: 14%; }  /* Type */

.url-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.url-cell a {
  color: var(--primary); text-decoration: none; font-weight: 600; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block;
}
.url-cell a:hover { text-decoration: underline; }
.copy-link {
  border: 1px solid #e5e7eb; background: #fff; border-radius: 10px;
  font-size: 12px; padding: 6px 8px; cursor: pointer; color: #334155;
}
.copy-link:hover { background: #f3f4f6; }

.type-pill {
  display: inline-block; padding: 4px 8px; border-radius: 9999px;
  font-size: .78rem; background: #eef2ff; color: #1e3a8a;
}
.empty-state { color: #64748b; padding: 6px 0 10px; }




/* ===== Centered Upload Overlay ===== */
.upload-overlay {
  position: fixed;
  inset: 0;
  display: none;                 /* toggled via JS */
  place-items: center;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(6px);
  z-index: 20000;                /* above FABs & modals */
}

.upload-overlay__box {
  width: min(380px, 92vw);
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.92));
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.45);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

/* Circular progress using conic-gradient */
.progress-ring {
  --p: 0; /* percent (0-100) set by JS */
  width: 160px;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    conic-gradient(var(--primary) calc(var(--p) * 1%), #e5e7eb 0);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 10px #fff; /* inner white rim */
}
.progress-ring::before {
  content: attr(data-label);
  font: 800 32px/1.1 Inter, system-ui, sans-serif;
  color: #0f172a;
}

.upload-overlay__name {
  font: 700 15px/1.3 Inter, system-ui, sans-serif;
  color: #0f172a;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-overlay__hint {
  font: 500 13px/1.3 Inter, system-ui, sans-serif;
  color: #64748b;
}


/* ===== Recent uploads (main page section) ===== */
.recent-section {
  max-width: 1100px;
  margin: 24px auto 80px;
  padding: 0 16px;
}

.recent-header h2 {
  margin: 0 0 6px 0;
  font: 700 22px/1.2 Inter, system-ui, sans-serif;
  color: #0f172a;
}

.recent-sub {
  margin: 0 0 16px 0;
  font: 500 13px/1.5 Inter, system-ui, sans-serif;
  color: #64748b;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.upload-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 10px;
  transition: transform var(--transition), box-shadow var(--transition);
}

.upload-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.uc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.uc-ext {
  font: 700 11px/1 Inter, system-ui, sans-serif;
  color: #0b5ed7;
  background: #e7f1ff;
  border: 1px solid #cfe2ff;
  padding: 6px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.uc-actions {
  display: flex;
  gap: 8px;
}

.uc-actions .icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.uc-actions .icon-btn:hover { background: #f8fafc; }

.uc-title {
  font: 700 14px/1.35 Inter, system-ui, sans-serif;
  color: #0f172a;
  text-decoration: none;
  word-break: break-word;
}

.uc-url {
  font: 500 12px/1.4 Inter, system-ui, sans-serif;
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
}

.uc-meta {
  font: 500 12px/1.4 Inter, system-ui, sans-serif;
  color: #64748b;
}

.recent-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}


.uc-links {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.link-row {
  display: grid;
  grid-template-columns: auto 1fr auto; /* pill | link | copy */
  align-items: center;
  gap: 8px;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.8;
  letter-spacing: .02em;
  white-space: nowrap;
  user-select: none;
}

.pill-player { background: #eef2ff; color: #3b82f6; } /* indigo-ish */
.pill-cdn    { background: #ecfeff; color: #06b6d4; } /* cyan-ish */

/* make long links tidy */
.uc-url {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
