:root {
  --bg-deep: #07080c;
  --bg-surface: rgba(255, 255, 255, 0.045);
  --bg-surface-hover: rgba(255, 255, 255, 0.075);
  --border-glass: rgba(255, 255, 255, 0.09);
  --border-highlight: rgba(255, 255, 255, 0.18);
  --text-primary: hsl(220, 20%, 97%);
  --text-secondary: hsl(220, 12%, 60%);
  --text-muted: hsl(220, 10%, 42%);
  --accent-blue: hsl(212, 96%, 58%);
  --accent-indigo: hsl(245, 82%, 67%);
  --accent-green: hsl(152, 76%, 48%);
  --accent-amber: hsl(38, 95%, 58%);
  --accent-red: hsl(350, 84%, 60%);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-glass: 0 32px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

/* ─── Animated Mesh Grid Background ─── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  background-color: var(--bg-deep);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Mesh gradient orbs */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(30, 80, 200, 0.28), transparent),
    radial-gradient(ellipse 55% 45% at 80% 25%, rgba(100, 60, 220, 0.22), transparent),
    radial-gradient(ellipse 50% 55% at 50% 90%, rgba(10, 140, 90, 0.14), transparent);
  animation: meshDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Animated grid lines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
  animation: gridPulse 8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes meshDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-3%, 2%) scale(1.04); }
  66%  { transform: translate(3%, -2%) scale(0.97); }
  100% { transform: translate(-1%, 3%) scale(1.02); }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ─── Layout ─── */
.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ─── Pill Navbar ─── */
.apple-nav {
  position: sticky;
  top: 18px;
  z-index: 50;
  max-width: 920px;
  width: calc(100% - 48px);
  margin: 20px auto 40px;
  padding: 13px 22px;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.72);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, hsl(212, 96%, 52%), hsl(245, 82%, 62%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.5);
}

.nav-links { display: flex; align-items: center; gap: 6px; }

.nav-pill {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-pill:hover, .nav-pill.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ─── Main Upload Card (Glassmorphism) ─── */
.upload-card {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 28px;
  padding: 36px 36px 32px;
  border-radius: 26px;
  background: rgba(22, 25, 38, 0.6);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.upload-card-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

/* ─── Inner Dropzone with own mesh gradient ─── */
.dropzone {
  border: 1.5px dashed rgba(59, 130, 246, 0.55);
  border-radius: 18px;
  padding: 56px 28px;
  text-align: center;
  cursor: pointer;
  background:
    radial-gradient(ellipse 70% 60% at 25% 40%, rgba(80, 40, 180, 0.35), transparent 60%),
    radial-gradient(ellipse 60% 70% at 75% 60%, rgba(20, 130, 80, 0.25), transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 10%, rgba(30, 70, 180, 0.2), transparent 60%),
    rgba(15, 18, 30, 0.5);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(59, 130, 246, 0);
  border-radius: 17px;
  transition: background 0.22s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: rgba(59, 130, 246, 0.9);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3), 0 0 40px rgba(59, 130, 246, 0.15);
}

.dropzone:hover::before, .dropzone.dragover::before {
  background: rgba(59, 130, 246, 0.05);
}

.dropzone-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  position: relative;
}

.dropzone-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  position: relative;
}

/* ─── Progress Bar ─── */
.progress-wrap { margin-top: 22px; }

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, hsl(212, 96%, 58%), hsl(245, 82%, 67%), rgba(255, 255, 255, 0.15));
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* ─── 3 Stat Cards ─── */
.stat-grid {
  width: 100%;
  max-width: 820px;
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-width: 0;
  padding: 22px 24px;
  border-radius: 20px;
  background: rgba(18, 20, 32, 0.55);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ─── Generic Bento Card ─── */
.bento-card {
  min-width: 0;
  width: 100%;
  overflow-wrap: break-word;
  background: rgba(18, 20, 32, 0.55);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-glass);
  transition: all 0.22s ease;
}

.bento-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

@media (max-width: 900px) {
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
  .stat-grid { grid-template-columns: 1fr; }
  .apple-nav { margin: 12px auto 28px; width: calc(100% - 28px); }
  .upload-card { padding: 22px 18px 20px; }
}

/* ─── Upload Status Box ─── */
.upload-status-box {
  margin-top: 20px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
}

/* ─── Share Result Box ─── */
.result-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ─── Buttons ─── */
.btn-apple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, hsl(212, 96%, 52%), hsl(245, 82%, 62%));
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
  letter-spacing: -0.01em;
}

.btn-apple:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.5);
}

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

.btn-apple.btn-green {
  background: linear-gradient(135deg, hsl(152, 76%, 40%), hsl(164, 80%, 34%));
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.btn-secondary:hover:not(:disabled) {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.11);
}

/* ─── Apple Input ─── */
.apple-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.18s ease;
}

.apple-input:focus { border-color: rgba(59, 130, 246, 0.6); }

/* ─── Status Chip ─── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 500;
}

/* ─── Native Ad Bento Slot ─── */
.ad-slot-bento {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.ad-slot-bento:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.06);
  transform: translateY(-1px);
}

.ad-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Anti-AdBlock Modal ─── */
.adblock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(4, 5, 9, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.adblock-overlay.visible { display: flex; }

.adblock-modal {
  max-width: 460px;
  width: 100%;
  background: rgba(18, 20, 32, 0.95);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 24px;
  padding: 36px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8);
}

/* ─── macOS In-Page Push Toast ─── */
.macos-push-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  width: 330px;
  background: rgba(18, 22, 36, 0.9);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s ease;
}

.macos-push-toast.show { display: flex; }

/* ─── Download Page Button States ─── */
.dl-card {
  text-align: center;
  padding: 48px 36px;
}

/* ─── Admin Table ─── */
.bento-card.col-3 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.table-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table-clean th, .table-clean td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-clean td:first-child {
  max-width: 260px;
  overflow-wrap: anywhere;
}

.table-clean td:last-child {
  white-space: nowrap;
}

.table-clean th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
