@import "../../styles.css";

.studio {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--white);
}

.studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 2px solid var(--black);
  flex-shrink: 0;
  min-height: 58px;
}

.studio-bar__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.studio-bar__identity .mark {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.studio-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.studio-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 280px;
  min-height: 0;
}

.studio-shell.is-busy { cursor: progress; }

.rail {
  border-right: 2px solid var(--black);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 6px;
  overflow: auto;
}

.rail__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 6px 4px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--black);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.rail__btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.rail__btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

.rail__btn.is-active {
  border-color: var(--black);
  background: var(--white);
}

.canvas-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
}

#empty-panel,
#workspace-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#empty-panel[hidden],
#workspace-panel[hidden] { display: none; }

.dropzone {
  width: min(100%, 640px);
  margin: auto;
  border: 2px dashed var(--black);
  border-radius: var(--radius-lg);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 24px;
  background: var(--white);
}

.dropzone.is-drag,
.dropzone:focus-within { box-shadow: var(--shadow-md); }

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin-top: 22px;
}

.feature-chips li {
  border: 2px solid var(--black);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.file-board {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-row,
.page-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.file-row__name,
.page-row__name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 0.88rem;
}

.file-row__meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 400;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 16px;
}

.thumb-card {
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thumb-card canvas,
.thumb-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  background: var(--gray-50);
}

.thumb-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
}

.canvas-hud {
  flex-shrink: 0;
  padding: 8px 16px 12px;
  background: var(--white);
  border-top: 2px solid var(--black);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-text,
.meta-text {
  font-size: 0.8rem;
  color: var(--gray-600);
  min-height: 1.2em;
}

.meta-text { color: var(--gray-500); }

.error {
  margin: 12px 16px 0;
  padding: 10px 12px;
  border: 2px solid var(--black);
  background: var(--gray-50);
  font-size: 0.85rem;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 8px;
  border: 2px solid var(--black);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
  appearance: none;
}

progress::-webkit-progress-bar { background: var(--white); }
progress::-webkit-progress-value { background: var(--black); }
progress::-moz-progress-bar { background: var(--black); }

.inspector {
  border-left: 2px solid var(--black);
  background: var(--white);
  overflow: auto;
  padding: 18px 14px 24px;
}

.inspector .panel h2 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.controls__lead {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.field select,
.field input[type="number"],
.field input[type="text"],
.field input[type="range"] {
  width: 100%;
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--white);
}

.field input[type="range"] { padding: 8px 0; }

.field em {
  font-style: normal;
  color: var(--gray-500);
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.pos-grid button {
  border: 2px solid var(--black);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 8px 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.pos-grid button.is-active {
  background: var(--black);
  color: var(--white);
}

.controls__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.controls__actions .btn { width: 100%; }

.size-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 960px) {
  .studio-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  .rail {
    flex-direction: row;
    overflow: auto;
    border-right: 0;
    border-bottom: 2px solid var(--black);
  }
  .rail__btn {
    min-width: 72px;
    min-height: 52px;
  }
  .inspector {
    border-left: 0;
    border-top: 2px solid var(--black);
    max-height: 280px;
  }
}
