/* Goldmine Article Animations CSS */

/* CSS Variables */
:root {
  --purple-accent: #7b44c1;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-accent: rgba(123, 68, 193, 0.8);
  --glass-secondary: rgba(123, 68, 193, 0.4);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
}

/* Base Animation Container */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2.5rem;
  margin: 3rem 0;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
}

.animation-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
  color: var(--text-primary);
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
}

/* Animate on Scroll Base */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Remove forced visibility - let JS handle it */

/* CAGR Growth Animation */
.cagr-growth-animation .growth-comparison {
  max-width: 600px;
  margin: 0 auto;
}

.growth-item {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.cagr-growth-animation.animate .growth-item {
  opacity: 1;
  transform: translateX(0);
}

.cagr-growth-animation.animate .growth-item.educational {
  transition-delay: 0.2s;
}

.cagr-growth-animation.animate .growth-item.overall {
  transition-delay: 0.4s;
}

.growth-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.growth-bar {
  height: 40px;
  background: linear-gradient(90deg, var(--purple-accent), var(--glass-accent));
  border-radius: 20px;
  position: relative;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1rem;
}

.cagr-growth-animation.animate .growth-bar {
  width: var(--bar-width) !important;
}

.growth-percentage {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.growth-multiplier {
  text-align: center;
  margin-top: 2rem;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.8s;
}

.cagr-growth-animation.animate .growth-multiplier {
  opacity: 1;
  transform: scale(1);
}

.multiplier-text {
  font-size: 1.5rem;
  color: var(--purple-accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Market Size Counter */
.market-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.market-item {
  text-align: center;
  padding: 1.5rem;
  background: rgba(123, 68, 193, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(123, 68, 193, 0.2);
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.market-size-counter.animate .market-item {
  opacity: 1;
  transform: scale(1);
}

.market-size-counter.animate .market-item:nth-child(1) {
  transition-delay: 0.2s;
}

.market-size-counter.animate .market-item:nth-child(2) {
  transition-delay: 0.4s;
}

.market-label {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-family: 'Merriweather', Georgia, serif;
}

.market-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--purple-accent);
  margin-bottom: 0.5rem;
}

.market-sublabel {
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

/* Market Segments */
.segments-chart {
  max-width: 800px;
  margin: 0 auto;
}

.segment-item {
  margin-bottom: 1.25rem;
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.market-segments-comparison.animate .segment-item {
  opacity: 1;
  transform: translateX(0);
}

.segment-name {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.segment-bar-container {
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.segment-bar {
  height: 100%;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1rem;
  border-radius: 16px;
}

.market-segments-comparison.animate .segment-bar {
  width: var(--bar-width) !important;
}

.segment-growth {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Platform Usage Circles */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  justify-items: center;
}

.platform-circle {
  position: relative;
  opacity: 0;
  transform: scale(0.8) rotate(-10deg);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-usage-circles.animate .platform-circle {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.platform-circle svg {
  transform: rotate(0deg);
}

.platform-progress {
  stroke-dashoffset: 282.74 !important; /* Full circle offset */
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

.platform-usage-circles.animate .platform-progress {
  stroke-dashoffset: var(--offset) !important;
}

.platform-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.platform-percentage {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.platform-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Success Metrics Cards */
.success-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.success-card {
  background: rgba(123, 68, 193, 0.1);
  border: 1px solid rgba(123, 68, 193, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-metrics-cards.animate .success-card {
  opacity: 1;
  transform: translateY(0);
}

.company-name {
  font-size: 1.3rem;
  color: var(--purple-accent);
  margin-bottom: 1rem;
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  text-align: center;
}

.metrics-grid {
  display: grid;
  gap: 0.75rem;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-item:last-child {
  border-bottom: none;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 768px) {
  .glass-card {
    padding: 1.5rem;
    margin: 2rem 0;
  }
  
  .animation-title {
    font-size: 1.4rem;
  }
  
  .market-value {
    font-size: 2rem;
  }
  
  .platforms-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
  }
  
  .platform-circle svg {
    width: 100px;
    height: 100px;
  }
  
  .platform-percentage {
    font-size: 1.5rem;
  }
  
  .success-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .glass-card {
    padding: 1.25rem;
    margin: 1.5rem -0.5rem;
    border-radius: 12px;
  }
  
  .animation-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
  }
  
  .market-size-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .market-value {
    font-size: 1.75rem;
  }
  
  .growth-bar {
    height: 32px;
  }
  
  .growth-percentage {
    font-size: 0.9rem;
  }
}

/* Animation Loading State */
.animate-on-scroll::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--purple-accent), var(--glass-accent));
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate::after {
  width: 100%;
  opacity: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s 1s;
}