/* snkrdrop — minimal dashboard styles. Designed for readability, not polish. */

/* Alpine.js x-cloak: hide elements with x-cloak until Alpine initializes.
   Without this, a failed Alpine init (e.g., blocked CDN, JS error) leaves
   x-cloak'd elements visible-but-broken. Putting it in the main stylesheet
   ensures it's always present, independent of JS load order. */
[x-cloak] { display: none !important; }

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-warn: #fff8e1;
  --bg-danger: #fdecea;
  --fg: #1a1f2e;
  --fg-muted: #5c6473;
  --fg-faint: #8b95a3;
  --border: #d6dae1;
  --accent: #2c5282;
  --accent-hover: #1e3a5f;
  --danger: #b91c1c;
  --code-bg: #f0f2f5;
  --radius: 6px;
  --max-width: 720px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
               Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-header nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.site-header nav a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
}
.site-header nav a:hover { color: var(--fg); }

main {
  padding: 32px 20px 80px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--fg-muted);
  font-size: 13px;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 4px; }

p.lede {
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 60ch;
  margin: 0 0 24px;
}

.muted { color: var(--fg-muted); }
.small { font-size: 13px; }

.hero {
  padding: 48px 0 24px;
}
.cta-form {
  margin-top: 24px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.feature h3 { margin-bottom: 4px; }
.feature p { margin: 0; color: var(--fg-muted); font-size: 14px; }

.page-section {
  margin-bottom: 48px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* Forms and buttons */
.primary-button,
.secondary-button,
.danger-button,
.link-button {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 80ms ease, border-color 80ms ease;
}
.primary-button {
  background: var(--accent);
  color: #fff;
}
.primary-button:hover { background: var(--accent-hover); }
.secondary-button {
  background: var(--bg-soft);
  color: var(--fg);
  border-color: var(--border);
}
.secondary-button:hover { background: var(--code-bg); }
.danger-button {
  background: var(--bg-danger);
  color: var(--danger);
  border-color: var(--danger);
}
.danger-button:hover { background: #f8d7d4; }
.link-button {
  background: none;
  color: var(--fg-muted);
  padding: 0;
  font-weight: 400;
}
.link-button:hover { color: var(--fg); }

.secondary-button.small,
.danger-button.small {
  padding: 4px 10px;
  font-size: 12px;
}

.copied {
  background: #d4f4dd !important;
  border-color: #6db784 !important;
  color: #1f6b3a !important;
}

/* Capability URL display */
.capability-success {
  padding: 32px 0;
}
.capability-box {
  background: var(--bg-warn);
  border: 1px solid #e8c87a;
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}
.capability-box code {
  display: block;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 12px;
  background: var(--bg);
  border-radius: 4px;
}
.capability-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.warning-details {
  margin-top: 24px;
  font-size: 14px;
}

/* Lists (links, rooms) */
.link-list, .room-list, .account-actions {
  list-style: none;
  padding: 0;
  margin: 0;
}
.link-row, .room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.link-row-main { flex: 1; min-width: 0; }
.link-row-main strong { display: block; margin-bottom: 4px; }
.link-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--fg-muted);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.link-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.link-create-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.link-create-form input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--fg-muted);
  background: var(--bg-soft);
  border-radius: var(--radius);
}

.account-section ul {
  list-style: disc;
  padding-left: 20px;
}
.account-section li {
  margin-bottom: 8px;
}

/* Connect page credentials */
.credentials-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.credentials-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  margin: 0 0 16px;
}
.credentials-card dt {
  color: var(--fg-muted);
  font-size: 13px;
  padding-top: 2px;
}
.credentials-card dd { margin: 0; }
.credentials-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

details {
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
details summary {
  cursor: pointer;
  font-weight: 500;
}
details[open] summary { margin-bottom: 8px; }

.inline { display: inline; }

/* Mobile */
@media (max-width: 600px) {
  .link-row { flex-direction: column; align-items: stretch; }
  .link-row-actions { justify-content: flex-end; flex-wrap: wrap; }
  .credentials-card dl { grid-template-columns: 1fr; }
}

/* Active-conversations grid */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.room-card {
  display: block;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  transition: border-color 80ms ease, background 80ms ease;
}
.room-card:hover {
  border-color: var(--accent);
  background: #fff;
}
.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.room-card-cta {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
}
