/* Architecture Diagram — light-mode-only component
   ================================================= */

/* Force light appearance regardless of system theme */
.arch-component .tabs-content {
  background: #ebebf0;
  padding-bottom: 32px; /* reduced from 50px */
}

/* Diagram container */
.arch-diagram {
  position: relative;
  /* Default (User View): tighter vertical spacing */
  padding: 42px 36px 16px;
  transition: padding 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Architecture View: increased top padding for curved arrows */
.arch-diagram.arch-active {
  padding-top: 80px;
  padding-bottom: 0px;
}

/* Cards row */
.arch-cards {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.arch-card {
  flex: 1;
  max-width: 140px;
  aspect-ratio: 583 / 365;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.45s ease;
}

.arch-card svg,
.arch-card img {
  display: block;
  width: 100%;
  height: 100%;
}

/* Editor card rows: solid blue in architecture view */
.arch-diagram.arch-active .arch-card[data-type="editor"] .arch-row {
  fill: #c3e1fc;
  transition: fill 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Coded card rows: per-row animated gradient in architecture view */
.arch-diagram.arch-active
  .arch-card[data-type="coded"]
  [data-gradient-id="coded-gradient-0"] {
  fill: url(#coded-gradient-0);
}
.arch-diagram.arch-active
  .arch-card[data-type="coded"]
  [data-gradient-id="coded-gradient-1"] {
  fill: url(#coded-gradient-1);
}
.arch-diagram.arch-active
  .arch-card[data-type="coded"]
  [data-gradient-id="coded-gradient-2"] {
  fill: url(#coded-gradient-2);
}
.arch-diagram.arch-active
  .arch-card[data-type="coded"]
  [data-gradient-id="coded-gradient-3"] {
  fill: url(#coded-gradient-3);
}
.arch-diagram.arch-active
  .arch-card[data-type="coded"]
  [data-gradient-id="coded-gradient-4"] {
  fill: url(#coded-gradient-4);
}

/* SVG arrow layer */
.arch-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Legend */
.arch-legend {
  /* Use max-height for transition instead of display:none */
  display: flex;
  gap: 50px;
  justify-content: center;
  overflow: hidden;

  /* Hidden state */
  max-height: 0;
  padding-top: 0;
  opacity: 0;
  transform: translateY(5px);

  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    padding-top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    transform 0.3s ease;
}

.arch-diagram.arch-active .arch-legend {
  /* Visible state */
  max-height: 100px;
  padding-top: 80px;
  opacity: 1;
  transform: translateY(0);

  /* Delay opacity/transform so layout expands first/during */
  transition:
    max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    padding-top 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease 0.15s,
    transform 0.4s ease 0.15s;
}

.arch-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.38);
}

.arch-swatch {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  box-shadow: 0 1px 3px 0px rgba(0, 0, 0, 0.3);
  border: 2px white solid;
}

.arch-swatch.editor {
  background: #a6cdf5;
}

.arch-swatch.coded {
  background: linear-gradient(90deg, #f9a470, #bc556f);
}

/* ── Mobile ── */
@media (max-width: 720px) {
  .arch-diagram {
    padding: 30px 48px 16px;
  }
  .arch-cards {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .arch-card {
    max-width: 160px;
    width: 100%;
  }
  .arch-legend {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .arch-diagram.arch-active {
    padding-top: 30px;
  }
  .arch-diagram.arch-active .arch-legend {
    padding-top: 35px;
    max-height: 140px;
  }
}

@media (max-width: 500px) {
  .arch-diagram {
    padding: 24px 44px 12px;
  }
}
