/* ===============================
   REFERRAL CTA - RESPONSIVE POSITIONING
   Triggers when ?ref=CODE exists and user not logged in
   =============================== */

:root {
  --brand: #fc7306;
  --brand-glow: rgba(252, 115, 6, 0.25);
}

/* ===============================
   DESKTOP: Top-Right Fixed Pill
   =============================== */
.referral-cta {
  position: fixed;
  z-index: 999;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: slideIn 0.4s ease;
}

/* Desktop/Laptop (>1024px) */
@media (min-width: 1025px) {
  .referral-cta {
    top: 80px;
    right: 20px;
    padding: 10px 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(11, 11, 12, 0.85);
    backdrop-filter: blur(10px);
  }

  .referral-cta:hover {
    box-shadow: 0 0 18px var(--brand-glow);
    transform: translateY(-2px);
  }

  .referral-cta-main {
    font-size: 17px;
    font-weight: 600;
    background: linear-gradient(90deg, #ffd28a, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .referral-cta-sub {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    transition: opacity 0.3s ease;
  }

  .referral-cta-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: var(--brand);
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .referral-cta:hover .referral-cta-close {
    opacity: 1;
  }
}

/* ===============================
   TABLET: Top-Center Sticky Banner
   =============================== */
@media (min-width: 768px) and (max-width: 1024px) {
  .referral-cta {
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 600px;
    padding: 14px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(11, 11, 12, 0.9);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
  }

  .referral-cta-main {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(90deg, #ffd28a, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .referral-cta-sub {
    margin-top: 5px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    transition: opacity 0.3s ease;
  }

  .referral-cta-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
  }

  .referral-cta-close:hover {
    color: white;
  }
}

/* ===============================
   MOBILE: Bottom-Center Sticky Bar
   =============================== */
@media (max-width: 767px) {
  .referral-cta {
    bottom: 16px;
    left: 12px;
    right: 12px;
    padding: 16px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(11, 11, 12, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    text-align: center;
  }

  .referral-cta-main {
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(90deg, #ffd28a, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .referral-cta-sub {
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    transition: opacity 0.3s ease;
  }

  .referral-cta-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    cursor: pointer;
  }

  .referral-cta-close:hover {
    color: white;
  }
}

/* ===============================
   ANIMATIONS
   =============================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 767px) {
  @keyframes slideIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Hide state */
.referral-cta.hidden {
  display: none;
}
