/* assets/style.css */
:root {
  --bg:       #f5f0e8;
  --card:     #fffdf7;
  --ink:      #1a1a1a;
  --accent:   #ff4b00;
  --accent2:  #00c2a8;
  --accent3:  #ffe94a;
  --muted:    #888;
  --border:   #1a1a1a;
  --radius:   4px;
  --shadow:   4px 4px 0 #1a1a1a;
  --shadow-sm:2px 2px 0 #1a1a1a;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain texture */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════ DÉCO FLOTTANTE ═══════════════════ */
.deco {
  position: fixed;
  font-size: 3rem;
  opacity: 0.06;
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
  z-index: 1;
}
.deco:nth-child(1) { top: 10%;    left: 4%;  animation-delay: 0s; }
.deco:nth-child(2) { top: 30%;    right: 3%; animation-delay: 1s; }
.deco:nth-child(3) { bottom: 20%; left: 7%;  animation-delay: 2s; }
.deco:nth-child(4) { bottom: 10%; right: 5%; animation-delay: 0.5s; }
@keyframes float {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(12deg); }
}

/* ═══════════════════ HEADER ═══════════════════ */
header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 2px solid var(--border);
  background: var(--card);
}

.logo {
  font-family: 'Permanent Marker', cursive;
  font-size: 2rem;
  color: var(--ink);
  text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.puff { display: inline-block; animation: spin 4s linear infinite; }
@keyframes spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}
.tagline {
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}

nav { display: flex; gap: 10px; }
.nav-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex; align-items: center;
}
.nav-btn:hover {
  background: var(--ink);
  color: #fff;
  transform: translate(-2px,-2px);
  box-shadow: var(--shadow);
}

/* ═══════════════════ HERO ═══════════════════ */
.hero {
  position: relative; z-index: 5;
  text-align: center;
  padding: 52px 24px 20px;
}
.hero h1 {
  font-family: 'Permanent Marker', cursive;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
}
.highlight {
  color: var(--accent);
  display: inline-block;
  animation: wobble 2s ease-in-out infinite;
}
@keyframes wobble {
  0%,100% { transform: rotate(-2deg); }
  50%     { transform: rotate(3deg); }
}
.hero p {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ═══════════════════ CONTAINER ═══════════════════ */
.container {
  position: relative; z-index: 5;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ═══════════════════ EDITOR CARD ═══════════════════ */
.editor-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 28px;
}

.editor-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  background: var(--ink);
}
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); }
.dot-r { background: #ff5f57; }
.dot-y { background: #ffbd2e; }
.dot-g { background: #28c840; }
.toolbar-label { color: #666; font-size: 0.7rem; margin-left: 6px; }

.editor-title-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 0 16px;
  border-bottom: 2px dashed #e8e3d8;
}
.editor-title-row input {
  flex: 1; min-width: 160px;
  border: none; outline: none;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem; font-weight: 700;
  padding: 12px 0;
  background: transparent; color: var(--ink);
}
.editor-title-row input::placeholder { color: #ccc; }

.lang-select, .expire-select {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
  background: var(--bg);
  cursor: pointer;
  outline: none;
}

textarea#paste-content {
  width: 100%; min-height: 300px;
  border: none; outline: none; resize: vertical;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem; line-height: 1.75;
  padding: 20px;
  background: transparent; color: var(--ink);
  display: block;
}

.editor-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-top: 2px dashed #e8e3d8;
  flex-wrap: wrap; gap: 8px;
}
.char-count { font-size: 0.68rem; color: var(--muted); }
.char-count.warn { color: var(--accent); }

/* ═══════════════════ BUTTONS ═══════════════════ */
.btn-submit {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.1rem;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--border);
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn-submit:hover  { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--border); }
.btn-submit:active { transform: translate(1px,1px);   box-shadow: 1px 1px 0 var(--border); }

.btn-small {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem; font-weight: 700;
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
  display: inline-flex; align-items: center;
}
.btn-small:hover  { background: var(--ink); color: #fff; transform: translate(-2px,-2px); box-shadow: var(--shadow); }
.btn-small.btn-green { background: var(--accent2); color: #fff; border-color: var(--border); }
.btn-small.btn-green:hover { background: #009e88; color: #fff; }

/* ═══════════════════ PASTE VIEW ═══════════════════ */
.paste-header {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-top: 28px;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 12px;
}
.paste-title-display {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.8rem;
  color: var(--ink);
  font-weight: normal;
}
.paste-meta { font-size: 0.68rem; color: var(--muted); margin-top: 5px; line-height: 1.8; }
.paste-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.url-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.url-label {
  font-size: 0.65rem;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); white-space: nowrap;
}
.url-text {
  flex: 1; font-size: 0.78rem;
  color: var(--accent);
  word-break: break-all;
}
.url-copy {
  background: none; border: none; cursor: pointer; font-size: 1rem;
  padding: 2px 6px; border-radius: 3px;
  transition: transform 0.15s;
}
.url-copy:hover { transform: scale(1.2); }

.paste-code-block {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 12px;
  overflow: hidden;
}
.paste-code-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px;
  border-bottom: 2px solid var(--border);
  background: var(--ink); color: #aaa;
  font-size: 0.68rem;
}

.line-numbers-wrap {
  display: flex;
  overflow-x: auto;
}
.line-numbers {
  display: flex; flex-direction: column;
  padding: 20px 12px 20px 16px;
  border-right: 2px solid #e8e3d8;
  min-width: 48px;
  text-align: right;
  user-select: none;
  flex-shrink: 0;
}
.line-numbers span {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.75;
  color: #ccc;
}
.paste-code {
  padding: 20px 24px;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.75;
  white-space: pre;
  color: var(--ink);
  flex: 1;
  overflow-x: auto;
}

/* ═══════════════════ SECTION TITLE ═══════════════════ */
.section-title {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.5rem;
  margin-top: 48px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  font-weight: normal;
}
.section-more {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.section-more:hover { text-decoration: underline; }

/* ═══════════════════ PASTE CARDS GRID ═══════════════════ */
.pastes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.pastes-grid--large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.paste-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 20px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}
.paste-card-color-bar {
  position: absolute; top: 0; left: 0; width: 5px; height: 100%;
  background: var(--accent3);
}
.paste-card:nth-child(3n+2) .paste-card-color-bar { background: var(--accent2); }
.paste-card:nth-child(3n+3) .paste-card-color-bar { background: var(--accent); }
.paste-card:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow); }

.paste-card-title {
  font-weight: 700; font-size: 0.82rem;
  margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.paste-card-lang { font-size: 0.7rem; color: var(--muted); margin-bottom: 8px; }
.paste-card-meta {
  font-size: 0.65rem; color: #bbb;
  display: flex; gap: 10px; flex-wrap: wrap;
}

/* ═══════════════════ PAGINATION ═══════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 32px;
}
.page-info { font-size: 0.75rem; color: var(--muted); }

/* ═══════════════════ 404 / EMPTY ═══════════════════ */
.not-found {
  text-align: center;
  padding: 80px 24px;
}
.not-found-emoji { font-size: 5rem; margin-bottom: 20px; }
.not-found h2 {
  font-family: 'Permanent Marker', cursive;
  font-size: 2rem; font-weight: normal;
  margin-bottom: 10px;
}
.not-found p { color: var(--muted); font-size: 0.85rem; margin-bottom: 28px; }

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--muted);
  font-size: 0.8rem;
  border: 2px dashed #d0cab8;
  border-radius: var(--radius);
}
.empty-state .big { font-size: 3rem; display: block; margin-bottom: 10px; }

/* ═══════════════════ TOAST ═══════════════════ */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: var(--ink); color: #fff;
  font-family: 'Space Mono', monospace; font-size: 0.78rem;
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }

/* ═══════════════════ FOOTER ═══════════════════ */
footer {
  position: relative; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  padding: 16px 40px;
  border-top: 2px solid var(--border);
  background: var(--card);
  font-size: 0.68rem;
  color: var(--muted);
}
footer a { color: var(--ink); text-decoration: none; font-weight: 700; }
footer a:hover { color: var(--accent); }

/* ═══════════════════ MAIN ═══════════════════ */
main { min-height: calc(100vh - 140px); }

/* ═══════════════════ RESPONSIVE ═══════════════════ */
@media (max-width: 640px) {
  header { padding: 12px 16px; flex-wrap: wrap; }
  .container { padding: 0 12px 60px; }
  .hero { padding: 32px 16px 12px; }
  footer { padding: 12px 16px; }
  .paste-header { flex-direction: column; }
  .paste-actions { width: 100%; }
}
