/* ============================================================
   NATIVEFOUNDATION PREMIUM MODAL - $1M DESIGN SYSTEM
   Ultra-premium, sophisticated, high-end modal experience
   ============================================================ */

/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* Premium Modal Overlay - Semi-transparent backdrop */
.nf-modal-overlay {
  position: fixed;
  inset: 0;
  background: 
    rgba(10, 10, 10, 0.25);
  backdrop-filter: blur(4px) saturate(100%);
  -webkit-backdrop-filter: blur(4px) saturate(100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 40px 20px;
}

.nf-modal-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.nf-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Premium Modal Container - Floating glass card */
.nf-modal {
  background: 
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-radius: 24px;
  box-shadow: 
    0 50px 100px -20px rgba(0, 0, 0, 0.25),
    0 30px 60px -30px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset,
    0 0 100px rgba(255, 107, 53, 0.1);
  padding: 0;
  max-width: 640px;
  width: 100%;
  position: relative;
  transform: scale(0.9) translateY(40px);
  transition: 
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.5s ease;
  opacity: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.nf-modal-overlay.active .nf-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Premium accent line at top */
.nf-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    #FF6B35 0%, 
    #FF8A5C 25%,
    #FF6B35 50%,
    #FF8A5C 75%,
    #FF6B35 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Close button - Premium floating action */
.nf-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(245, 245, 245, 0.8);
  border: none;
  border-radius: 50%;
  color: #525252;
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.nf-close-btn:hover {
  background: #FF6B35;
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 
    0 4px 20px rgba(255, 107, 53, 0.4),
    0 0 0 1px rgba(255, 107, 53, 0.2);
}

.nf-close-btn:active {
  transform: rotate(90deg) scale(0.95);
}

/* Modal Header - Premium branding area */
.nf-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 48px 32px;
  background: 
    linear-gradient(180deg, 
      rgba(255, 107, 53, 0.05) 0%, 
      rgba(255, 107, 53, 0) 100%);
  position: relative;
  text-align: center;
}

.nf-modal-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(255, 107, 53, 0.3) 50%,
    transparent 100%
  );
}

/* Premium Logo Treatment */
.nf-modal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.nf-modal-logo::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.nf-logo-img {
  height: 56px;
  width: auto;
  filter: invert(56%) sepia(85%) saturate(2000%) hue-rotate(340deg) brightness(100%) contrast(101%);
  position: relative;
  z-index: 1;
}

/* Premium Title - Clean modern typography */
.nf-modal-title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: #0a0a0a;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-align: center;
  background: linear-gradient(135deg, #0a0a0a 0%, #404040 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Modal Content - Premium editorial */
.nf-modal-content {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.05rem;
  color: #404040;
  line-height: 1.9;
  margin: 0;
  padding: 32px 48px;
  background: 
    radial-gradient(circle at 50% 0%, rgba(255, 107, 53, 0.02) 0%, transparent 60%);
}

.nf-modal-content p {
  margin-bottom: 20px;
}

.nf-modal-content p:last-child {
  margin-bottom: 0;
}

.nf-modal-content strong {
  color: #0a0a0a;
  font-weight: 600;
}

/* Intro text - Hook */
.nf-intro-text {
  font-size: 1.2rem;
  color: #FF6B35;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 20px;
  font-style: italic;
}

/* Lead text - Premium intro */
.nf-lead-text {
  font-size: 1.15rem;
  color: #0a0a0a;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Inline code - Premium monospace */
.nf-modal-content code {
  background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  color: #FF6B35;
  font-weight: 500;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

/* Premium Highlight Box - Glassmorphism */
.nf-highlight-box {
  background: 
    linear-gradient(135deg, 
      rgba(255, 107, 53, 0.1) 0%, 
      rgba(255, 107, 53, 0.05) 100%);
  border-left: 4px solid #FF6B35;
  padding: 24px 28px;
  border-radius: 0 16px 16px 0;
  margin: 28px 0;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow: 
    0 4px 20px rgba(255, 107, 53, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nf-highlight-box::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, 
    #FF6B35 0%,
    #FF8A5C 50%,
    #FF6B35 100%
  );
}

.nf-highlight-box p {
  margin: 0;
  color: #1a1a1a;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Modal Footer - Premium actions */
.nf-modal-footer {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 32px 48px 48px;
  background: 
    linear-gradient(0deg, 
      rgba(245, 245, 245, 0.5) 0%, 
      transparent 100%);
}

/* Premium Button Styles */
.nf-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  letter-spacing: 0.01em;
  overflow: hidden;
}

.nf-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.2) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nf-btn:hover::before {
  opacity: 1;
}

/* Primary Button - Premium gradient */
.nf-btn-primary {
  background: linear-gradient(135deg, #FF6B35 0%, #E85A2B 100%);
  color: white;
  box-shadow: 
    0 4px 16px rgba(255, 107, 53, 0.3),
    0 0 0 1px rgba(255, 107, 53, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nf-btn-primary:hover {
  background: linear-gradient(135deg, #FF7A4A 0%, #F06535 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 30px rgba(255, 107, 53, 0.4),
    0 0 0 1px rgba(255, 107, 53, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nf-btn-primary:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(255, 107, 53, 0.3),
    0 0 0 1px rgba(255, 107, 53, 0.2);
}

/* Secondary Button - Premium subtle */
.nf-btn-secondary {
  background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
  color: #525252;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

.nf-btn-secondary:hover {
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  color: #0a0a0a;
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Hide popup when dismissed */
.nf-modal-overlay.dismissed {
  display: none !important;
}

/* Premium Responsive Design */
@media (max-width: 640px) {
  .nf-modal-overlay {
    padding: 20px 16px;
    align-items: flex-end;
  }
  
  .nf-modal {
    border-radius: 20px;
    max-width: 100%;
  }
  
  .nf-modal-header {
    padding: 36px 28px 28px;
  }
  
  .nf-modal-title {
    font-size: 1.6rem;
  }
  
  .nf-modal-content {
    padding: 24px 28px;
    font-size: 0.95rem;
  }
  
  .nf-modal-footer {
    padding: 24px 28px 36px;
    flex-direction: column;
  }
  
  .nf-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.9rem;
  }
  
  .nf-close-btn {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .nf-highlight-box {
    padding: 20px 24px;
    margin: 24px 0;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .nf-modal-overlay,
  .nf-modal,
  .nf-close-btn,
  .nf-btn,
  .nf-modal-logo::before {
    transition: none;
    animation: none;
  }
  
  .nf-modal::before {
    animation: none;
  }
}

/* Dark mode support (for future) */
@media (prefers-color-scheme: dark) {
  /* Keeping light mode for modal as it's designed to stand out */
}
