:root {
  --bg1: #0b0620;
  --bg2: #150a33;
  --accent1: #7c5cff;
  --accent2: #00e5ff;
  --accent3: #ff6bcb;
  --gold: #ffd166;
  --text: #f4f1ff;
  --muted: #b7aee6;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.14);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 40px rgba(124, 92, 255, 0.45);
  --grad: linear-gradient(90deg, var(--accent1), var(--accent2), var(--accent3), var(--gold));
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Vazirmatn", system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background:
    radial-gradient(1200px 800px at 15% -10%, #2a1a63 0%, transparent 60%),
    radial-gradient(1000px 700px at 100% 110%, #241158 0%, transparent 55%),
    linear-gradient(160deg, var(--bg1), var(--bg2) 55%, #180b3a);
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  animation: floatOrb 14s ease-in-out infinite;
}
.orb-a { width: 380px; height: 380px; background: var(--accent1); top: -120px; left: -100px; }
.orb-b { width: 320px; height: 320px; background: var(--accent2); bottom: -100px; right: -80px; animation-delay: -4s; opacity: 0.35; }
.orb-c { width: 240px; height: 240px; background: var(--accent3); top: 45%; right: 15%; animation-delay: -8s; opacity: 0.3; }

@keyframes floatOrb {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); }
  33% { transform: translateY(-40px) translateX(30px) scale(1.08); }
  66% { transform: translateY(25px) translateX(-25px) scale(0.94); }
}

main, header, footer { position: relative; z-index: 1; }

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.grad-text {
  background: var(--grad);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 6s linear infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  border-radius: 999px;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.5px;
}
.brand-sub { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 3px; }
.nav-links { display: flex; gap: 8px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.3s ease;
}
.nav-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-glow);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 150px 24px 80px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 28px;
  animation: popIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 12px var(--accent2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.6; }
}

.title {
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 18px;
  animation: fadeUp 0.9s 0.1s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.subtitle {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 44px;
  animation: fadeUp 0.9s 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* ---------- Dropzone ---------- */
.dropzone {
  width: 100%;
  max-width: 620px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 56px 24px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  animation: fadeUp 0.9s 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent2);
  background: rgba(0, 229, 255, 0.07);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 0 50px rgba(0, 229, 255, 0.3);
}
.dropzone.uploading { opacity: 0.45; pointer-events: none; }

.dz-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  background: var(--grad);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 12px 35px rgba(124, 92, 255, 0.5);
  animation: bounceFloat 2.6s ease-in-out infinite, gradientShift 4s linear infinite;
}

@keyframes bounceFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.dz-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.dz-hint { color: var(--muted); font-size: 14px; }

/* ---------- Progress ---------- */
.progress-wrap {
  width: 100%;
  max-width: 620px;
  margin-top: 28px;
  padding: 24px 28px;
  border-radius: var(--radius);
  animation: fadeUp 0.4s ease both;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}
.progress-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad);
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
  transition: width 0.25s ease;
}

/* ---------- Result ---------- */
.result {
  width: 100%;
  max-width: 620px;
  margin-top: 28px;
  padding: 34px 28px;
  border-radius: var(--radius);
  animation: popIn 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.result-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: rgba(0, 229, 255, 0.16);
  color: var(--accent2);
  border: 2px solid rgba(0, 229, 255, 0.5);
  animation: popIn 0.5s 0.15s ease both;
}
.result-title { font-size: 19px; font-weight: 800; margin-bottom: 20px; }
.link-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.link-input {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  direction: ltr;
  text-align: center;
}
.link-input:focus { outline: none; border-color: var(--accent2); }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
}
.btn-primary {
  background: var(--grad);
  background-size: 200% 100%;
  color: #fff;
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.45);
}
.btn-primary:hover {
  transform: translateY(-3px);
  background-position: 100% 0;
  box-shadow: 0 14px 40px rgba(124, 92, 255, 0.6);
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--glass-border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-3px); }
.btn-copy {
  background: rgba(0, 229, 255, 0.15);
  color: var(--accent2);
  border: 1px solid rgba(0, 229, 255, 0.4);
  padding: 12px 20px;
}
.btn-copy:hover { background: rgba(0, 229, 255, 0.28); }
.btn-danger {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.4);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.3); transform: translateY(-3px); }

/* ---------- Error ---------- */
.error {
  width: 100%;
  max-width: 620px;
  margin-top: 24px;
  padding: 16px 22px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ff9d9d;
  font-size: 14px;
  animation: shake 0.5s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- Gallery ---------- */
.gallery {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 100px;
}
.section-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 36px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.vcard {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.4s ease;
}
.vcard:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), var(--shadow-glow);
}
.vcard-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #000;
}
.vcard-body { padding: 14px 16px 18px; }
.vcard-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vcard-meta { font-size: 12px; color: var(--muted); }
.vcard-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 6, 32, 0.35);
  color: #fff;
  font-size: 26px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.vcard:hover .vcard-play { opacity: 1; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 36px 24px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Player page ---------- */
.player-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 130px 24px 80px;
}
.player-card {
  border-radius: 28px;
  padding: 30px;
  text-align: center;
}
.player-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 3px;
}
.watermark { color: var(--muted); font-weight: 500; }
.video-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), var(--shadow-glow);
  background: #000;
}
.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
}
.gfw-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: clamp(60px, 14vw, 150px);
  font-weight: 900;
  letter-spacing: 10px;
  color: rgba(255, 255, 255, 0.08);
  animation: watermarkFloat 5s ease-in-out infinite;
  user-select: none;
}
@keyframes watermarkFloat {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.04); }
}
.player-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  margin: 26px 0 8px;
  word-break: break-word;
}
.player-meta { color: var(--muted); font-size: 14px; margin-bottom: 26px; }

.player-desc {
  margin: 24px auto 0;
  max-width: 720px;
  padding: 18px 24px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 15px;
  line-height: 2;
  text-align: right;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 100px 20px 60px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 28px;
  padding: 44px 36px;
  text-align: center;
  animation: popIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.login-logo {
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradientShift 4s linear infinite, bounceFloat 3s ease-in-out infinite;
  box-shadow: 0 16px 45px rgba(124, 92, 255, 0.55);
}
.login-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.login-card p { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.field {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 18px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.field:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.15); }
.login-error {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.45);
  color: #ff9d9d;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  animation: shake 0.5s ease;
}

.remember {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  cursor: pointer;
  user-select: none;
}
.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent2);
  cursor: pointer;
}

/* ---------- Admin dashboard ---------- */
.admin-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 130px 24px 80px;
}
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 30px;
}
.admin-head h1 { font-size: 26px; font-weight: 900; }
.admin-head h1 span { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.admin-actions { display: flex; gap: 10px; }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}
.stat {
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.stat-num { font-size: 30px; font-weight: 900; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

.admin-upload {
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 34px;
  text-align: center;
}
.admin-upload h2 { font-size: 18px; font-weight: 800; margin-bottom: 18px; }

.table-wrap {
  border-radius: var(--radius);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th, .admin-table td {
  padding: 14px 18px;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  vertical-align: middle;
}
.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.04);
}
.admin-table tr:hover td { background: rgba(255, 255, 255, 0.04); }
.thumb {
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
  display: block;
}
.cell-name { font-weight: 700; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cell-actions form { margin: 0; }
.cell-views { font-weight: 800; color: var(--accent2); }
.desc-form { display: flex; gap: 8px; align-items: center; }
.desc-input { margin: 0; padding: 9px 12px; text-align: right; letter-spacing: 0; min-width: 170px; font-size: 13px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

.toast {
  position: fixed;
  bottom: 26px;
  right: 50%;
  transform: translateX(50%) translateY(120px);
  background: rgba(20, 30, 60, 0.95);
  border: 1px solid var(--accent2);
  color: var(--text);
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.5);
  z-index: 100;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.toast.show { transform: translateX(50%) translateY(0); }

/* ---------- Upload modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(5, 2, 20, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal.open {
  display: grid;
  animation: fadeIn 0.3s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  width: min(430px, 100%);
  border-radius: var(--radius);
  padding: 36px 30px;
  text-align: center;
  animation: popIn 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradientShift 4s linear infinite, bounceFloat 2.4s ease-in-out infinite;
  box-shadow: 0 12px 35px rgba(124, 92, 255, 0.5);
}
.modal-title {
  font-size: 17px;
  font-weight: 800;
  margin: 18px 0 22px;
  word-break: break-word;
}
.modal-progress {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 18px;
}
.modal-progress .progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.modal-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.modal-row.muted {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  justify-content: center;
}
.modal-card .btn { margin-top: 18px; }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(34px); }
  to { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero { padding-top: 120px; }
  .player-wrap, .admin-wrap { padding-top: 120px; }
  .dropzone { padding: 40px 18px; }
  .player-card { padding: 18px; }
  .admin-table th, .admin-table td { padding: 10px 12px; }
  .thumb { width: 84px; }
  .admin-head { justify-content: center; text-align: center; }
  .link-row { flex-direction: column; }
  .nav { padding: 12px 18px; }
}
