/* ========================================
   Price History Chart Component Styles
   ======================================== */

.pw-price-chart-container {
  margin: 1.5rem 0;
}

.pw-chart-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 0;
  padding: 1rem 0;
}

.pw-price-chart {
  width: 100% !important;
  height: 100% !important;
}

/* Chart Legend Mini */
.pw-chart-legend-mini {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.pw-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pw-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* Chart Statistics */
.pw-chart-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pw-border);
}

.pw-stat-item {
  text-align: center;
  padding: 0.75rem;
  background: var(--pw-gray-50);
  border-radius: var(--pw-radius-lg);
  border: 1px solid var(--pw-border);
  transition: all 0.2s ease;
}

.pw-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--pw-shadow-md);
}

.pw-stat-label {
  font-size: var(--pw-text-xs);
  color: var(--pw-gray-600);
  font-weight: var(--pw-font-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.pw-stat-value {
  font-size: var(--pw-text-xl);
  font-weight: var(--pw-font-bold);
  color: var(--pw-gray-900);
  margin-bottom: 0.25rem;
}

.pw-stat-date {
  font-size: var(--pw-text-xs);
  color: var(--pw-gray-500);
  margin-top: 0.25rem;
}

.pw-stat-change {
  font-size: var(--pw-text-sm);
  font-weight: var(--pw-font-semibold);
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: var(--pw-radius-full);
}

.pw-stat-increase {
  color: var(--pw-danger);
  background: var(--pw-danger-light);
}

.pw-stat-decrease {
  color: var(--pw-success);
  background: var(--pw-success-light);
}

/* Dark Mode Adjustments */
.dark-mode .pw-stat-item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .pw-stat-value {
  color: var(--pw-white);
}

.dark-mode .pw-stat-label {
  color: var(--pw-gray-400);
}

.dark-mode .pw-stat-date {
  color: var(--pw-gray-500);
}

.dark-mode .pw-stat-increase {
  background: rgba(220, 38, 38, 0.15);
}

.dark-mode .pw-stat-decrease {
  background: rgba(22, 163, 74, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
  .pw-chart-wrapper {
    height: 250px;
  }

  .pw-chart-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .pw-stat-item {
    padding: 0.5rem;
  }

  .pw-stat-value {
    font-size: var(--pw-text-lg);
  }

  .pw-stat-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .pw-chart-wrapper {
    height: 220px;
    padding: 0.5rem 0;
  }

  .pw-chart-stats {
    grid-template-columns: 1fr;
  }

  .pw-chart-legend-mini {
    display: none;
  }

  .pw-stat-change {
    font-size: var(--pw-text-xs);
  }
}

/* Loading State */
.pw-chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--pw-gray-500);
}

.pw-chart-loading .pw-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--pw-gray-300);
  border-top-color: var(--pw-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Animation for chart appearance */
.pw-price-chart-container {
  animation: fadeInUp 0.4s ease-out;
}

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

/* Highlight price drops and increases */
.pw-price-drop-highlight {
  animation: pulseGreen 1s ease-out;
}

.pw-price-increase-highlight {
  animation: pulseRed 1s ease-out;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; box-shadow: 0 0 20px rgba(22, 163, 74, 0.4); }
}

@keyframes pulseRed {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; box-shadow: 0 0 20px rgba(220, 38, 38, 0.4); }
}
