/* ===== INSIGHTS INTERACTIVE STYLING =====
   Professional styling for reading progress, social sharing, bookmarks
   Consistent with Sapphire Professional design system
   ================================================ */

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  z-index: 1000;
  opacity: 0;
  transform: translateY(-100%);
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.reading-progress.visible {
  opacity: 1;
  transform: translateY(0);
}

.reading-progress-bar {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1D4ED8, #8B5CF6, #06B6D4);
  transition: width 0.1s ease;
  position: relative;
}

.reading-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: -2px;
  width: 4px;
  height: 100%;
  background: white;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.reading-progress-text {
  position: absolute;
  top: 12px;
  right: 1rem;
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-percentage {
  font-family: var(--font-mono);
  min-width: 2.5rem;
  text-align: right;
}

.reading-time-left {
  color: rgba(255, 255, 255, 0.8);
}

/* Social Sharing Buttons */
.social-share-floating {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.social-share-floating.visible {
  opacity: 1;
  visibility: visible;
}

.share-button-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: white;
  padding: 0.75rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
}

.share-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--gradient-glass);
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.share-btn.share-linkedin {
  background: linear-gradient(135deg, #0077B5, #0A66C2);
  color: white;
}

.share-btn.share-twitter {
  background: linear-gradient(135deg, #1DA1F2, #0D8BD9);
  color: white;
}

.share-btn.share-whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
}

.share-btn.share-copy {
  background: linear-gradient(135deg, #6B7280, #4B5563);
  color: white;
}

.share-count {
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-light);
  margin-top: 0.5rem;
  font-weight: 600;
}

/* Bookmark Button */
.bookmark-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.bookmark-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.bookmark-btn.bookmarked {
  background: linear-gradient(135deg, #10B981, #059669);
  border-color: rgba(16, 185, 129, 0.3);
}

.bookmark-btn.bookmarked:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

.bookmark-icon {
  width: 20px;
  height: 20px;
  transition: all 0.3s ease;
}

/* Enhanced Related Content */
.insight-card.enhanced {
  position: relative;
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(29, 78, 216, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.insight-card.enhanced.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.insight-card.enhanced:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(29, 78, 216, 0.15);
  border-color: rgba(29, 78, 216, 0.2);
}

.insight-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.insight-category-badge {
  background: linear-gradient(135deg, #1D4ED8, #8B5CF6);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.insight-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(29, 78, 216, 0.1);
}

.insight-popularity {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
}

.insight-popularity svg {
  width: 14px;
  height: 14px;
}

/* Newsletter CTAs */
.newsletter-inline-cta {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.92), 
    rgba(248, 250, 252, 0.88));
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 2rem;
  margin: 3rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  box-shadow: 
    0 8px 32px rgba(29, 78, 216, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.newsletter-inline-cta.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.newsletter-cta-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.newsletter-cta-icon {
  font-size: 2rem;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #1D4ED8, #8B5CF6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.newsletter-cta-text h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.newsletter-cta-text p {
  margin: 0;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.5;
}

.newsletter-cta-form {
  display: flex;
  gap: 0.5rem;
}

.newsletter-input {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: 8px;
  font-size: 0.875rem;
  min-width: 200px;
  background: white;
}

.newsletter-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.newsletter-btn {
  background: linear-gradient(135deg, #1D4ED8, #8B5CF6);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.newsletter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.3);
}

/* Exit Intent Popup */
.exit-intent-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.exit-intent-popup.visible {
  opacity: 1;
  visibility: visible;
}

.exit-popup-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.exit-popup-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 20px;
  padding: 3rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.exit-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-light);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exit-popup-close:hover {
  background: var(--gradient-glass);
}

.exit-popup-header {
  text-align: center;
  margin-bottom: 2rem;
}

.exit-popup-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
}

.exit-popup-header p {
  margin: 0;
  color: var(--color-text-light);
  line-height: 1.6;
}

.exit-popup-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.exit-email-input {
  flex: 1;
  padding: 1rem;
  border: 2px solid rgba(29, 78, 216, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  background: white;
}

.exit-email-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}

.exit-subscribe-btn {
  background: linear-gradient(135deg, #1D4ED8, #8B5CF6);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.exit-subscribe-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.3);
}

.exit-popup-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.exit-popup-benefits .benefit-item {
  color: var(--color-success);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* Toast Notifications */
.insights-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
  z-index: 10001;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.insights-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* Print Styles */
@media print {
  .print-mode .reading-progress,
  .print-mode .social-share-floating,
  .print-mode .bookmark-btn,
  .print-mode .newsletter-inline-cta,
  .print-mode .exit-intent-popup,
  .print-mode .insights-toast,
  .print-mode .navbar,
  .print-mode .footer,
  .print-mode .breadcrumb {
    display: none !important;
  }

  .print-mode .insight-content {
    max-width: none !important;
    padding: 0 !important;
  }

  .print-mode .insight-header {
    background: none !important;
    color: #000 !important;
    padding: 1rem 0 !important;
  }

  .print-mode .gradient-text {
    background: none !important;
    color: #000 !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .social-share-floating {
    left: 1rem;
  }
}

@media (max-width: 768px) {
  .social-share-floating {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    top: auto;
    transform: translateX(-50%);
  }

  .share-button-group {
    flex-direction: row;
    padding: 0.5rem;
  }

  .share-btn {
    width: 44px;
    height: 44px;
  }

  .bookmark-btn {
    position: relative;
    top: auto;
    right: auto;
    margin: 1rem 0;
  }

  .newsletter-cta-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1rem;
  }

  .newsletter-cta-form {
    flex-direction: column;
  }

  .newsletter-input {
    min-width: auto;
  }

  .exit-popup-content {
    padding: 2rem 1.5rem;
    margin: 1rem;
    width: calc(100% - 2rem);
  }

  .exit-popup-form {
    flex-direction: column;
  }

  .reading-progress-text {
    right: 0.5rem;
    top: 8px;
  }
}

@media (max-width: 480px) {
  .social-share-floating {
    bottom: 1rem;
  }

  .share-btn {
    width: 40px;
    height: 40px;
  }

  .share-btn svg {
    width: 18px;
    height: 18px;
  }

  .reading-progress-text {
    font-size: 0.6875rem;
    gap: 0.5rem;
  }

  .newsletter-inline-cta {
    padding: 1.5rem;
  }

  .newsletter-cta-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

/* Specific overrides for newsletter CTA text within insight articles */
.insight-article-theme .content-wrapper .newsletter-inline-cta .newsletter-cta-text h4 {
  color: #1D4ED8 !important;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.insight-article-theme .content-wrapper .newsletter-inline-cta .newsletter-cta-text p {
  color: #475569 !important;
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
  .insight-card.enhanced {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(139, 92, 246, 0.2);
    color: white;
  }


  .newsletter-input,
  .exit-email-input {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(139, 92, 246, 0.3);
    color: white;
  }

  .exit-popup-content {
    background: rgba(15, 23, 42, 0.95);
    color: white;
  }
}

/* Performance Optimizations */
.social-share-floating,
.reading-progress,
.newsletter-inline-cta {
  will-change: transform, opacity;
}

.share-btn:hover,
.bookmark-btn:hover,
.newsletter-btn:hover {
  will-change: transform;
}

/* Focus Accessibility */
.share-btn:focus,
.bookmark-btn:focus,
.newsletter-btn:focus,
.newsletter-input:focus,
.exit-email-input:focus,
.exit-subscribe-btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .reading-progress,
  .social-share-floating,
  .share-btn,
  .bookmark-btn,
  .newsletter-inline-cta,
  .insight-card.enhanced,
  .insights-toast {
    transition: none;
    animation: none;
  }

  .reading-progress-fill {
    transition: width 0.1s linear;
  }
}