/* Popcorn Silo — purple & orange all the way down */

:root {
  --purple-950: #2e1065;
  --purple-800: #4c1d95;
  --purple-700: #6d28d9;
  --purple-600: #7c3aed;
  --purple-100: #ede9fe;
  --orange-600: #ea580c;
  --orange-500: #f97316;
  --orange-400: #fb923c;
  --orange-100: #ffedd5;
  --cream: #fff7ed;
  --ink: #241a3a;
  --muted: #6b6880;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--cream);
  color: var(--ink);
}

a { color: var(--purple-700); }
a:hover { color: var(--orange-600); }

/* ---------- Header / footer ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.25rem;
  background: linear-gradient(90deg, var(--purple-950), var(--purple-700));
  color: #fff;
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: var(--orange-400); }
.brand .logo { margin-right: 0.35rem; }

.site-nav a {
  color: var(--orange-100);
  margin-left: 1.1rem;
  text-decoration: none;
  font-weight: 600;
}
.site-nav a:hover { color: var(--orange-400); }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}

/* Credit link: no special colors, just a quiet underline */
.site-footer a.site-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(107, 104, 128, 0.45);
}
.site-footer a.site-link:hover { color: inherit; }

/* ---------- Layout / cards ---------- */

.wrap {
  max-width: 62rem;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.card, .recent-card, .hero {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(46, 16, 101, 0.08);
  border-top: 4px solid var(--orange-500);
}

.hero { background: linear-gradient(135deg, #fff, var(--orange-100)); }
.hero h1 { font-size: 1.8rem; }

.recent-card h2 {
  margin: 0.1rem 0 0.5rem;
  color: var(--purple-800);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.recent-file { margin: 0.25rem 0; font-size: 1.05rem; }
.recent-file .file-link { font-weight: 700; }
.kernel { margin-right: 0.3rem; }

h1 { margin: 0.2rem 0 0.6rem; color: var(--purple-800); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--orange-500);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  margin-right: 0.4rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--orange-600); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--purple-700);
  border: 2px solid var(--purple-600);
}
.btn-ghost:hover { background: var(--purple-100); color: var(--purple-800); }

.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.btn-small { padding: 0.3rem 0.6rem; font-size: 0.85rem; margin-right: 0; }

/* ---------- Forms ---------- */

label { display: block; margin-bottom: 0.9rem; font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--purple-600);
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
}
input:focus {
  outline: 2px solid var(--orange-400);
  border-color: var(--orange-500);
}

.auth-card { max-width: 26rem; }
.auth-card .btn { margin-top: 0.25rem; }

.upload-form {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.upload-form input[type="file"] { width: auto; margin-top: 0; }

.inline-form { display: inline-flex; gap: 0.35rem; align-items: center; margin: 0; }
.inline-form input[type="text"] { width: 11rem; margin-top: 0; padding: 0.3rem 0.5rem; font-size: 0.85rem; }

/* ---------- File table ---------- */

.files { width: 100%; border-collapse: collapse; }
.files th {
  text-align: left;
  color: var(--purple-800);
  border-bottom: 2px solid var(--orange-400);
  padding: 0.5rem 0.4rem;
  white-space: nowrap;
}
.files td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid #f0e8de;
  vertical-align: middle;
}
.files tbody tr:hover td { background: var(--cream); }
.files .actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.file-link { font-weight: 600; text-decoration: none; }
.file-link:hover { text-decoration: underline; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-shared {
  background: var(--orange-100);
  color: var(--orange-600);
  border: 1px solid var(--orange-400);
}
.badge-private {
  background: var(--purple-100);
  color: var(--purple-700);
  border: 1px solid var(--purple-600);
}

/* ---------- File permalink page ---------- */

.meta { margin: 0.5rem 0 1rem; }
.meta-row { display: flex; gap: 1rem; padding: 0.25rem 0; border-bottom: 1px dashed #eee0d5; }
.meta-row dt { width: 6rem; flex: none; color: var(--muted); font-weight: 600; }
.meta-row dd { margin: 0; }

/* ---------- Flash messages ---------- */

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.flash-ok {
  background: var(--purple-100);
  border: 1px solid var(--purple-600);
  color: var(--purple-800);
}
.flash-err {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

/* ---------- Danger zone (settings) ---------- */

.danger-zone {
  border: 2px solid #ef4444;
  border-top-width: 4px;
}
.danger-zone h2 { color: #b91c1c; margin: 0.1rem 0 0.5rem; }

.btn-big {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 10px;
}

/* ---------- Debug panel ---------- */

.debug { margin-bottom: 1.25rem; }
.debug summary {
  display: inline-block;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--purple-700);
  background: #fff;
  border: 1px dashed var(--orange-500);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  list-style: none;
  user-select: none;
}
.debug summary::-webkit-details-marker { display: none; }
.debug summary:hover { background: var(--orange-100); }
.debug[open] summary { border-radius: 8px 8px 0 0; border-bottom: none; }
.debug dl {
  background: var(--ink);
  color: #e9d5ff;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  border-radius: 0 10px 10px 10px;
  padding: 0.8rem 1rem;
  margin: 0;
}
.debug-row {
  display: flex;
  gap: 1rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.debug-row:last-child { border-bottom: none; }
.debug-row dt { width: 13rem; flex: none; color: var(--orange-400); }
.debug-row dd { margin: 0; word-break: break-all; }
