/* WaffleDrop – Design System */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  --bg:       #080808;
  --surface:  #111111;
  --surface2: #191919;
  --surface3: #222222;
  --border:   #282828;
  --border2:  #333333;
  --accent:   #f5a623;
  --accent2:  #ff6b35;
  --green:    #34d399;
  --red:      #f87171;
  --blue:     #60a5fa;
  --text:     #f2ede4;
  --text2:    #9a9189;
  --muted:    #b3b0ae;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow: 0 8px 40px rgba(0,0,0,0.6);
  --glow:   0 0 40px rgba(245,166,35,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Background ──────────────────────────────────────────────────────────── */
#bgCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 5% 5%,  rgba(245,166,35,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 70% at 95% 95%, rgba(255,107,53,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 50% 100%, rgba(245,166,35,0.03) 0%, transparent 50%);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(8,8,8,0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-stat {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.05em;
  margin-left: 10px;
}
.nav-link:hover { color: var(--text); }

/* ── Main ─────────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px 80px;
  gap: 36px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  max-width: 600px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 5px 12px;
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 100px;
  background: rgba(245,166,35,0.06);
}

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 7vw, 80px);
  line-height: 0.95;
  letter-spacing: -3px;
  color: var(--text);
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.badge-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid var(--border2);
  color: var(--text2);
  letter-spacing: 0.06em;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 4px;
}

.tab-btn {
  padding: 10px 32px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}

.tab-btn.active {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.tab-btn:not(.active):hover { color: var(--text2); }

/* ── Panel / Card ─────────────────────────────────────────────────────────── */
.panel { width: 100%; max-width: 560px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* ── Drop Zone ────────────────────────────────────────────────────────────── */
.drop-zone {
  padding: 52px 40px;
  text-align: center;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: background 0.25s;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 60%, rgba(245,166,35,0.07) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
}

.drop-zone:hover::before,
.drop-zone.drag-over::before { opacity: 1; }

.drop-zone.drag-over {
  background: rgba(245,166,35,0.025);
}

.drop-zone.drag-over .upload-ring { border-color: var(--accent); }

.upload-ring {
  width: 80px; height: 80px;
  border: 1.5px solid var(--border2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  transition: border-color 0.25s;
  position: relative;
}

.upload-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(245,166,35,0.08);
}

.upload-ring svg { color: var(--accent); }

.drop-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
}

.drop-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 20px;
}

.browse-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

#fileInput { display: none; }

/* ── File List ────────────────────────────────────────────────────────────── */
.file-count-bar {
  padding: 10px 20px;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: slide-in 0.2s ease both;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.file-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.file-info { flex: 1; min-width: 0; }

.file-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size { font-size: 11px; color: var(--muted); margin-top: 1px; }

.file-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
}
.file-remove:hover { color: var(--red); background: rgba(248,113,113,0.08); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

/* ── Share section ────────────────────────────────────────────────────────── */
.share-section {
  padding: 20px 20px 0;
}

.share-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

.qr-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
}

#qrCanvas {
  display: block;
  border-radius: 6px;
  image-rendering: pixelated;
}

.share-right { display: flex; flex-direction: column; gap: 10px; }

.share-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

.code-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 4px;
  color: var(--accent);
  flex: 1;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}
.icon-btn:hover { color: var(--accent); }

.link-row {
  display: flex;
  gap: 8px;
}

.link-input {
  flex: 1;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  outline: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ── Status bar ───────────────────────────────────────────────────────────── */
.status-section {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}
.status-dot.waiting    { background: var(--muted); animation: pulse-dot 2s infinite; }
.status-dot.connecting { background: var(--accent); animation: pulse-dot 0.8s infinite; }
.status-dot.connected  { background: var(--blue); }
.status-dot.done       { background: var(--green); }
.status-dot.error      { background: var(--red); }

.status-text { font-size: 12px; color: var(--text2); }

/* ── Transfer progress ────────────────────────────────────────────────────── */
.transfer-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 8px;
}

.progress-track {
  height: 3px;
  background: var(--surface3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

.speed-info { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ── Done state ───────────────────────────────────────────────────────────── */
.done-state {
  padding: 36px;
  text-align: center;
}

.done-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 1.5px solid rgba(52,211,153,0.3);
  background: rgba(52,211,153,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 30px;
}

.done-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--green);
  margin-bottom: 8px;
}

.done-sub { font-size: 12px; color: var(--muted); }

/* ── Card footer ──────────────────────────────────────────────────────────── */
.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.04em;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.btn-primary:hover:not(:disabled) {
  background: #f7b84e;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(245,166,35,0.35);
}

.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.btn-ghost {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--border2); color: var(--text); }

.btn-danger { background: rgba(248,113,113,0.1); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.15); }

.btn-sm { padding: 8px 16px; font-size: 12px; }

.btn.copied { background: rgba(52,211,153,0.1); color: var(--green); border-color: rgba(52,211,153,0.2); }

.btn-full { width: 100%; }

/* ── Copy btn ─────────────────────────────────────────────────────────────── */
#copyBtn {
  padding: 9px 16px;
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
#copyBtn:hover { border-color: var(--accent); color: var(--accent); }
#copyBtn.copied { border-color: var(--green); color: var(--green); }

/* ── Receive panel ────────────────────────────────────────────────────────── */
.receive-form {
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: block;
}

.receive-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'DM Mono', monospace;
  font-size: 15px;
  letter-spacing: 3px;
  outline: none;
  text-transform: uppercase;
  text-align: center;
  transition: border-color 0.2s;
}
.receive-input:focus { border-color: var(--accent); }
.receive-input::placeholder { letter-spacing: 2px; color: var(--muted); text-transform: none; }

/* ── Incoming card ────────────────────────────────────────────────────────── */
.incoming-section { padding: 20px; }

.incoming-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.incoming-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.incoming-file-icon {
  width: 52px; height: 52px;
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.incoming-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.incoming-meta { font-size: 11px; color: var(--muted); }

/* ── Features section ─────────────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 560px;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s;
}

.feature:hover { border-color: var(--border2); }

.feature-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.feature-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── How it works ─────────────────────────────────────────────────────────── */
.how-section {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

.step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-body { flex: 1; }
.step-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.step-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.25s ease;
  max-width: 320px;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: none; }
.toast-success { border-color: rgba(52,211,153,0.3); }
.toast-error   { border-color: rgba(248,113,113,0.3); }
.toast-info    { border-color: rgba(96,165,250,0.3); }

.toast-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: rgba(52,211,153,0.15); color: var(--green); }
.toast-error   .toast-icon { background: rgba(248,113,113,0.15); color: var(--red); }
.toast-info    .toast-icon { background: rgba(96,165,250,0.15); color: var(--blue); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--text2); }

/* ── Utils ────────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { padding: 16px 20px; }
  .nav-right .nav-stat { display: none; }
  main { padding: 40px 16px 60px; }
  .hero h1 { font-size: 44px; letter-spacing: -2px; }
  .features { grid-template-columns: 1fr; }
  .share-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 12px; }
  .drop-zone { padding: 36px 24px; }
  .receive-form { padding: 24px 20px; }
}