/* ==========================================================================
   Scratch-Style Visual Logic Automation Panel
   Scrollable only UP/DOWN inside the PoC Radio Screen
   ========================================================================== */

#poc-scratch-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: rgba(13, 20, 32, 0.96);
  border-left: 3px solid var(--border-contrast);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden;
  overflow-y: auto;
}

#poc-scratch-panel.open {
  transform: translateX(0);
}

.scratch-header {
  padding: 16px;
  background: #0b111a;
  border-bottom: 2px solid var(--border-contrast-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.scratch-header-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scratch-scroll-area {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Custom vertical scrollbar */
.scratch-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.scratch-scroll-area::-webkit-scrollbar-thumb {
  background: var(--border-contrast);
  border-radius: var(--pill-radius);
}

/* Scratch Block Types */
.scratch-block {
  border-radius: 14px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* When Hat Block (Trigger Event) */
.scratch-block-event {
  background: #ff8f00;
  border-left: 6px solid #ff6f00;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

/* If Condition Block */
.scratch-block-condition {
  background: #1e88e5;
  border-left: 6px solid #1565c0;
}

/* Then Action Block */
.scratch-block-action {
  background: #00897b;
  border-left: 6px solid #004d40;
}

/* Outgoing Webhook Block */
.scratch-block-webhook {
  background: #8e24aa;
  border-left: 6px solid #6a1b9a;
}

.scratch-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.scratch-block-delete {
  background: none;
  border: none;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
  padding: 2px 6px;
}

.scratch-block select,
.scratch-block input {
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  border-radius: var(--pill-radius);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  outline: none;
}

.scratch-connector {
  width: 20px;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  margin: -4px auto;
  border-radius: 2px;
}

.scratch-footer-actions {
  padding: 16px;
  background: #0b111a;
  border-top: 2px solid var(--border-contrast-dim);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
