/* ============================================================
   SLIDE 03 & 03B
   ============================================================ */

/* ── Slide 03 Split Layout ── */
.s03-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--space-xl);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  align-items: center;
  padding: var(--space-lg) var(--space-xl);
}

.s03-split__left {
  padding-right: var(--space-md);
}

/* ══════════════════════════════════════
   SLIDE 03B: Lego Architecture + Drawer
   ══════════════════════════════════════ */

.lego-arch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  padding: 0 120px 10px;
  position: relative;
  z-index: 1;
  justify-content: space-evenly;
}

/* Each row: label | content */
.lego-arch-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: center;
  width: 100%;
  padding: 4px 0;
}

/* Label — white, bold */
.lego-arch-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-align: right;
  padding-right: 14px;
  border-right: 2px solid rgba(255, 255, 255, 0.2);
}

/* Content */
.lego-arch-content {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* ── Layer Dividers (dotted horizontal lines only) ── */
.lego-arch-line {
  width: 100%;
  height: 16px;
  position: relative;
}

.lego-arch-line::before {
  content: '';
  position: absolute;
  left: 134px;
  right: 0;
  top: 50%;
  border-top: 1px dotted rgba(255, 255, 255, 0.1);
}

/* Smaller gap between FP and CT (they're peers fed by API) */
.lego-arch > :nth-child(2) {
  height: 16px;
}
.lego-arch > :nth-child(2)::before {
  display: none;
}

/* API & MW rows: compact — they're single locked blocks */
.lego-arch > :nth-child(5),
.lego-arch > :nth-child(7) {
  padding: 0;
}

/* Dividers around API & MW: tighter */
.lego-arch > :nth-child(4),
.lego-arch > :nth-child(6) {
  height: 10px;
}

/* Box wrapper */
.lego-arch-box {
  background: rgba(14, 14, 14, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 14px 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 90%;
}

.lego-arch-box--narrow {
  max-width: 50%;
}

/* Slots */
.lego-arch-slots--horizontal {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

/* ══════════════════════════════════════
   DRAWER
   ══════════════════════════════════════ */

/* Tab button */
.lego-drawer-tab {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.25s ease;
  z-index: 10;
}

.lego-drawer-tab span {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.lego-drawer-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.lego-drawer-tab--hidden {
  opacity: 0;
  pointer-events: none;
}

/* Drawer panel */
.lego-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: rgba(5, 5, 5, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
}

.lego-drawer--open {
  transform: translateX(0);
}

.lego-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.lego-drawer__header span {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lego-drawer__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}

.lego-drawer__close:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lego-drawer__section {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lego-drawer__section-title {
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.lego-drawer__blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ══════════════════════════════════════
   LEGO BLOCKS
   ══════════════════════════════════════ */

.lego-block {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  row-gap: 3px;
  width: 86px;
  height: 64px;
  border-radius: 6px;
  cursor: default;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  padding: 6px 10px;
}

.lego-block svg {
  grid-row: 1 / 3;
  grid-column: 1;
  align-self: center;
}

/* Placed — base colours */
.lego-block--placed {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* Locked — base colours */
.lego-block--locked {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

/* Draggable */
.lego-block--draggable {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.lego-block--draggable:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* Dragging */
.lego-block--dragging {
  opacity: 0.3 !important;
  cursor: grabbing !important;
}

.lego-block__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  line-height: 1.2;
  margin: 0;
  grid-column: 2;
  grid-row: 1;
}

.lego-block__sub {
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  line-height: 1;
  margin: 0;
  grid-column: 2;
  grid-row: 2;
}

/* ── Slot (on main diagram — BIG) ── */
.lego-slot {
  flex: 1;
  min-width: 160px;
  height: 56px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 6px 14px;
  transition: all 0.25s ease;
  background: rgba(255, 255, 255, 0.03);
}

.lego-slot__hint {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.1);
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  text-align: center;
}

.lego-slot--highlight {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.lego-slot--highlight .lego-slot__hint {
  color: rgba(255, 255, 255, 0.3);
}

.lego-slot--over {
  border-color: var(--color-accent) !important;
  background: rgba(255, 193, 7, 0.1) !important;
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.12);
}

/* ── Placed block (matches slot size) ── */
.lego-block--placed {
  flex: 1;
  min-width: 160px;
  height: 56px;
  border-radius: 8px;
}

.lego-block--placed .lego-block__label {
  font-size: 13px;
}

.lego-block--placed .lego-block__sub {
  font-size: 9px;
}

.lego-block--placed svg {
  width: 16px;
  height: 16px;
}

/* ── Core modules row: compact blocks ── */
.lego-arch-row:last-child .lego-slot {
  flex: 0 0 auto;
  width: 120px;
  max-width: 120px;
  height: 52px;
}

.lego-arch-row:last-child .lego-block--placed {
  flex: 0 0 auto;
  width: 120px;
  max-width: 120px;
  height: 52px;
}

/* ── Locked block (API/Middleware — solo, wide) ── */
.lego-block--locked {
  width: 400px;
  height: 60px;
  border-radius: 8px;
  column-gap: 14px;
  padding: 8px 20px;
}

.lego-block--locked .lego-block__label {
  font-size: 16px;
}

.lego-block--locked .lego-block__sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.lego-block--locked svg {
  width: 22px;
  height: 22px;
}

/* ── Drawer blocks (small, responsive) ── */
.lego-drawer .lego-block {
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 6px 10px;
  column-gap: 8px;
}

.lego-drawer .lego-block__label {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lego-drawer .lego-block__sub {
  font-size: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lego-drawer .lego-block svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.lego-drawer__blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Add More placeholder ── */
.lego-block--add-more {
  background: transparent;
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
}

.lego-block--add-more .lego-block__label {
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
}

.lego-block--add-more .lego-block__sub {
  color: rgba(255, 255, 255, 0.2);
}

.lego-block--add-more svg {
  opacity: 0.3;
}
