/* Interactive Patterns - ROA2WEB */

/* ===== Loading Spinners ===== */
.loading-spinner {
  width: var(--spinner-size, 40px);
  height: var(--spinner-size, 40px);
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.loading-spinner-sm {
  --spinner-size: 24px;
  border-width: 3px;
}

.loading-spinner-lg {
  --spinner-size: 56px;
  border-width: 5px;
}

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

/* ===== Trend Indicators ===== */
.trend {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.trend-up {
  color: var(--color-success);
}

.trend-down {
  color: var(--color-error);
}

.trend-neutral {
  color: var(--color-text-secondary);
}

.trend-icon {
  font-size: 0.75rem;
}

/* ===== Collapse/Expand Patterns ===== */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.collapsible-header:hover {
  background: var(--color-bg-secondary);
}

.collapse-icon {
  font-size: 0.625rem;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
  display: inline-block;
  width: 1rem;
}

.collapse-icon.expanded {
  transform: rotate(90deg);
}

/* ===== Card Hover Effects ===== */
.card-hover {
  transition: all var(--transition-fast);
}

.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(var(--hover-lift, -2px));
  border-color: var(--color-primary);
}

/* ===== Sparkline Containers ===== */
.sparkline-container {
  width: 100%;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
}

.sparkline-chart {
  width: 100%;
  height: var(--sparkline-height, 80px);
  position: relative;
}

.sparkline-chart-lg {
  --sparkline-height: 150px;
}

.sparkline-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
