/* Pico.css is vendored in `pico.css`; keep this file tiny for app-specific tweaks. */

:root {
  /* Accent (blue) */
  --pico-primary: #2563eb;
  --pico-primary-background: #2563eb;
  --pico-primary-underline: rgba(37, 99, 235, 0.35);
  --pico-primary-hover: #1d4ed8;
  --pico-primary-hover-background: #1d4ed8;
  --pico-primary-focus: rgba(37, 99, 235, 0.25);
}

/* Slightly more "app-like" spacing */
main.container {
  padding-top: 1rem;
}

/* Shared app shell (all non-home pages) */
body:not(.home) {
  background: radial-gradient(1200px circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 55%), #fff;
}

body:not(.home) main.container {
  max-width: 860px;
  padding: 2rem 1rem 3rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title h1 {
  margin: 0;
  font-size: 1.6rem;
}

.page-meta {
  margin: 0.25rem 0 0;
  opacity: 0.6;
  font-size: 0.95rem;
}

.page-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.md-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}

.md-button.secondary {
  background: #0f172a;
}

.md-button:hover {
  background: #1d4ed8;
}

.md-button.secondary:hover {
  background: #111827;
}

body:not(.home) article,
.form-card {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: #fff;
}

.form-card {
  padding: 1.25rem;
}

.form-errors {
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.copy-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.copy-actions small {
  margin-left: 0.25rem;
  opacity: 0.75;
}

.detail-url {
  margin: 0;
  word-break: break-word;
}

.empty-state p {
  margin: 0;
}

body:not(.home) table {
  margin: 0;
}

body:not(.home) thead th {
  background: rgba(15, 23, 42, 0.04);
  font-weight: 600;
}

/* Make readonly copy field look like iOS "selectable" field */
input[readonly] {
  user-select: all;
}

/* Compact list layout for short urls index */
body.short-urls.index main.container {
  padding-top: 0.5rem;
}

body.short-urls.index main.container > nav {
  margin-bottom: 0.5rem;
}

body.short-urls.index article {
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
}

body.short-urls.index article nav {
  margin-bottom: 0.25rem;
}

body.short-urls.index article nav ul {
  gap: 0.5rem;
}

body.short-urls.index article small {
  display: block;
  opacity: 0.8;
  word-break: break-word;
}

/* Short URLs UI aligned with homepage */
body.short-urls .page-header {
  margin-bottom: 1.2rem;
}

body.short-urls .short-urls-table {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
}

body.short-urls .short-urls-destination {
  max-width: 36rem;
  word-break: break-word;
}

body.short-urls .short-urls-actions-cell {
  white-space: nowrap;
}

body.short-urls .short-urls-actions-cell a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

body.short-urls .short-urls-actions-cell a:hover {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.35);
}

body.short-urls .copy-actions button,
body.short-urls .copy-actions a[role="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.9);
}

body.short-urls .copy-actions button:hover,
body.short-urls .copy-actions a[role="button"]:hover {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Auth UI */
.auth-buttons {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.auth-buttons form {
  margin: 0;
}

.auth-divider {
  text-align: center;
  opacity: 0.6;
  margin: 1rem 0;
}

/* Homepage splash */
body.home.index main {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: radial-gradient(1200px circle at 50% 0%, rgba(37, 99, 235, 0.12), transparent 55%), #fff;
}

body.home.index main::before {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(37, 99, 235, 0.0), rgba(37, 99, 235, 0.55), rgba(255, 255, 255, 0.18), rgba(37, 99, 235, 0.0));
  filter: blur(34px);
  opacity: 0.18;
  animation: home-aurora 6.5s ease-in-out infinite;
  pointer-events: none;
}

body.home.index .splash {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100svh;
}

body.home.index .mark {
  width: min(16rem, 62vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  transform: translateZ(0);
  animation: home-mark 2200ms cubic-bezier(0.16, 0.8, 0.24, 1) both;
}

body.home.index .logo {
  width: 100%;
  height: auto;
  display: block;
}

body.home.index .logo.glow {
  position: absolute;
  filter: blur(18px);
  opacity: 0.9;
  transform: scale(1.06);
  mix-blend-mode: screen;
  animation: home-glow 1800ms ease-out forwards;
}

body.home.index .logo.core {
  filter: none;
}

body.home.index .after-splash {
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms ease, transform 300ms ease;
}

body.home.index main.splash-finished .after-splash {
  opacity: 1;
  transform: translateY(0);
}

body.home.index main.splash-finished .splash {
  min-height: auto;
  margin-top: 10vh;
  margin-bottom: 1.25rem;
}

body.home.index main.splash-finished .mark {
  width: min(10rem, 42vw);
}

body.home.index .after-splash nav {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

body.home.index .after-splash footer {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.6);
}

body.home.index .after-splash a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.9);
}

body.home.index .after-splash a svg {
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

body.home.index .after-splash a:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.35);
}

@keyframes home-mark {
  0% {
    opacity: 0;
    transform: scale(0.42) rotate(-24deg);
    filter: blur(10px);
  }
  60% {
    opacity: 1;
    transform: scale(1.04) rotate(4deg);
    filter: blur(0px);
  }
  80% {
    transform: scale(1.01) rotate(-1deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes home-glow {
  0% {
    opacity: 0;
    filter: blur(34px);
  }
  55% {
    opacity: 1;
    filter: blur(16px);
  }
  100% {
    opacity: 0.65;
    filter: blur(18px);
  }
}

@keyframes home-aurora {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(140deg) scale(1.08);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home.index main::before,
  body.home.index .mark,
  body.home.index .logo.glow {
    animation: none !important;
  }
}
