@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #060b1a;
  --bg2: #0a1025;
  --bg3: #0e1630;
  --card: #0d1428;
  --border: #142040;
  --border2: #1a2a50;
  --blue: #0066ff;
  --blue2: #0099ff;
  --cyan: #00ccff;
  --glow: #0066ff44;
  --text: #ddeeff;
  --text2: #6688aa;
  --text3: #334466;
  --green: #00dd88;
  --red: #ff4466;
  --amber: #ffaa00;
  --radius: 18px;
  --radius-sm: 12px;
}

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

html { height: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
}

/* Grid bg pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

/* Glow orbs */
body::after {
  content: '';
  position: fixed;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, #0044ff12 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── WRAPPER ── */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #0044cc, #0099ff);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 16px #0066ff40;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #5599ff, #00ccff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text3);
  transition: all 0.3s;
}
.dot.connecting { background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 1s infinite; }
.dot.online { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.connected { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: pulse 2s infinite; }
.dot.offline { background: var(--text3); }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── SCREENS ── */
.screen { display: none; flex: 1; padding: 24px; flex-direction: column; gap: 16px; }
.screen.active { display: flex; animation: fadeUp 0.3s ease; }

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

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 16px 0 8px;
}

.hero-icon {
  font-size: 3.5rem;
  display: block;
  margin: 0 auto 16px;
  filter: drop-shadow(0 0 20px #0066ff60);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)}
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #88bbff 0%, #00ccff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.hero p {
  font-size: 0.85rem;
  color: var(--text2);
  margin-top: 8px;
  line-height: 1.6;
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #1a3a70, transparent);
}

.card-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 14px;
}

/* ── BUTTONS ── */
.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.01em;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #0055dd, #0088ff);
  color: #fff;
  box-shadow: 0 4px 20px #0055dd40;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px #0055dd60;
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text3);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  padding: 10px 16px;
}
.btn-ghost:hover { color: var(--text2); border-color: var(--border2); }

.btn-icon { font-size: 1.1rem; }

/* ── HOME CHOICE CARDS ── */
.choice-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.choice-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, #ffffff03);
  opacity: 0;
  transition: opacity 0.2s;
}

.choice-card:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px #00000040;
}

.choice-card:hover::after { opacity: 1; }

.choice-card.send:hover { border-color: #0066ff44; box-shadow: 0 6px 24px #0066ff20; }
.choice-card.receive:hover { border-color: #00cc8844; box-shadow: 0 6px 24px #00cc8820; }

.choice-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.send .choice-ico { background: linear-gradient(135deg, #003399, #0066ff); box-shadow: 0 4px 16px #0055dd30; }
.receive .choice-ico { background: linear-gradient(135deg, #005533, #00bb66); box-shadow: 0 4px 16px #00aa5530; }

.choice-info { flex: 1; }
.choice-info h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.choice-info p { font-size: 0.76rem; color: var(--text2); line-height: 1.4; }

.choice-arrow { font-size: 1rem; color: var(--text3); }

/* ── FEATURES ── */
.features {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.feat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.feat-ico { font-size: 1.2rem; display: block; margin-bottom: 5px; }
.feat-txt { font-size: 0.65rem; color: var(--text3); line-height: 1.4; }

/* ── CODE DISPLAY ── */
.code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 4px;
}

.code-text {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--cyan);
  word-break: break-all;
  line-height: 1.5;
}

.btn-icon-sm {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-icon-sm:hover { background: var(--border); color: var(--text); }

/* ── QR ── */
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
#qr-code { line-height: 0; }
#qr-code canvas, #qr-code img { border-radius: 8px; }

/* ── SHARE LINK ── */
.share-row {
  display: flex;
  gap: 8px;
}
.share-row input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── WAITING ── */
.waiting {
  text-align: center;
  padding: 20px 0;
}

.waiting-ring {
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  border-top-color: var(--blue2);
  animation: spin 1.2s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.waiting h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.waiting p { font-size: 0.8rem; color: var(--text2); line-height: 1.6; }

/* ── INPUT ── */
.inp-group { display: flex; flex-direction: column; gap: 6px; }
.inp-label { font-size: 0.68rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.inp {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: border 0.15s;
  letter-spacing: 0.04em;
}
.inp:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #0066ff18; }
.inp::placeholder { color: var(--text3); }

/* ── DROP ZONE ── */
#drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg2);
}
#drop-zone:hover, #drop-zone.drag {
  border-color: var(--blue);
  background: #0066ff08;
  box-shadow: 0 0 30px #0066ff10;
}
.drop-ico { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: 0.7; }
.drop-txt { font-size: 0.85rem; color: var(--text2); margin-bottom: 4px; }
.drop-sub { font-size: 0.72rem; color: var(--text3); }

/* ── FILE LIST ── */
#file-list-wrap { display: none; }
#file-list { display: flex; flex-direction: column; gap: 7px; max-height: 180px; overflow-y: auto; }

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.file-ico { font-size: 1.3rem; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.file-size { font-size: 0.7rem; color: var(--text3); font-family: 'JetBrains Mono', monospace; }

/* ── PROGRESS ── */
.progress-file {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.progress-ico { font-size: 2.2rem; flex-shrink: 0; }
.progress-info { flex: 1; min-width: 0; }
.progress-name { font-size: 0.88rem; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-size { font-size: 0.72rem; color: var(--text3); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

.progress-track {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #0055dd, #00ccff);
  box-shadow: 0 0 10px #0088ff60;
  transition: width 0.2s ease;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 100%;
  background: linear-gradient(90deg, transparent, #ffffff40);
  animation: shimmer 1s linear infinite;
}
@keyframes shimmer { from{transform:translateX(-40px)} to{transform:translateX(40px)} }

.progress-pct {
  font-size: 0.72rem;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

/* ── DONE ── */
.done-icon {
  font-size: 4rem;
  text-align: center;
  display: block;
  margin: 8px auto 16px;
  filter: drop-shadow(0 0 20px #00dd8870);
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pop { from{transform:scale(0.5);opacity:0} to{transform:scale(1);opacity:1} }

.done-info { text-align: center; margin-bottom: 20px; }
.done-info h2 { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.done-info p { font-size: 0.82rem; color: var(--text2); }

.done-file {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}

/* ── LOADING ── */
.loading-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.loader {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-txt { font-size: 0.8rem; color: var(--text2); }

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text3);
  font-size: 0.72rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 24px #00000060;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: #00aa5544; color: var(--green); }
.toast.error { border-color: #aa003344; color: var(--red); }

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

/* ── LINK ── */
a { color: var(--blue2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 16px 24px 24px;
  font-size: 0.68rem;
  color: var(--text3);
}
