/* phases.css
 * Copyright (c) 2025, 7th software Ltd.
 * All rights reserved.
 */

.procedure-panel {
  position: absolute;
  top: 12vw;
  left: 50%;
  transform: translateX(-50%);
  width: 90vw;
  max-width: 800px;

  min-height: 0;                  /* force Firefox to respect flex scroll */
  max-height: calc(100vh - 12vw); /* limit height */
  overflow-y: auto;               /* enable vertical scroll if needed */
  overscroll-behavior: contain;   /* optional: prevent scroll chaining on touch devices */
  overflow-anchor: none;          /* prevent scroll anchoring issues */

  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); /* for compatability */
  padding: 20px;
  padding-bottom: 2rem; /* ensures bottom elements are visible */
  border-radius: 12px;
  color: #fff;
  z-index: 30;

  opacity: 0;
  transition: opacity 500ms ease-in;
  pointer-events: none;

  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-sizing: border-box;

  /*outline: 2px solid red;*/ /* DEBUG */
}

.procedure-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 1000ms ease-out;
}

.procedure-panel > * {
  flex-shrink: 0; /* ensure all children contribute to scroll height */
  min-height: 0;  /* ensures children don’t collapse */
}

.procedure-panel h2 {
  margin-top: 0;
}

.procedure-step {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid #999;
  padding: 0.5rem;
  border-radius: 8px;
}

.procedure-step input,
.procedure-step select {
  font-size: 1rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: none;
}

.step-controls {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.step-controls button {
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.procedure-panel button {
  margin-top: 1rem;
  padding: 10px 20px;
  font-size: 1.2rem;
  background: #e69a75;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.procedure-button-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem; /* prevents clipping */
  /*outline: 2px solid lime;*/ /* DEBUG */
}
