/* === RESET & VARS === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08080f;
  --surface: #0f0f1a;
  --surface2: #16162a;
  --border: rgba(120, 100, 255, 0.15);
  --border-bright: rgba(120, 100, 255, 0.4);
  --accent: #7c5cfc;
  --accent2: #4af0c4;
  --accent3: #f05a7a;
  --text: #e8e6ff;
  --text-muted: #6e6a9a;
  --font-display: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 14px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* === BACKGROUND === */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 92, 252, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 92, 252, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 252, 0.12) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
  z-index: 0;
  animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* === HEADER === */
header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 15, 0.8);
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}

.logo-icon {
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
}

.logo-text em {
  color: var(--accent2);
  font-style: normal;
}

nav {
  display: flex;
  gap: 0.5rem;
  background: var(--surface);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.nav-btn:hover { color: var(--text); }
.nav-btn.active {
  background: var(--accent);
  color: #fff;
}

/* === MAIN === */
main {
  flex: 1;
  position: relative;
  z-index: 5;
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: center;
}

.panel {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 660px;
  gap: 1.5rem;
  animation: fadeUp 0.35s ease both;
}

.panel.active { display: flex; }

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

/* === PANEL HEADER === */
.panel-header {
  text-align: center;
}

.panel-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.panel-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-weight: 300;
}

/* === DROP ZONE === */
.drop-zone {
  width: 100%;
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(124, 92, 252, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(124, 92, 252, 0.07);
}

.drop-zone.drag-over { transform: scale(1.01); }

.drop-icon {
  width: 56px;
  height: 56px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.drop-icon svg { width: 100%; height: 100%; }

.drop-label {
  font-size: 1.05rem;
  font-weight: 700;
}

.drop-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.btn-select {
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

.btn-select:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.drop-types {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
}

/* === FILE LIST === */
.file-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  animation: fadeUp 0.2s ease both;
}

.file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.file-remove:hover { color: var(--accent3); }

/* === UPLOAD BUTTON === */
.btn-upload {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #5a3dcf);
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.25s;
  letter-spacing: 0.04em;
  position: relative;
  overflow: hidden;
}

.btn-upload::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1));
  pointer-events: none;
}

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

.btn-upload:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 92, 252, 0.4);
}

.btn-icon {
  font-size: 1.1rem;
  transition: transform 0.2s;
}
.btn-upload:not(:disabled):hover .btn-icon { transform: translateX(4px); }

/* === PROGRESS === */
.progress-bar-wrap {
  width: 100%;
  background: var(--surface2);
  border-radius: 999px;
  height: 8px;
  position: relative;
  overflow: hidden;
}

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

.progress-label {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* === RESULT CARD === */
.result-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.result-header .result-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent2);
  display: block;
  margin-bottom: 0.3rem;
}

.result-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.code-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  width: 100%;
  justify-content: center;
}

#codeText {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--accent2);
}

.copy-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--accent2); border-color: var(--accent2); }
.copy-btn svg { width: 16px; height: 16px; }

.expiry-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.expiry-note strong { color: var(--accent3); }

.result-files {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-file-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  text-align: left;
}

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

.btn-dl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent2);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-dl:hover { background: var(--accent2); color: #000; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
}
.btn-secondary:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === CODE INPUT === */
.code-input-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.code-boxes {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.code-box {
  width: 52px;
  height: 64px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: all 0.2s;
  caret-color: var(--accent);
}

.code-box:focus {
  border-color: var(--accent);
  background: var(--surface2);
  box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.15);
}

.code-box.filled { border-color: var(--accent2); color: var(--accent2); }

.code-sep {
  color: var(--text-muted);
  font-size: 1.5rem;
  margin: 0 0.2rem;
  user-select: none;
}

/* === RECEIVE RESULT === */
.receive-result {
  width: 100%;
}

.receive-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.receive-files-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-dl-all {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-dl-all:hover { background: #5a3dcf; }

.receive-file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.8rem;
  animation: fadeUp 0.3s ease both;
}

.receive-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}

.receive-preview-video {
  width: 100%;
  max-height: 260px;
  display: block;
  background: #000;
}

.receive-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  gap: 0.8rem;
}

.receive-file-name {
  font-size: 0.85rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receive-file-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.error-msg {
  background: rgba(240, 90, 122, 0.1);
  border: 1px solid rgba(240, 90, 122, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent3);
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  text-align: center;
  font-family: var(--font-mono);
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(74, 240, 196, 0.1);
  border: 1px solid rgba(74, 240, 196, 0.3);
  color: var(--accent2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* === FOOTER === */
footer {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

footer .mono { font-family: var(--font-mono); color: var(--accent); }

/* === RESPONSIVE === */
@media (max-width: 500px) {
  header { padding: 1rem 1.2rem; }
  .logo-text { font-size: 1rem; }
  .code-box { width: 42px; height: 54px; font-size: 1.3rem; }
  #codeText { font-size: 2rem; }
  .result-card { padding: 1.5rem; }
}

/* === AUTH / MODAL === */
.header-auth { display: flex; align-items: center; gap: 0.5rem; }

.btn-auth {
  background: var(--accent);
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-auth:hover { background: #5a3dcf; }

.btn-auth-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-auth-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.username-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent2);
  background: rgba(74,240,196,0.1);
  border: 1px solid rgba(74,240,196,0.2);
  padding: 4px 10px;
  border-radius: 999px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  position: relative;
  animation: fadeUp 0.25s ease both;
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.modal-tabs {
  display: flex;
  gap: 0.3rem;
  background: var(--bg);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-tab.active { background: var(--accent); color: #fff; }

.modal-panel { display: none; flex-direction: column; gap: 0.8rem; }
.modal-panel.active { display: flex; }

.auth-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text-muted); }

.auth-error {
  color: var(--accent3);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  min-height: 1rem;
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  text-align: center;
  margin-top: 0.3rem;
}

/* === RESULT FILE LINKS === */
.result-file-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.5rem;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
}

.link-row-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
}

.link-row-url {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-mini {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: color 0.2s;
  flex-shrink: 0;
}
.copy-mini:hover { color: var(--accent2); }

/* === MY FILES === */
.my-files-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.my-file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  gap: 0;
  animation: fadeUp 0.25s ease both;
}

.my-file-thumb {
  width: 90px;
  flex-shrink: 0;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
}

.my-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-file-body {
  flex: 1;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.my-file-name {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-file-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.my-file-links {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.my-file-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.9rem;
  flex-shrink: 0;
}

.btn-delete {
  background: rgba(240,90,122,0.1);
  border: 1px solid rgba(240,90,122,0.25);
  color: var(--accent3);
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-delete:hover { background: var(--accent3); color: #fff; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 3rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.permanent-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(74,240,196,0.08);
  border: 1px solid rgba(74,240,196,0.2);
  color: var(--accent2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
}
