:root {
  color-scheme: light dark;
  --bg: #0b1021;
  --panel: rgba(255, 255, 255, 0.04);
  --text: #f3f4ff;
  --muted: #9aa0c7;
  --accent: #7de8ff;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.14);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: radial-gradient(circle at 20% 20%, rgba(125, 232, 255, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(125, 232, 255, 0.08), transparent 28%),
    radial-gradient(circle at 50% 80%, rgba(125, 232, 255, 0.05), transparent 26%),
    var(--bg);
  color: var(--text);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 56px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hero {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  background: linear-gradient(120deg, rgba(125, 232, 255, 0.08), transparent 45%), var(--panel);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 14px;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 6vw, 46px);
}

h2 {
  margin-top: 0;
  font-size: 24px;
}

h3 {
  margin-top: 0;
}

.lede {
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 24px;
  line-height: 1.5;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  background: var(--accent);
  color: #0b1021;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(125, 232, 255, 0.35);
  transition: transform 120ms ease, box-shadow 120ms ease;
  font-size: 16px;
  display: inline-block;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 44px rgba(125, 232, 255, 0.45);
}

.button.secondary {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  box-shadow: none;
}
.button.secondary:hover {
  background: rgba(255,255,255,0.15);
  box-shadow: none;
}

.button.danger {
  background: rgba(255, 107, 107, 0.2);
  color: #ffbaba;
  box-shadow: none;
}
.button.danger:hover {
  background: rgba(255, 107, 107, 0.3);
}

.button.small {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 8px;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  padding: 4px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.flex-grow {
  flex: 1;
}
.flex-shrink {
  width: 100%;
}
@media (min-width: 600px) {
  .flex-shrink {
    width: 250px;
  }
}

label {
  display: grid;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
}

input, button {
  font: inherit;
}

input[type="text"], input[type="url"], input[type="password"] {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

button[type="submit"] {
  background: var(--accent);
  color: #0b1021;
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease;
  align-self: flex-start;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
}

.status {
  font-size: 14px;
  color: var(--muted);
}

.success {
  color: #7dffb0;
}

.error {
  color: #ff9b9b;
}

.hidden {
  display: none !important;
}

/* Links List */
.links-list {
  display: grid;
  gap: 16px;
}

.link-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: transform 0.1s;
}

.link-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.link-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.link-slug {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slug-link {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
}
.slug-link:hover {
  text-decoration: underline;
}

.badge {
  background: rgba(125, 232, 255, 0.15);
  color: var(--accent);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.link-target {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.link-meta {
  color: rgba(255,255,255,0.3);
  font-size: 12px;
}

.link-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--accent);
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
  background: #1a1f35;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal::backdrop {
  background: rgba(0,0,0,0.7);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}
.slug-display {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  color: var(--accent);
}
