/* ==========================================================================
   ZAHIQ AI - Visual Problem Section
   Interactive Loss Calculator with Animations
   ========================================================================== */

.problem-section {
  padding: var(--space-20) 0;
  background: var(--background);
  position: relative;
  overflow: hidden;
}

.problem-container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Problem Header */
.problem-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.problem-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
}

.loss-amount {
  display: inline-block;
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { 
    transform: scale(1);
    filter: brightness(1);
  }
  50% { 
    transform: scale(1.05);
    filter: brightness(1.2);
  }
}

.problem-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

/* Loss Calculator Visual */
.loss-calculator {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.calculator-visual {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Phone Rain Animation */
.phone-rain {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.missed-call {
  position: absolute;
  font-size: var(--text-3xl);
  opacity: 0.6;
  animation: fall 3s linear infinite;
}

.missed-call:nth-child(1) { left: 10%; animation-delay: 0s; }
.missed-call:nth-child(2) { left: 30%; animation-delay: 0.5s; }
.missed-call:nth-child(3) { left: 50%; animation-delay: 1s; }
.missed-call:nth-child(4) { left: 70%; animation-delay: 1.5s; }
.missed-call:nth-child(5) { left: 90%; animation-delay: 2s; }

@keyframes fall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(450px) rotate(360deg);
    opacity: 0;
  }
}

/* Money Counter */
.money-counter {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  font-size: var(--text-6xl);
  font-weight: var(--font-extrabold);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 10px 40px rgba(255, 107, 0, 0.2);
}

.currency {
  font-size: var(--text-4xl);
  margin-right: var(--space-2);
}

.counter-value {
  font-variant-numeric: tabular-nums;
}

/* Loss Breakdown */
.loss-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.loss-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  transition: var(--transition-all);
  cursor: pointer;
}

.loss-item:hover {
  background: var(--background);
  box-shadow: var(--shadow-large);
  transform: translateX(8px);
}

.loss-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  background: var(--background);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-small);
}

.loss-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.loss-label {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.loss-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.loss-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: inherit;
  position: relative;
  animation: bar-grow 1.5s ease-out;
}

@keyframes bar-grow {
  from { width: 0 !important; }
}

.loss-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100px); }
  100% { transform: translateX(100px); }
}

.loss-value {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.loss-source {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-1);
}

.counter-period {
  font-size: var(--text-2xl);
  margin-left: var(--space-1);
  opacity: 0.8;
}

.sources-note {
  margin-top: var(--space-12);
  padding: var(--space-6);
  background: var(--surface);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--primary);
}

.sources-note p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

.sources-note strong {
  color: var(--text-primary);
}

/* Interactive Hover Effects */
.loss-item:hover .loss-icon {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Responsive */
@media (max-width: 1024px) {
  .loss-calculator {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  
  .calculator-visual {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .problem-title {
    font-size: var(--text-3xl);
  }
  
  .loss-amount {
    font-size: var(--text-4xl);
  }
  
  .money-counter {
    font-size: var(--text-5xl);
  }
}

@media (max-width: 480px) {
  .loss-item {
    flex-direction: column;
    text-align: center;
  }
  
  .loss-details {
    width: 100%;
  }
  
  .loss-value {
    margin: 0 auto;
  }
}