/* Premium Paywall Styles - Fixed display issues */
.premium-paywall-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none; /* Changed from flex to none by default */
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.premium-paywall-overlay.active {
  display: flex;
}

.paywall-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.paywall-header h2 {
  color: var(--primary-color, #3a86ff);
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
}

.paywall-header p {
  color: #666;
  margin-bottom: 2rem;
}

.paywall-features {
  margin: 2rem 0;
  text-align: left;
}

.paywall-features h3 {
  color: var(--dark-color, #333);
  margin-bottom: 1rem;
  text-align: center;
}

.paywall-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.paywall-features li {
  padding: 0.75rem 0;
  color: var(--text-color, #555);
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.paywall-features li:last-child {
  border-bottom: none;
}

.paywall-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.paywall-actions .btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.paywall-actions .btn-primary {
  background: var(--primary-color, #3a86ff);
  color: white;
}

.paywall-actions .btn-primary:hover {
  background: var(--primary-dark, #2d6bcc);
  transform: translateY(-2px);
}

.paywall-actions .btn-outline {
  background: transparent;
  color: var(--primary-color, #3a86ff);
  border: 2px solid var(--primary-color, #3a86ff);
}

.paywall-actions .btn-outline:hover {
  background: var(--primary-color, #3a86ff);
  color: white;
}

/* Subscription Modal Styles - Fixed display issues */
.subscription-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none; /* Changed from flex to none by default */
  justify-content: center;
  align-items: center;
  z-index: 10001;
  backdrop-filter: blur(5px);
}

.subscription-modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideInUp 0.3s ease-out;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  color: var(--dark-color, #333);
  margin: 0;
}

.close-modal {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: #f0f0f0;
  color: #333;
}

.subscription-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.plan-card {
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.plan-card:hover {
  border-color: var(--primary-color, #3a86ff);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(58, 134, 255, 0.1);
}

.plan-card.featured {
  border-color: var(--primary-color, #3a86ff);
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(58, 134, 255, 0.2);
}

.plan-card.featured:hover {
  transform: scale(1.05) translateY(-5px);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-color, #3a86ff);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.plan-card h3 {
  color: var(--dark-color, #333);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color, #3a86ff);
  margin: 1rem 0;
}

.plan-price span {
  font-size: 1rem;
  color: #666;
  font-weight: 400;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.plan-features li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-color, #555);
}

.plan-features li:last-child {
  border-bottom: none;
}

.plan-button {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color, #3a86ff);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.plan-button:hover {
  background: var(--primary-dark, #2d6bcc);
  transform: translateY(-2px);
}

.plan-card.featured .plan-button {
  background: linear-gradient(135deg, var(--primary-color, #3a86ff) 0%, var(--primary-dark, #2d6bcc) 100%);
}

/* Premium Content Locking */
.insight-card.premium-locked {
  position: relative;
  filter: blur(3px);
  pointer-events: none;
  opacity: 0.7;
}

.insight-card.premium-locked::after {
  content: "🔒 Premium Content - Subscribe to Access";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  pointer-events: all;
  cursor: pointer;
  z-index: 10;
  text-align: center;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.insight-card.premium-locked::after:hover {
  background: rgba(0, 0, 0, 1);
}

/* Subscription Status */
.subscription-status {
  background: linear-gradient(135deg, #38b000 0%, #2d8f00 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(56, 176, 0, 0.2);
}

.status-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.status-text {
  font-size: 0.95rem;
}

.status-plan {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Premium Tag Styling */
.tag.premium {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

/* Enhanced Premium CTA */
.premium-cta {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 0;
  margin: 4rem 0 0 0;
}

.premium-cta .premium-info h2 {
  color: white;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.premium-cta .premium-info p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.premium-features {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.premium-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
}

.premium-features svg {
  color: #4ade80;
  flex-shrink: 0;
}

.premium-actions {
  margin-top: 2rem;
}

.premium-actions .plan-button {
  background: white;
  color: var(--primary-color, #3a86ff);
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.premium-actions .plan-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .paywall-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .paywall-actions {
    flex-direction: column;
  }

  .paywall-actions .btn {
    width: 100%;
  }

  .subscription-plans {
    grid-template-columns: 1fr;
  }

  .plan-card.featured {
    transform: none;
  }

  .plan-card.featured:hover {
    transform: translateY(-5px);
  }

  .status-content {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .insight-card.premium-locked::after {
    font-size: 0.8rem;
    padding: 0.75rem 1.5rem;
    white-space: normal;
    max-width: 80%;
  }

  .premium-cta .premium-info h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .paywall-header h2 {
    font-size: 1.5rem;
  }

  .plan-price {
    font-size: 2rem;
  }

  .insight-card.premium-locked::after {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success Animation */
.success-checkmark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4ade80;
  position: relative;
}

.success-checkmark::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: 12px;
}
