/* Additional styles for interactive elements */

/* Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--light-color);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* Animation for scroll elements */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.scrolled {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays */
.product-card:nth-child(2),
.stat-card:nth-child(2),
.demographic-card:nth-child(2),
.strategy-card:nth-child(2),
.process-step:nth-child(2) {
  transition-delay: 0.2s;
}

.product-card:nth-child(3),
.stat-card:nth-child(3),
.demographic-card:nth-child(3),
.strategy-card:nth-child(3),
.process-step:nth-child(3) {
  transition-delay: 0.4s;
}

.strategy-card:nth-child(4),
.process-step:nth-child(4) {
  transition-delay: 0.6s;
}

.strategy-card:nth-child(5),
.process-step:nth-child(5) {
  transition-delay: 0.8s;
}

.strategy-card:nth-child(6),
.process-step:nth-child(6) {
  transition-delay: 1s;
}

/* FAQ Accordion */
.faq-item {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.faq-question {
  background-color: var(--light-color);
  padding: 1rem;
  cursor: pointer;
  position: relative;
  font-weight: 600;
}

.faq-question::after {
  content: '\f107';
  font-family: 'Font Awesome 5 Free';
  position: absolute;
  right: 1rem;
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding: 1rem;
}

/* Timeline navigation */
.timeline-nav {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.timeline-nav-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--border-color);
  margin: 0 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.timeline-nav-dot:hover {
  background-color: var(--secondary-color);
  transform: scale(1.2);
}

.timeline-nav-dot.active {
  background-color: var(--primary-color);
  transform: scale(1.2);
}

.timeline-item.highlight .timeline-content {
  box-shadow: 0 0 15px var(--primary-color);
  transition: box-shadow 0.3s ease;
}

/* Back to top button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: var(--light-color);
  border: none;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-color);
}

/* Product comparison */
.comparison-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--light-color);
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 90;
}

.comparison-container.show {
  transform: translateY(0);
}

.comparison-container h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table th, .comparison-table td {
  padding: 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  background-color: var(--primary-color);
  color: var(--light-color);
}

.close-comparison {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--dark-color);
}

.compare-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-top: 1rem;
}

.compare-btn:hover {
  background-color: var(--primary-color);
  color: var(--light-color);
}

.compare-btn.selected {
  background-color: var(--primary-color);
  color: var(--light-color);
}

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

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

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--dark-color);
  color: var(--light-color);
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark-color) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Add compare buttons to product cards */
.product-info {
  position: relative;
}

/* Responsive adjustments for interactive elements */
@media (max-width: 768px) {
  .comparison-container {
    padding: 1rem;
  }
  
  .comparison-table th, .comparison-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
  
  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
  
  .timeline-nav-dot {
    width: 10px;
    height: 10px;
    margin: 0 6px;
  }
}
