/**
 * @file
 * FlowDrop Stat Card Component Styles
 */

.fd-stat-card {
  display: flex;
  align-items: flex-start;
  padding: var(--fd-stat-card-padding);
  transition:
    box-shadow var(--fd-transition-fast),
    border-color var(--fd-transition-fast),
    transform var(--fd-transition-fast);
  text-decoration: none;
  color: inherit;
  border: var(--fd-border-width) solid var(--fd-stat-card-border);
  border-radius: var(--fd-stat-card-radius);
  background-color: var(--fd-stat-card-bg);
  gap: var(--fd-space-4);
}

/* Clickable state */
.fd-stat-card--clickable {
  cursor: pointer;
}

.fd-stat-card--clickable:hover {
  border-color: var(--fd-border-muted);
  box-shadow: var(--fd-shadow-md);
}

.fd-stat-card--clickable:active {
  transform: scale(0.99);
}

/* Icon container */
.fd-stat-card__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-block-start: 0;
  color: var(--fd-stat-card-icon-color);
  border-radius: var(--fd-radius-lg);
  background-color: var(--fd-stat-card-icon-bg);
}

.fd-stat-card__icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Content */
.fd-stat-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.fd-stat-card__value {
  display: flex;
  align-items: baseline;
  color: var(--fd-stat-card-value-color);
  font-size: var(--fd-stat-card-value-size);
  font-weight: var(--fd-stat-card-value-weight);
  line-height: 1.2;
  gap: var(--fd-space-2);
}

.fd-stat-card__label {
  margin-block-start: var(--fd-space-1);
  color: var(--fd-stat-card-label-color);
  font-size: var(--fd-stat-card-label-size);
  font-weight: var(--fd-stat-card-label-weight);
}

/* Trend indicator */
.fd-stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  font-size: var(--fd-text-sm);
  font-weight: var(--fd-font-weight-medium);
}

.fd-stat-card__trend--up {
  color: var(--fd-success-hover);
}

.fd-stat-card__trend--down {
  color: var(--fd-error-hover);
}

.fd-stat-card__trend--neutral {
  color: var(--fd-muted-foreground);
}

.fd-stat-card__trend-icon {
  width: 1rem;
  height: 1rem;
}

/* Arrow for clickable cards */
.fd-stat-card__arrow {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  transition:
    opacity var(--fd-transition-fast),
    transform var(--fd-transition-fast);
  transform: translateX(-4px);
  opacity: 0;
  color: var(--fd-muted-foreground);
}

.fd-stat-card--clickable:hover .fd-stat-card__arrow {
  transform: translateX(0);
  opacity: 1;
}

/* ========================================================================
 * VARIANT STYLES
 * ======================================================================== */

/* Primary variant */
.fd-stat-card--primary .fd-stat-card__icon {
  color: var(--fd-primary-hover);
  background-color: var(--fd-primary-muted);
}

/* Success variant */
.fd-stat-card--success .fd-stat-card__icon {
  color: var(--fd-success-hover);
  background-color: var(--fd-success-muted);
}

/* Warning variant */
.fd-stat-card--warning .fd-stat-card__icon {
  color: var(--fd-warning-hover);
  background-color: var(--fd-warning-muted);
}

/* Error variant */
.fd-stat-card--error .fd-stat-card__icon {
  color: var(--fd-error-hover);
  background-color: var(--fd-error-muted);
}
