*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==========================
   GLOBAL BODY
========================== */

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: #03061c;
  color: #fff;
  font-family: Arial, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#page-content {
  width: 100%;
  min-height: 100dvh;
  padding-bottom: 110px;
  background: transparent;
}

/* ==========================================================
   SPA FACEBOOK-STYLE SKELETON LOADING
========================================================== */

.spa-page-skeleton {
  width: min(100%, 1400px);
  margin: 0 auto;
  padding: 32px 22px 140px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.spa-skeleton {
  display: block;
  position: relative;
  overflow: hidden;
  background: #111936;
  border-radius: 10px;
  will-change: transform;
}

.spa-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(148, 163, 184, 0.18),
    transparent
  );
  animation: spaSkeletonShimmer 1.25s ease-in-out infinite;
}

.spa-sk-topbar,
.spa-sk-search-row,
.spa-sk-section-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.spa-sk-topbar {
  justify-content: space-between;
}

.spa-sk-logo {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.spa-sk-heading {
  width: min(460px, 74vw);
  height: 48px;
}

.spa-sk-title {
  width: min(260px, 70vw);
  height: 24px;
  margin-bottom: 10px;
}

.spa-sk-line {
  width: min(520px, 82vw);
  height: 16px;
}

.spa-sk-line.short {
  width: min(260px, 56vw);
}

.spa-sk-action {
  width: 170px;
  height: 48px;
  border-radius: 14px;
}

.spa-sk-input {
  flex: 1;
  height: 56px;
  border-radius: 18px;
}

.spa-sk-input.tall {
  height: 130px;
}

.spa-sk-button {
  width: 180px;
  height: 48px;
  border-radius: 14px;
}

.spa-sk-tabs {
  display: flex;
  gap: 12px;
  overflow: hidden;
}

.spa-sk-tabs .spa-skeleton {
  width: 110px;
  height: 44px;
  border-radius: 16px;
  flex: 0 0 auto;
}

.spa-sk-hero,
.spa-sk-form,
.spa-sk-card,
.spa-sk-grid > div {
  padding: 24px;
  border-radius: 26px;
  background: #07102d;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spa-sk-hero {
  display: grid;
  gap: 16px;
}

.spa-sk-form {
  display: grid;
  gap: 16px;
}

.spa-sk-card {
  display: flex;
  align-items: stretch;
  gap: 22px;
}

.spa-sk-media {
  width: 250px;
  height: 160px;
  border-radius: 22px;
  flex: 0 0 250px;
}

.spa-sk-card-body {
  flex: 1;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 12px;
}

.spa-sk-list {
  display: grid;
  gap: 20px;
}

.spa-sk-grid {
  display: grid;
  gap: 18px;
}

.spa-sk-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.spa-sk-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spa-sk-grid > div {
  min-height: 150px;
  display: grid;
  align-content: center;
  gap: 12px;
}

@keyframes spaSkeletonShimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 900px) {
  .spa-sk-grid.four,
  .spa-sk-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spa-sk-card {
    flex-direction: column;
  }

  .spa-sk-media {
    width: 100%;
    height: 220px;
    flex-basis: auto;
  }
}

@media (max-width: 560px) {
  .spa-page-skeleton {
    padding: 24px 14px 120px;
    gap: 18px;
  }

  .spa-sk-topbar,
  .spa-sk-search-row {
    align-items: stretch;
  }

  .spa-sk-search-row {
    flex-direction: column;
  }

  .spa-sk-action,
  .spa-sk-button {
    width: 100%;
  }

  .spa-sk-heading {
    height: 38px;
  }

  .spa-sk-hero,
  .spa-sk-form,
  .spa-sk-card,
  .spa-sk-grid > div {
    padding: 18px;
    border-radius: 22px;
  }

  .spa-sk-grid.four,
  .spa-sk-grid.two {
    grid-template-columns: 1fr;
  }

  .spa-sk-media {
    height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spa-skeleton::after {
    animation: none;
  }
}

/* ==========================================================
   GLOBAL APP ERROR STATE
========================================================== */

.app-error-shell,
.network-error-shell {
  width: min(100%, 1400px);
  min-height: calc(100dvh - 110px);
  margin: 0 auto;
  padding: 32px 22px 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-error,
.network-error {
  width: 100%;
  min-height: 280px;
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: transparent;
  border-radius: 26px;
  animation: appErrorFadeUp 0.4s ease both;
}

.app-error-icon,
.network-error-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.app-error-icon i,
.network-error-icon i {
  font-size: 26px;
  color: #f87171;
}

.app-error-content,
.network-error-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-error-content h2,
.network-error-content h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.3rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
}

.app-error-content p,
.network-error-content p {
  max-width: 460px;
  margin: 10px 0 22px;
  color: #94a3b8;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.app-try-again-btn,
.network-try-again-btn {
  height: 48px;
  min-width: 140px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
}

.app-try-again-btn i,
.network-try-again-btn i {
  font-size: 14px;
}

.app-try-again-btn:hover,
.network-try-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.28);
}

.app-try-again-btn:active,
.network-try-again-btn:active {
  transform: translateY(0);
}

.app-try-again-btn:focus-visible,
.network-try-again-btn:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.8);
  outline-offset: 3px;
}

.app-try-again-btn:disabled,
.network-try-again-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.app-try-again-btn.is-loading i,
.network-try-again-btn.is-loading i {
  animation: appRetrySpin 0.8s linear infinite;
}

@keyframes appErrorFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes appRetrySpin {
  to {
    transform: rotate(360deg);
  }
}

.app-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10000;
  width: min(calc(100vw - 32px), 540px);
  min-height: 76px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  background: rgba(7, 16, 45, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.96);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;
}

.app-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.app-toast-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.app-toast.error .app-toast-icon {
  background: rgba(239, 68, 68, 0.13);
  color: #f87171;
}

.app-toast p {
  margin: 0;
  color: #f8fafc;
  font-size: 1rem;
  line-height: 1.5;
}

.app-toast-action {
  margin-left: auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #4ade80;
  color: #062e16;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.app-toast-action:hover {
  background: #86efac;
}

.app-rating-toast {
  width: min(calc(100vw - 28px), 420px);
  min-height: 0;
  padding: 20px 18px;
}

.app-rating-toast-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.app-rating-toast-header h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.15rem;
}

.app-rating-toast-stars {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-rating-toast-star {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.app-rating-toast-star:hover,
.app-rating-toast-star.is-selected {
  color: #fbbf24;
  transform: translateY(-1px);
}

.app-rating-toast-status {
  margin: 0;
  min-height: 22px;
  color: #cbd5e1;
  font-size: 0.82rem;
}

.app-rating-toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.app-rating-toast-later,
.app-rating-toast-submit {
  min-width: 92px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.app-rating-toast-later {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

.app-rating-toast-submit {
  background: linear-gradient(100deg, #8f2fff, #00d4ff);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(0, 212, 255, 0.14);
}

.app-rating-toast-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ==========================================
   PROFESSIONAL FOOTER - PART 1
========================================== */

.footer-cut {
  position: fixed;
  left: 50vw;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(calc(100vw - 24px), 560px);
  max-width: 560px;
  height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 18px;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  background: rgba(9, 14, 36, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 9999;
  overflow: visible;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex: 1;
  height: 100%;
  gap: 4px;
}

.footer-icon {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f7cff, #2962ff);
  border: 5px solid #030312;
  box-shadow:
    0 10px 30px rgba(41, 98, 255, 0.45),
    0 0 25px rgba(41, 98, 255, 0.25);
  transform: translateY(-22px);
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.footer-icon:hover {
  transform: translateY(-26px) scale(1.05);
}

.footer-icon i.fa-camera {
  font-size: 38px;
  display: block;
  user-select: none;
  pointer-events: none;
}

.qr-scanner-modal[hidden] {
  display: none;
}

.qr-scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 20px;
}

body.qr-scanner-open {
  overflow: hidden;
}

.qr-scanner-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 18, 0.78);
  backdrop-filter: blur(10px);
}

.qr-scanner-dialog {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  color: #f6f8ff;
  background: #101633;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.qr-scanner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.qr-scanner-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #91aaff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.qr-scanner-dialog h2 {
  margin: 0;
  font-size: 22px;
}

.qr-scanner-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  place-items: center;
  color: #f6f8ff;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.qr-scanner-preview {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #050711;
  border-radius: 16px;
}

.qr-scanner-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-scanner-frame {
  position: absolute;
  inset: 17%;
  border: 2px solid #6f8dff;
  border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(3, 3, 18, 0.22);
  pointer-events: none;
}

.qr-scanner-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  color: #dce3ff;
  background: rgba(5, 7, 17, 0.76);
  font-size: 13px;
}

.qr-scanner-status {
  min-height: 22px;
  margin: 15px 0;
  color: #bac5eb;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.qr-scanner-actions {
  display: flex;
  justify-content: center;
}

.qr-scanner-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  color: #f6f8ff;
  background: rgba(111, 141, 255, 0.16);
  border: 1px solid rgba(145, 170, 255, 0.35);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.qr-scanner-upload:hover {
  background: rgba(111, 141, 255, 0.25);
}

.qr-scanner-status.is-error {
  color: #ff9eaa;
}

/* ==========================================
   PROFESSIONAL FOOTER - PART 2
   Footer Navigation Items
========================================== */

.footer-item {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  border-radius: 18px;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    opacity 0.25s ease;
}

.footer-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.footer-item.is-disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.footer-item.is-disabled:hover {
  background: transparent;
}

.footer-item.is-disabled img,
.footer-item.is-disabled span {
  opacity: 0.7;
}

.footer-item:active {
  opacity: 0.75;
}

.footer-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
  opacity: 0.75;
  transition:
    opacity 0.25s ease,
    filter 0.25s ease;
}

.footer-item span {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.2px;
  transition:
    color 0.25s ease,
    opacity 0.25s ease;
  white-space: nowrap;
}

/* Active State */

.footer-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.footer-item.active img {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(74, 144, 255, 0.55));
}

.footer-item.active span {
  color: #ffffff;
}

/* Top Indicator */

.footer-item::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f7cff, #19b6ff);
  transition: transform 0.25s ease;
}

.footer-item.active::before {
  transform: translateX(-50%) scaleX(1);
}

#profileBtn.has-new-notification::after {
  content: "";
  position: absolute;
  top: 16px;
  left: calc(50% + 8px);
  width: 9px;
  height: 9px;
  border: 2px solid #090e24;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
  pointer-events: none;
  z-index: 2;
}

@media (min-width: 1200px) {
  .spa-page-skeleton {
    padding: 42px 34px 150px;
    gap: 28px;
  }

  .spa-sk-hero,
  .spa-sk-form,
  .spa-sk-card,
  .spa-sk-grid > div {
    padding: 28px;
  }
}
#profileBtn.has-new-referral::before,.referral-btn.has-new-referral::after{content:"";position:absolute;width:9px;height:9px;border:2px solid #090e24;border-radius:50%;background:#ef4444;box-shadow:0 0 0 2px rgba(239,68,68,.2);pointer-events:none}
#profileBtn.has-new-referral::before{top:16px;left:calc(50% + 8px)}

/* ==========================================
   PROFESSIONAL FOOTER - PART 3
   Animation + Responsive
========================================== */

/* ---------- Smooth Animation ---------- */

.footer-cut,
.footer-item,
.footer-icon,
.footer-item img,
.footer-item span {
  transition:
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-item:hover img {
  opacity: 1;
}

.footer-item:hover span {
  color: #ffffff;
}

.footer-icon:active {
  transform: translateY(-22px) scale(0.96);
}

/* Floating Button Glow */

.footer-icon::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(rgba(41, 98, 255, 0.3), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.footer-icon:hover::after {
  opacity: 1;
}

/* ==========================
   HIDE SCROLLBAR
========================== */
::-webkit-scrollbar {
  display: none;
}

/* =========================
        SMALL PHONES
========================= */

@media (max-width: 360px) {
  .footer-cut {
    width: calc(100vw - 12px);
    height: 68px;
    border-radius: 22px;
    padding: 0 10px;
  }

  .footer-left,
  .footer-right {
    gap: 0;
  }

  .footer-item img {
    width: 21px;
    height: 21px;
  }

  .footer-item span {
    font-size: 10px;
  }

  .footer-icon {
    width: 60px;
    height: 60px;
    margin: 0 6px;
    transform: translateY(-18px);
  }

  .footer-icon img {
    width: 28px;
    height: 28px;
  }
}

/* =========================
      NORMAL PHONES
========================= */

@media (min-width: 361px) and (max-width: 480px) {
  .footer-cut {
    height: 72px;
  }

  .footer-item img {
    width: 22px;
    height: 22px;
  }

  .footer-item span {
    font-size: 11px;
  }

  .footer-icon {
    width: 64px;
    height: 64px;
    transform: translateY(-20px);
  }

  .footer-icon img {
    width: 30px;
    height: 30px;
  }
}

/* =========================
        TABLETS
========================= */

@media (min-width: 481px) and (max-width: 768px) {
  .footer-cut {
    width: min(calc(100vw - 24px), 620px);
    max-width: 620px;
    height: 76px;
  }

  .footer-item img {
    width: 24px;
    height: 24px;
  }

  .footer-item span {
    font-size: 12px;
  }

  .footer-icon {
    width: 70px;
    height: 70px;
  }

  .footer-icon img {
    width: 34px;
    height: 34px;
  }
}

/* =========================
        DESKTOP
========================= */

@media (min-width: 769px) {
  .footer-cut {
    max-width: 560px;
    height: 80px;
  }

  .footer-item img {
    width: 25px;
    height: 25px;
  }

  .footer-item span {
    font-size: 12px;
  }

  .footer-icon {
    width: 74px;
    height: 74px;
  }

  .footer-icon img {
    width: 35px;
    height: 35px;
  }
}

/* Prevent page content hiding behind footer */

body {
  padding-bottom: 110px;
}
