/* Shared components for the five-part vector database course. */

.vdb-flow,
.vdb-grid,
.vdb-cards {
  display: grid;
  gap: 14px;
}

.vdb-flow {
  grid-template-columns: repeat(4, 1fr);
}

.vdb-grid {
  grid-template-columns: repeat(2, 1fr);
}

.vdb-cards {
  grid-template-columns: repeat(3, 1fr);
}

.vdb-card,
.vdb-step,
.vdb-table-wrap {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.vdb-card,
.vdb-step {
  padding: 16px;
}

.vdb-step {
  position: relative;
}

.vdb-step::after {
  content: '→';
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 900;
  color: var(--cyan);
}

.vdb-step:last-child::after {
  display: none;
}

.vdb-num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(8, 145, 178, .1);
  color: var(--cyan);
  font-weight: 900;
  margin-bottom: 8px;
}

.vdb-card h3,
.vdb-step h3 {
  font-size: 15px;
  margin: 0 0 7px;
  color: var(--text);
}

.vdb-card p,
.vdb-step p,
.vdb-card li {
  font-size: 13px;
  line-height: 1.65;
  color: var(--sub);
  margin: 0;
}

.vdb-card ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.vdb-card code,
.vdb-step code,
.vdb-note code,
.vdb-table code {
  overflow-wrap: anywhere;
}

.vdb-code {
  background: #111827;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  overflow: auto;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
}

.vdb-code .c {
  color: #94a3b8;
}

.vdb-code .k {
  color: #7dd3fc;
}

.vdb-code .s {
  color: #86efac;
}

.vdb-table-wrap {
  overflow: auto;
}

.vdb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.vdb-table th,
.vdb-table td {
  padding: 11px 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
  color: var(--text);
}

.vdb-table th {
  background: rgba(8, 145, 178, .06);
  color: var(--cyan);
  font-weight: 800;
}

.vdb-table tr:last-child td {
  border-bottom: 0;
}

.vdb-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(124, 58, 237, .09);
  color: var(--purple);
  font-size: 12px;
  font-weight: 800;
}

.vdb-note {
  border-left: 4px solid var(--amber);
  padding: 12px 15px;
  border-radius: 0 10px 10px 0;
  background: rgba(217, 119, 6, .07);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.vdb-ok {
  border-left-color: var(--success);
  background: rgba(22, 163, 74, .06);
}

@media (max-width: 820px) {
  .vdb-flow,
  .vdb-cards {
    grid-template-columns: 1fr 1fr;
  }

  .vdb-step:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .vdb-flow,
  .vdb-grid,
  .vdb-cards {
    grid-template-columns: 1fr;
  }

  .vdb-step::after {
    content: '↓';
    right: 50%;
    top: auto;
    bottom: -17px;
    transform: translateX(50%);
  }

  .vdb-step:nth-child(2)::after {
    display: block;
  }

  .vdb-step:last-child::after {
    display: none;
  }

  .vdb-code {
    font-size: 11px;
    padding: 13px;
  }

  .vdb-table {
    min-width: 520px;
  }
}
