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

:root {
  --bg: #0a1628;
  --bg-elevated: #122033;
  --bg-input: #0d1a2c;
  --border: #243447;
  --border-focus: #2ec4b6;
  --text: #e8eef6;
  --text-muted: #8aa0b8;
  --accent: #2ec4b6;
  --accent-hover: #3dd9ca;
  --accent-deep: #1a9e93;
  --accent-muted: rgba(46, 196, 182, 0.14);
  --amber: #f0a202;
  --danger: #ef5d60;
  --danger-hover: #f2797b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: 'Outfit', 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'Cascadia Code', Consolas, monospace;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 15% -10%, rgba(46, 196, 182, 0.18), transparent 55%),
    radial-gradient(ellipse 55% 40% at 95% 15%, rgba(240, 162, 2, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 35% at 70% 100%, rgba(46, 140, 196, 0.12), transparent 55%),
    linear-gradient(180deg, #0a1628 0%, #0c1b30 100%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */

.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid rgba(36, 52, 71, 0.9);
  background: rgba(10, 22, 40, 0.72);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fadeDown 0.45s ease both;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #2ec4b6, #7ee8df 45%, #f0a202);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Layout */

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  width: 100%;
  flex: 1;
}

.view-container {
  max-width: 1120px;
}

.hero-intro {
  margin-bottom: 1.5rem;
  animation: fadeUp 0.5s ease both;
}

.hero-title {
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.hero-sub {
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 1.02rem;
}

/* Form */

.paste-form {
  background: linear-gradient(160deg, rgba(18, 32, 51, 0.95), rgba(13, 26, 44, 0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.25rem;
  box-shadow: var(--shadow);
  animation: fadeUp 0.55s ease 0.05s both;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 140px;
}

.field-grow {
  flex: 1;
  min-width: 200px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="search"],
select,
textarea {
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.68rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(46, 196, 182, 0.18);
}

textarea {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
  min-height: 340px;
  resize: vertical;
  width: 100%;
}

.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.check:hover {
  color: var(--text);
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.4rem;
}

.hint-inline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.char-count.over {
  color: var(--danger);
  font-weight: 600;
}

.form-actions {
  margin-top: 1.15rem;
  display: flex;
  justify-content: flex-end;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #041018;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(46, 196, 182, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text-muted);
}

.btn-danger {
  background: rgba(239, 93, 96, 0.12);
  color: #ffb4b5;
  border-color: rgba(239, 93, 96, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 93, 96, 0.22);
  border-color: var(--danger);
}

.hidden {
  display: none !important;
}

/* Recent pastes */

.recent-section {
  margin-top: 2.75rem;
  animation: fadeUp 0.55s ease 0.12s both;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.recent-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
}

.search-input {
  min-width: 180px;
  max-width: 240px;
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.05rem;
  background: rgba(18, 32, 51, 0.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.recent-item:hover {
  border-color: rgba(46, 196, 182, 0.55);
  background: rgba(46, 196, 182, 0.06);
  transform: translateY(-1px);
}

.recent-title {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-muted);
  color: #7ee8df;
  border-radius: 999px;
}

.empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}

/* View page */

.page-view .paste-meta {
  margin-bottom: 1.25rem;
  animation: fadeUp 0.4s ease both;
}

.page-view .paste-meta h1 {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 0.55rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.burn-note {
  margin-top: 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: rgba(240, 162, 2, 0.12);
  border: 1px solid rgba(240, 162, 2, 0.3);
  color: #ffd27a;
  font-size: 0.9rem;
}

.code-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease 0.05s both;
}

.code-wrap pre,
.code-pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
}

.code-wrap code {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
}

.code-wrap.wrapped pre,
.code-wrap.wrapped code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow);
  animation: popIn 0.25s ease;
}

.modal-content h2 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.copy-row {
  display: flex;
  gap: 0.5rem;
}

.copy-row input {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-content .field {
  margin-bottom: 1rem;
}

.modal-content .field label {
  margin-bottom: 0.25rem;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 300;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */

.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid rgba(36, 52, 71, 0.7);
}

.footer-dot {
  opacity: 0.5;
}

/* Error page */

.page-error {
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-container {
  text-align: center;
  padding: 2rem;
  animation: fadeUp 0.45s ease both;
}

.error-container h1 {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-muted), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-container p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Animations */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Responsive */

@media (max-width: 720px) {
  .header {
    flex-wrap: wrap;
    padding: 1rem;
  }

  .tagline {
    width: 100%;
    order: 3;
  }

  .header-actions {
    width: 100%;
    margin-left: 0;
  }

  .form-row {
    flex-direction: column;
  }

  .field {
    min-width: 100%;
  }

  .recent-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .recent-meta {
    flex-wrap: wrap;
  }

  .search-input {
    max-width: none;
    width: 100%;
  }

  .copy-row {
    flex-direction: column;
  }
}
