/**
 * 9WING.PRO - Mobile & iPhone Enhancements + Cyber Visual Effects
 * Optimized for iOS Safari, Android, and Desktop modern browsers
 */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ===== 1. CORE MOBILE & IPHONE OPTIMIZATIONS ===== */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: #030508;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Prevent accidental text selection on tap controls */
button, .btn, .plan-btn, .dock-item, .menu-toggle {
  -webkit-user-select: none;
  user-select: none;
}

/* Interactive touch target sizing */
button, a.btn, a.plan-btn, .menu-toggle, .dock-item {
  min-height: 44px;
}

/* Inputs safe on mobile - prevent iOS auto zoom */
input, textarea, select {
  font-size: 16px !important;
}

/* ===== 2. CYBER BACKGROUND PARTICLES CANVAS ===== */
#cyberCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
}

/* ===== 3. PACKAGE CARDS NEON & CYBER PULSE ===== */
/* Featured 30-Day Card (Gold Cyber Pulse) */
.pricing-card.featured {
  position: relative;
  border-color: rgba(255, 201, 40, 0.65) !important;
  animation: cyberPulseGold 3.5s infinite ease-in-out;
  will-change: box-shadow, border-color;
}

@keyframes cyberPulseGold {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 201, 40, 0.22), 0 10px 30px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 201, 40, 0.55);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 201, 40, 0.48), 0 0 70px rgba(255, 173, 22, 0.25), 0 14px 40px rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 215, 80, 0.95);
  }
}

/* Special Pink VVIP Card (Neon Cyber Pulse) */
.pricing-card.plan-pink-vvip {
  position: relative;
  border-color: rgba(255, 126, 187, 0.6) !important;
  animation: cyberPulsePink 3.2s infinite ease-in-out;
  will-change: box-shadow, border-color;
}

@keyframes cyberPulsePink {
  0%, 100% {
    box-shadow: 0 0 22px rgba(255, 101, 160, 0.25), 0 10px 30px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 126, 187, 0.55);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 101, 160, 0.52), 0 0 75px rgba(255, 60, 150, 0.28), 0 14px 40px rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 160, 210, 0.95);
  }
}

/* Shimmer Light Sweep on Buy Buttons */
.plan-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  animation: buttonShimmer 4.5s infinite ease-in-out;
}

@keyframes buttonShimmer {
  0% { left: -75%; }
  30%, 100% { left: 140%; }
}

.plan-btn:active {
  transform: scale(0.97);
}

/* ===== 4. POPUP RESPONSIVE & SAFE AREA TWEAKS ===== */
.intro-media-modal, .modal, #entryImagePopup, #facebookNoticePopup {
  padding: max(10px, var(--safe-top)) max(10px, var(--safe-right)) max(12px, var(--safe-bottom)) max(10px, var(--safe-left)) !important;
}

.intro-media-card, .entry-popup-card, .fbn-card, .event-popup-card {
  max-height: calc(100dvh - 24px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Ensure sticky/pinned close button for effortless tap on mobile */
.intro-media-close, .entry-popup-close, .fbn-close, .event-popup-close {
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 10001 !important;
}

/* ===== 5. MOBILE QUICK-ACTION CYBER DOCK ===== */
.mobile-cyber-dock {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(72px + var(--safe-bottom)) !important;
  }

  .mobile-cyber-dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    height: calc(64px + var(--safe-bottom));
    padding: 6px 8px var(--safe-bottom) 8px;
    background: rgba(6, 9, 14, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 201, 40, 0.28);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(255, 173, 22, 0.08);
    align-items: center;
    justify-content: space-around;
  }

  .dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #8fa0b5;
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    min-height: 48px;
    transition: color 0.2s ease, transform 0.2s ease;
    gap: 3px;
  }

  .dock-item:active {
    transform: scale(0.92);
  }

  .dock-item .dock-icon {
    font-size: 18px;
    line-height: 1;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .dock-item .dock-label {
    letter-spacing: 0.2px;
  }

  .dock-item:hover, .dock-item:focus {
    color: #ffc928;
  }

  /* Center highlight button for Buy Key */
  .dock-item.dock-item-highlight {
    color: #ffc928;
    font-weight: 700;
  }

  .dock-item.dock-item-highlight .dock-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffc928, #ff9500);
    color: #07090e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(255, 201, 40, 0.45), 0 0 10px rgba(255, 149, 0, 0.3);
    margin-top: -12px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
  }

  .dock-item.dock-item-highlight:active .dock-icon-box {
    transform: scale(0.9);
  }

  /* Live green dot for chat */
  .dock-live-dot {
    position: absolute;
    top: -2px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #40e27d;
    border-radius: 50%;
    box-shadow: 0 0 8px #40e27d;
    animation: livePulse 2s infinite;
  }

  @keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
  }

  /* Mobile floating contact readjustment */
  .floating-contact {
    bottom: calc(75px + var(--safe-bottom)) !important;
    right: 14px !important;
  }
}

/* ===== 6. STATS NUMBER ODOMETER ANIMATION ===== */
.status-grid article strong {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

/* ===== 7. BRAND LOGO CONSISTENCY ===== */
.intro-media-brand, .hero-brand, .logo .intro-media-brand, .fbn-brand {
  font-family: 'Orbitron', system-ui, sans-serif !important;
  font-weight: 900 !important;
  letter-spacing: 0.8px;
  color: #ffffff;
}

.intro-media-brand span, .hero-brand span, .logo .intro-media-brand span, .fbn-brand span {
  color: #ffc928 !important;
  text-shadow: 0 0 14px rgba(255, 201, 40, 0.6);
}
