/* =============================================
   FileShare — Modern Frosted Glass UI
   ============================================= */

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

:root {
  --bg:        #0d0f14;
  --surface:   rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border:    rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text:      #f0f2f5;
  --text-muted:#8b90a0;
  --accent:    #6c8fff;
  --accent-glow: rgba(108,143,255,0.25);
  --success:   #4ade80;
  --error:     #f87171;
  --r-sm:      10px;
  --r-md:      16px;
  --r-lg:      24px;
  --r-xl:      32px;

  /* file type colors */
  --c-image:   #a78bfa;
  --c-video:   #f97316;
  --c-audio:   #34d399;
  --c-doc:     #60a5fa;
  --c-code:    #fbbf24;
  --c-archive: #e879f9;
  --c-other:   #94a3b8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Background orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  animation: orb-drift 20s ease-in-out infinite alternate;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #4f46e5, transparent 70%);
  top: -200px; left: -100px;
  animation-duration: 22s;
}

.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  bottom: -150px; right: -50px;
  animation-duration: 18s;
  animation-delay: -8s;
}

.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #a855f7, transparent 70%);
  top: 40%; left: 50%;
  animation-duration: 26s;
  animation-delay: -14s;
}

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.08); }
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 80px;
  flex: 1;
}

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 16px;
}

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

.nav-icon {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
}

.nav-logo {
  height: 28px;
  width: auto;
}

.nav-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-stats {
  display: flex;
  gap: 8px;
}

.stat-pill {
  font-size: 12px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ── Hero ── */
.hero {
  padding: 52px 0 40px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, #6c8fff 0%, #a78bfa 60%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  margin-top: 14px;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Alerts ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  animation: slide-in 0.3s ease;
}

.alert-error   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: #fca5a5; }
.alert-success { background: rgba(74,222,128,0.1);  border: 1px solid rgba(74,222,128,0.3);  color: #86efac; }
.alert-icon    { font-size: 1rem; font-weight: 700; }

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

/* ── Upload Section ── */
.upload-section {
  margin-bottom: 48px;
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--surface);
  backdrop-filter: blur(20px);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(108,143,255,0.06);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 52px 32px;
  text-align: center;
}

.dropzone-icon {
  width: 68px; height: 68px;
  border-radius: var(--r-lg);
  background: rgba(108,143,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.dropzone:hover .dropzone-icon {
  transform: translateY(-3px);
}

.dropzone-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.dropzone-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* ── File preview in dropzone ── */
.file-preview-list {
  padding: 0 20px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
}

.preview-chip span { 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-chip strong {
  color: var(--accent);
  font-weight: 500;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--r-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(108,143,255,0.35);
}

.btn-primary:hover {
  background: #7a9bff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108,143,255,0.45);
}

.btn-upload {
  background: linear-gradient(135deg, #6c8fff, #a78bfa);
  color: #fff;
  padding: 12px 28px;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(108,143,255,0.4);
}

.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108,143,255,0.5);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 0 4px;
  animation: slide-in 0.25s ease;
}

/* ── Icon buttons ── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.16s ease;
}

.btn-download:hover {
  background: rgba(108,143,255,0.15);
  border-color: rgba(108,143,255,0.4);
  color: var(--accent);
}

.btn-delete:hover {
  background: rgba(248,113,113,0.12);
  border-color: rgba(248,113,113,0.3);
  color: #f87171;
}

.inline-form { display: inline; }

/* ── Files Section ── */
.files-section {
  margin-top: 8px;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.files-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.search-wrap {
  position: relative;
}

.search-input {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  padding: 9px 16px 9px 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ── File Grid ── */
.files-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
  animation: card-in 0.3s ease backwards;
}

.file-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateX(3px);
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.file-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Per-type icon backgrounds */
.file-type-image   { background: rgba(167,139,250,0.15); color: var(--c-image); }
.file-type-video   { background: rgba(249,115,22,0.15);  color: var(--c-video); }
.file-type-audio   { background: rgba(52,211,153,0.15);  color: var(--c-audio); }
.file-type-doc     { background: rgba(96,165,250,0.15);  color: var(--c-doc); }
.file-type-code    { background: rgba(251,191,36,0.15);  color: var(--c-code); }
.file-type-archive { background: rgba(232,121,249,0.15); color: var(--c-archive); }
.file-type-other   { background: rgba(148,163,184,0.12); color: var(--c-other); }

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

.file-card-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'JetBrains Mono', monospace;
}

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

.file-card-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.empty-icon  { font-size: 3rem; margin-bottom: 16px; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.empty-sub   { font-size: 0.9rem; color: var(--text-muted); margin-top: 6px; }

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
  font-size: 0.9rem;
}

/* ── Footer ── */
.footer {
  margin-top: 80px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .nav-stats   { display: none; }
  .hero-title  { font-size: 2rem; }
  .files-header { flex-direction: column; align-items: flex-start; }
  .search-input { width: 100%; }
  .file-card   { padding: 12px 14px; }
}
