/*--------------------------------------------------------------
# Premium Newsletter Modal & Confetti
--------------------------------------------------------------*/

/* Prevents background scroll */
body.modal-open {
  overflow: hidden;
  padding-right: 15px;
}

/* Premium glassmorphic backdrop */
.custom-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Premium modal container */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Premium content box with modern design */
.custom-modal-content {
  background: rgba(var(--surface-color-rgb), 0.95);
  backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: 24px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 20px rgba(255, 255, 255, 0.03);
  transform: scale(0.95) translateY(20px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: 20px;
}

/* Dark theme adjustments */
html[data-theme="dark"] .custom-modal-content {
  background: linear-gradient(135deg, rgba(45, 55, 72, 0.95), rgba(45, 55, 72, 0.98));
}

/* Premium entrance animations */
.custom-modal-backdrop.show,
.custom-modal.show {
  opacity: 1;
}
.custom-modal.show .custom-modal-content {
  transform: scale(1) translateY(0);
}

/* Premium content styling */
.custom-modal .success-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-color-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: float 3s ease-in-out infinite;
}

.custom-modal .modal-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, var(--heading-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.custom-modal .modal-text {
  margin: 0 0 2rem 0;
  line-height: 1.7;
  font-size: 1.1rem;
  color: var(--default-color);
}

/* Premium features grid */
.modal-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.modal-features .feature {
  background: rgba(var(--surface-color-rgb), 0.5);
  padding: 1rem 0.5rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--border-color-rgb), 0.1);
}

.modal-features .feature i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
  background: linear-gradient(135deg, #FF6B6B, #FF8EDC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-features .feature span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--default-color);
}

/* Premium button style */
.modal-button {
  background: linear-gradient(135deg, #FF6B6B, #FF8EDC);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 16px 32px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.modal-button .button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 25px rgba(255, 107, 107, 0.3),
    0 0 0 2px rgba(255, 107, 107, 0.1);
}

.modal-button:active {
  transform: translateY(0);
}

/* Premium animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes confettiRain {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

/* Optimized animations */
@media (prefers-reduced-motion: no-preference) {
  .custom-modal.show .custom-modal-content {
    transform: scale(1) translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 1rem;
  }
  
  .newsletter-success-modal .modal-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  }
  
  .newsletter-success-modal .modal-body {
    margin: 0 0.5rem;
    padding: 1.5rem 1rem;
  }
  
  .newsletter-success-modal .modal-footer {
    margin: 0 0.5rem 0.5rem 0.5rem;
    padding: 1rem;
  }
  
  .benefits-list {
    gap: 0.5rem;
  }
  
  .benefit-item {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  /* Newsletter form mobile optimization */
  .newsletter-form .input-group {
    flex-direction: column;
    gap: 15px;
  }

  .newsletter-form .form-control {
    width: 100%;
    border-radius: 25px;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e9ecef;
  }

  .newsletter-form .btn-subscribe {
    width: 100%;
    border-radius: 25px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
  }

  /* Footer newsletter mobile */
  .footer-newsletter-form .newsletter-input-group {
    flex-direction: column;
    gap: 10px;
  }

  .footer-newsletter-form input {
    width: 100%;
    border-radius: 20px;
    padding: 12px 18px;
    font-size: 16px;
  }

  .footer-newsletter-form .newsletter-btn {
    width: 100%;
    border-radius: 20px;
    padding: 12px 20px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .newsletter-form .form-control,
  .footer-newsletter-form input {
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
  }

  .custom-modal-content {
    margin: 16px;
    padding: 2rem;
  }

  .custom-modal .success-icon {
    font-size: 3.5rem;
  }

  .custom-modal .modal-title {
    font-size: 1.5rem;
  }

  .custom-modal .modal-text {
    font-size: 1rem;
  }

  .modal-features {
    gap: 0.5rem;
  }

  .modal-features .feature {
    padding: 0.75rem 0.5rem;
  }

  .modal-features .feature i {
    font-size: 1.25rem;
  }

  .modal-features .feature span {
    font-size: 0.8rem;
  }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
  .custom-modal-backdrop {
    background: rgba(0, 0, 0, 0.75);
  }
}
