/* ==========================================================================
   9WING.PRO - MODERN ENHANCED FEATURES & UI STYLES
   Features: Cyberpunk Particles, Modern Pricing Cards, Accordion FAQ,
             Live Notification Toast, Scroll-to-Top Button, Glassmorphism
   ========================================================================== */

/* --- Cyber Ambient Canvas --- */
#cyberCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
  opacity: 0.65;
}

/* --- Section Title Enhancements --- */
.section-headline {
  font-family: 'Orbitron', 'Kanit', sans-serif;
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.section-headline span {
  color: var(--primary, #ffe600);
  text-shadow: 0 0 20px rgba(255, 230, 0, 0.4);
}
.section-subtitle {
  color: var(--muted, #b8c2cc);
  font-size: clamp(14px, 2vw, 17px);
  max-width: 680px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

/* ==========================================================================
   1. MODERN PRICING CARDS
   ========================================================================== */
.pricing-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  perspective: 1000px;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  border-radius: 24px;
  background: linear-gradient(175deg, rgba(16, 22, 34, 0.78), rgba(6, 10, 16, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), 
              border-color 0.35s ease, 
              box-shadow 0.35s ease;
  overflow: hidden;
  text-align: left;
}

/* Subtle mouse spotlight effect */
.pricing-card::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, -100px);
  left: var(--mouse-x, -100px);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 0, 0.14), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pricing-card:hover::before {
  opacity: 1;
}

.pricing-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(255, 230, 0, 0.45);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65), 0 0 35px rgba(255, 230, 0, 0.18);
}

/* Featured / Popular Card Styling */
.pricing-card.featured {
  border-color: rgba(255, 194, 78, 0.65);
  background: 
    radial-gradient(circle at 50% 0%, rgba(255, 194, 78, 0.18), transparent 50%),
    linear-gradient(175deg, rgba(24, 30, 46, 0.88), rgba(8, 12, 20, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 194, 78, 0.22);
  transform: scale(1.04);
}

.pricing-card.featured:hover {
  transform: translateY(-10px) scale(1.06);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 50px rgba(255, 194, 78, 0.35);
}

.popular-badge {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0b0d11;
  background: linear-gradient(135deg, #ffe600, #ff9d00);
  box-shadow: 0 0 16px rgba(255, 194, 78, 0.6);
  animation: pulseBadge 2.4s infinite;
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.2); }
}

.plan-tag {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--secondary, #00ffbf);
  margin-bottom: 8px;
}

.pricing-card.featured .plan-tag {
  color: #ffc34f;
}

.plan-name {
  font-family: 'Orbitron', 'Kanit', sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}

.plan-desc {
  font-size: 14px;
  color: var(--muted, #b8c2cc);
  margin-bottom: 22px;
  min-height: 40px;
}

.plan-price-box {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.plan-duration {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--primary, #ffe600);
  line-height: 1;
}

.plan-duration small {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  margin-left: 6px;
  font-family: 'Kanit', sans-serif;
}

.plan-features {
  list-style: none;
  margin: 0 0 28px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
  flex-grow: 1;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #e5ebf3;
}

.plan-features li svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: var(--secondary, #00ffbf);
}

.pricing-card.featured .plan-features li svg {
  color: #ffc34f;
}

.plan-btn {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  font-family: 'Kanit', sans-serif;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 230, 0, 0.4);
  background: rgba(255, 230, 0, 0.1);
  color: #fff;
}

.plan-btn:hover {
  background: linear-gradient(135deg, var(--primary, #ffe600), var(--primary2, #ff9d00));
  color: #05070a;
  box-shadow: 0 10px 25px rgba(255, 180, 0, 0.35);
  transform: translateY(-2px);
}

.pricing-card.featured .plan-btn {
  background: linear-gradient(135deg, var(--primary, #ffe600), var(--primary2, #ff9d00));
  color: #05070a;
  border: none;
  box-shadow: 0 12px 30px rgba(255, 180, 0, 0.3);
}

.pricing-card.featured .plan-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(255, 180, 0, 0.45);
}

/* ==========================================================================
   2. ACCORDION FAQ
   ========================================================================== */
.faq-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 18, 26, 0.75), rgba(6, 9, 14, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover,
.faq-item.active {
  border-color: rgba(255, 230, 0, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: transparent;
  border: none;
  color: #fff;
  font-family: 'Kanit', sans-serif;
  font-size: clamp(16px, 2.5vw, 18px);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--primary, #ffe600);
}

.faq-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  color: var(--primary, #ffe600);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  background: var(--primary, #ffe600);
  color: #080a0e;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
  padding: 0 24px;
  color: var(--muted, #b8c2cc);
  font-size: 15px;
  line-height: 1.75;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 0 24px 22px;
  transition: max-height 0.45s ease-in-out, padding 0.3s ease;
}

.faq-answer p {
  margin: 0;
}

.faq-answer strong {
  color: var(--primary, #ffe600);
}

/* ==========================================================================
   3. LIVE ACTIVITY TOAST NOTIFICATION
   ========================================================================== */
#liveToastContainer {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.live-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 310px;
  max-width: 390px;
  padding: 13px 18px;
  border-radius: 18px;
  background: rgba(8, 11, 17, 0.92);
  border: 1px solid rgba(0, 255, 191, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 255, 191, 0.15);
  animation: toastIn 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
  position: relative;
  overflow: hidden;
}

.live-toast.hiding {
  animation: toastOut 0.4s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.9);
  }
}

.toast-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 255, 191, 0.2), rgba(255, 230, 0, 0.2));
  border: 1px solid rgba(0, 255, 191, 0.4);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex-grow: 1;
  text-align: left;
}

.toast-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.toast-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 255, 191, 0.15);
  color: var(--secondary, #00ffbf);
  border: 1px solid rgba(0, 255, 191, 0.3);
}

.toast-desc {
  font-size: 12px;
  color: var(--muted, #b8c2cc);
  line-height: 1.4;
}

.toast-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 3px;
}

.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  margin-left: 4px;
  align-self: flex-start;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #fff;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--secondary, #00ffbf), var(--primary, #ffe600));
  transform-origin: left;
  animation: toastTimer 6s linear forwards;
}

@keyframes toastTimer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* ==========================================================================
   4. SCROLL TO TOP BUTTON
   ========================================================================== */
#scrollTopBtn {
  position: fixed;
  bottom: calc(var(--safe-bottom, 20px) + 68px);
  right: 18px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(14, 18, 24, 0.85);
  border: 1px solid rgba(255, 230, 0, 0.4);
  color: var(--primary, #ffe600);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 230, 0, 0.2);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#scrollTopBtn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scrollTopBtn:hover {
  background: linear-gradient(135deg, var(--primary, #ffe600), var(--primary2, #ff9d00));
  color: #030508;
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(255, 180, 0, 0.45);
}

#scrollTopBtn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
}

#scrollTopBtn:hover svg {
  transform: translateY(-2px);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1100px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 760px;
  }
  .pricing-card.featured {
    transform: none;
  }
  .pricing-card.featured:hover {
    transform: translateY(-8px);
  }
}

@media (max-width: 760px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  
  #liveToastContainer {
    bottom: calc(var(--safe-bottom, 16px) + 70px);
    left: 12px;
    right: 12px;
  }
  
  .live-toast {
    min-width: unset;
    max-width: 100%;
  }

  #scrollTopBtn {
    bottom: calc(var(--safe-bottom, 16px) + 70px);
    right: 14px;
    width: 44px;
    height: 44px;
  }
}
