/* =============================
   COMPONENT INVENTORY
   ============================= */

/* --- Card Component --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-glow);
}

.card--featured {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border-glow);
  position: relative;
  overflow: hidden;
}

.card--featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.card--term-definition {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent-cyan);
  padding: var(--space-lg);
}

/* --- Button Component --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.btn--primary:hover {
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
  color: white;
}

.btn--secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn--secondary:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

/* --- Navigation Link --- */
.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--font-size-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.nav-link--active {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.nav-link--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-md);
  right: var(--space-md);
  height: 2px;
  background: var(--accent-cyan);
  border-radius: var(--radius-sm);
}

/* --- Term Link --- */
.term-link {
  color: var(--accent-cyan);
  border-bottom: 1px dotted var(--accent-cyan);
  transition: all var(--transition-fast);
  position: relative;
}

.term-link:hover {
  color: var(--accent-blue);
  border-bottom-style: solid;
  background: rgba(6, 182, 212, 0.1);
  padding: 0 var(--space-xs);
  border-radius: var(--radius-sm);
  margin: 0 calc(-1 * var(--space-xs));
}

.term-link::after {
  content: '↗';
  font-size: 0.7em;
  margin-left: 2px;
  opacity: 0.6;
}

.term-link--card-reference {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  text-decoration: none;
  border-bottom: none;
}

.term-link--card-reference:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.term-link--card-reference::after {
  content: none;
}

/* --- Section Header --- */
.section-header {
  margin-bottom: var(--space-xl);
}

.section-header__title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.section-header__icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
}

.section-header__subtitle {
  color: var(--text-muted);
  font-size: var(--font-size-lg);
  margin-left: calc(40px + var(--space-md));
}

/* --- Code Block --- */
.code-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block__header {
  background: var(--bg-secondary);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--font-size-xs);
  color: var(--text-dim);
  font-family: var(--font-mono);
  border-bottom: 1px solid var(--border-subtle);
}

.code-block__content {
  padding: var(--space-lg);
  overflow-x: auto;
}

.code-block--inline {
  display: inline;
  background: var(--bg-elevated);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--accent-cyan);
}

/* --- Tag --- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.tag--category {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  border-color: rgba(6, 182, 212, 0.2);
}

/* --- Coming Soon Badge --- */
.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  color: var(--accent-purple);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.coming-soon__icon {
  animation: pulse 2s ease-in-out infinite;
}

/* --- Process Step (for flow diagrams) --- */
.process-step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  position: relative;
}

.process-step__number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: white;
}

.process-step__content h4 {
  margin-bottom: var(--space-xs);
}

.process-step__content p {
  margin-bottom: 0;
  color: var(--text-muted);
}

.process-step__connector {
  position: absolute;
  left: calc(18px + var(--space-lg));
  bottom: calc(-1 * var(--space-md));
  width: 2px;
  height: var(--space-md);
  background: var(--accent-gradient);
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
  margin-bottom: var(--space-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

th, td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text-secondary);
}

tr:hover td {
  background: var(--bg-elevated);
}

/* --- Blockquote --- */
blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding-left: var(--space-lg);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding: var(--space-xl) 0;
}

.timeline__track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple));
  border-radius: var(--radius-sm);
  transform: translateY(-50%);
}

.timeline__items {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.timeline__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: calc(100% / 6);
  padding: 0 var(--space-sm);
}

.timeline__item:nth-child(odd) .timeline__content {
  order: -1;
  margin-bottom: var(--space-md);
  margin-top: 0;
}

.timeline__dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-cyan);
  flex-shrink: 0;
}

.timeline__dot--optional {
  background: var(--bg-elevated);
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.5);
}

.timeline__content {
  margin-top: var(--space-md);
  max-width: 180px;
}

.timeline__time {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.timeline__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  line-height: var(--leading-tight);
}

.timeline__desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

/* Vertical timeline for mobile */
@media (max-width: 768px) {
  .timeline__track {
    top: 0;
    bottom: 0;
    left: 20px;
    right: auto;
    width: 3px;
    height: auto;
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple));
    transform: none;
  }

  .timeline__items {
    flex-direction: column;
    gap: var(--space-xl);
    padding-left: var(--space-xl);
  }

  .timeline__item {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    padding: 0;
  }

  .timeline__item:nth-child(odd) .timeline__content {
    order: 0;
    margin-bottom: 0;
    margin-top: 0;
  }

  .timeline__content {
    margin-top: 0;
    margin-left: var(--space-md);
    max-width: none;
  }

  .timeline__dot {
    margin-top: 2px;
  }
}
