/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --bg: #fcfcfd;
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --text: #0f1115;
  --muted: #7a8190;
  --border: #eef0f3;
  --accent: #0f1115;
  --accent-soft: #f6f7f9;
  --radius: 12px;
  --radius-sm: 10px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.02), 0 12px 30px rgba(15, 17, 21, 0.05);
  --font-sans: "Instrument Sans", "SF Pro Text", "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --notice-bg: #fffbeb;
  --notice-border: #fcd34d;
  --notice-text: #92400e;
  --notice-bg-hover: #fef3c7;
  --notice-border-hover: #f59e0b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 45%, #ffffff 100%);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-3);
  font-weight: 600;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 var(--space-3);
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  color: #000000;
}

pre {
  margin: 0;
  padding: var(--space-3);
  background: #f7f8fb;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.page {
  padding: var(--space-5) 0 var(--space-6);
}

.site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  font-size: 14px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
}

.site-logo {
  width: 44px;
  height: 44px;
  filter: grayscale(100%);
  opacity: 0.8;
}

.site-title {
  font-size: 22px;
}

.site-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  font-size: 14px;
}

@media (max-width: 640px) {
  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-actions .login-button {
    display: none;
  }

  .current-user {
    width: 100%;
    margin-left: 4px;
  }
}

.current-user {
  color: var(--muted);
}

.logout-form {
  display: inline-flex;
  margin: 0;
}

form {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.pastes-search {
  display: grid;
  gap: var(--space-2);
}

.pastes-search-label {
  display: block;
}

.pastes-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: stretch;
}

.pastes-search-field {
  width: 100%;
  min-width: 0;
}

.pastes-search-button {
  height: 100%;
  min-height: 44px;
  width: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.pastes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 6px;
}

.pastes-header-text h1 {
  margin-bottom: 4px;
}

.pastes-header-subtitle {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: 13px;
}

.pastes-header-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.pastes-reload-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.pastes-reload-button:hover {
  background: #f8f9fb;
  border-color: #e1e5eb;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.pastes-reload-button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  border-color: #f0f2f5;
  background: #fafbfc;
}

.pastes-new-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.pastes-new-link:hover {
  background: #f8f9fb;
  border-color: #e1e5eb;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.pastes-new-notice-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--notice-border);
  background: var(--notice-bg);
  color: var(--notice-text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.pastes-new-notice-link:hover {
  background: var(--notice-bg-hover, #fff3cd);
  border-color: var(--notice-border-hover, #d4a800);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.paste-list {
  display: grid;
  gap: var(--space-3);
}

.paste-empty {
  padding: var(--space-4) 0;
  text-align: center;
  color: var(--muted);
}

.paste-empty-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--text);
}

.paste-empty-subtitle {
  margin: 0;
  font-size: 13px;
}

.paste-empty-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-2);
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.paste-empty-link:hover {
  background: #f8f9fb;
  border-color: #e1e5eb;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.paste-list-item {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.paste-list-item--notice {
  padding: var(--space-2);
  border-left: 3px solid #111827;
  border-bottom: 1px dashed #dfe3e8;
  background: #fafbfc;
}

.paste-list-item--masked {
  color: var(--muted);
}

.paste-list-item--masked .paste-preview {
  color: var(--muted);
}

.paste-list-item--masked .paste-tag-chip {
  color: var(--muted);
  background: #f9fafc;
}

.paste-list-item:last-child {
  border-bottom: 0;
}

.paste-list-link {
  color: inherit;
  text-decoration: none;
  display: block;
}

.paste-preview {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.paste-preview--masked {
  color: var(--muted);
  font-weight: 500;
}

.paste-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.paste-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f7f8fa;
  color: var(--text);
  font-weight: 500;
}

.paste-tag-chip--notice {
  background: #0f1115;
  border-color: #0f1115;
  color: #ffffff;
  font-weight: 600;
}

.paste-list--notices {
  padding: 0 0 var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 2px solid var(--border);
}

.notice-item-content {
  padding: var(--space-2) 0;
}

.notice-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: var(--space-1) 0;
  color: var(--text);
}

.notice-body {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}

.notice-body p {
  margin: 0 0 var(--space-1);
}

.notice-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.notice-item-link:hover .notice-title {
  color: var(--accent);
}

.notice-body--preview {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Notice show page */
.notice-show {
  max-width: 720px;
}

.notice-show-header {
  margin-bottom: var(--space-4);
}

.notice-show-title {
  margin: var(--space-2) 0 var(--space-1);
  font-size: 1.5rem;
  font-weight: 600;
}

.notice-show-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.notice-show-content {
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

.notice-show-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.paste-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: 13px;
  color: var(--muted);
}

.paste-meta-right {
  white-space: nowrap;
}

label {
  font-weight: 500;
  color: var(--text);
}

.required-marker {
  color: #e04646;
  font-weight: 700;
  margin-left: 4px;
}

.paste-options {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.paste-options-warning {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px dashed #f0caa5;
  background: #fff6eb;
  color: #6b3a00;
  font-size: 13px;
}

.paste-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.paste-option label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.paste-option-recommended {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f0f3f8;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.paste-password-fields[hidden] {
  display: none;
}

.byte-counter {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #cfd4db;
  box-shadow: 0 0 0 4px rgba(15, 17, 21, 0.06);
  background: #ffffff;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

button,
input[type="submit"],
.login-button,
.my-pastes-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

button:hover,
input[type="submit"]:hover,
.login-button:hover,
.my-pastes-link:hover {
  background: #f8f9fb;
  border-color: #e1e5eb;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.login-button {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
  margin-right: 8px;
}

turbo-frame#flash,
.flash {
  display: block;
}

.flash {
  margin: var(--space-3) auto 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  max-width: 820px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.flash-alert,
.flash-error {
  background: #fffafa;
  border-color: #f3d9d9;
  color: #8a2b2b;
}

.flash-notice {
  background: #fafbfc;
  border-color: #e1e5eb;
  color: var(--text);
}

.flash-manage-link {
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: var(--text);
  font-weight: 600;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.page-link {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
}

.page-link.current {
  border-color: #111827;
  color: #111827;
  background: var(--accent-soft);
}

.qr {
  margin: var(--space-4) 0;
}

.qr--empty {
  padding: var(--space-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.paste-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-2);
}

.read-once-warning {
  margin-bottom: var(--space-3);
}

.read-once-actions {
  margin-bottom: var(--space-3);
}

.read-once-list {
  margin: 0;
}

.paste-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-3);
}

/* Notice form */
.notice-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.notice-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.notice-field input[type="text"] {
  font-size: 1rem;
}

.notice-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.notice-cancel-link {
  color: var(--muted);
  text-decoration: none;
}

.notice-cancel-link:hover {
  color: var(--text);
}

.notice-errors {
  padding: var(--space-2);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #dc2626;
}

.notice-errors ul {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-3);
}
