/* item.css - Styling for Item.js */

.item-wrapper {
  display: flex;
  gap: 20px;
  align-items: stretch;
  max-width: 1180px;
  margin: 20px auto;
  padding: 22px;
  background: var(--background1); /* Light grey to match theme */
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08); /* Softer shadow */
}

.item-main {
  flex: 1;
  min-width: 0;
  padding-right: 22px;
  border-right: 2px solid var(--background3); /* Subtle separation */
}

.item-details {
  flex: 1;
  min-width: 0;
}

.item-main h1 {
  color: var(--text1);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--accent2); /* Muted green for consistency */
  padding-bottom: 10px;
  margin: 0 0 14px;
}

.item-main h2 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text1);
  opacity: 0.95;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
}

.item-main p {
  font-size: 16px;
  color: var(--text1);
  opacity: 0.88;
  margin: 0 0 8px;
}

.item-main input,
.item-main select,
.item-main textarea {
  width: 100%;
  max-width: 340px;
  border: 1px solid #b9bcc2;
  border-radius: 7px;
  padding: 6px 9px;
  background: #fff;
  color: var(--text1);
  font-size: 15px;
  box-sizing: border-box;
}

.item-main input:disabled,
.item-main select:disabled,
.item-main textarea:disabled {
  background: #f1f2f4;
  color: #7a7a7a;
  border-color: #d2d4d9;
  cursor: not-allowed;
}

.item-main textarea {
  min-height: 64px;
  resize: vertical;
  max-width: 420px;
}

.item-main a.parent_id {
  font-size: 15px;
  color: #235e85;
  text-decoration: none;
  font-weight: 700;
}

.item-main a.parent_id:hover {
  text-decoration: underline;
}

.item-field-read {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
  padding: 0 9px;
  border: 1px solid #e2e5ea;
  border-radius: 7px;
  background: #f7f8fa;
  color: var(--text1);
  font-size: 15px;
}

.stage {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  font-weight: bold;
}

/* Stage colors with minimalistic adjustments */
.stage-backlog { background: #FFD166; color: #000; } /* Softer yellow */
.stage-development { background: #2196F3; color: #fff; } /* Bright blue */
.stage-testing { background: #FF7043; color: #fff; } /* Less intense orange */
.stage-done { background: var(--accent2); color: #fff; } /* Using theme green */

.item-actions {
  width: 140px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.item-actions button {
  border: 0;
  border-radius: 8px;
  background: var(--primary1);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  cursor: pointer;
}

.item-actions button:hover {
  background: var(--accent1);
}

.item-attributes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  padding: 0 0 0 8px;
  border: 0;
  background: transparent;
}

.attribute-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 4px 8px;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d9dde3;
  padding: 6px 0;
}

.attribute-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attribute-name {
  font-size: 15px;
  font-weight: 700;
  color: #262b30;
}

.attribute-range {
  font-size: 10px;
  color: #5f6873;
  background: #eceff3;
  border-radius: 999px;
  padding: 1px 6px;
}

.attribute-input-wrap {
  display: flex;
  justify-content: flex-end;
}

.item-main input.attribute-input {
  max-width: 76px;
  text-align: right;
  font-weight: 600;
  padding: 5px 8px;
}

.attribute-value {
  font-size: 13px;
  font-weight: 600;
  color: #1f2d3a;
}

.attribute-error {
  grid-column: 1 / -1;
  color: #8b1d1d;
  font-size: 12px;
  line-height: 1.2;
}

.item-description-block {
  margin-top: 4px;
}

.item-description-block h2 {
  margin-bottom: 8px;
}

.item-desc-read {
  width: 100%;
  max-width: 420px;
  min-height: 64px;
  border: 1px solid #e2e5ea;
  border-radius: 7px;
  background: #f7f8fa;
  padding: 8px 9px;
  box-sizing: border-box;
  white-space: pre-wrap;
  line-height: 1.3;
}

@media (max-width: 980px) {
  .item-wrapper {
    flex-direction: column;
    padding: 16px;
  }

  .item-main {
    border-right: 0;
    padding-right: 0;
    border-bottom: 2px solid var(--background3);
    padding-bottom: 16px;
  }

  .item-main h1 {
    font-size: 24px;
  }

  .item-main h2 {
    grid-template-columns: 1fr;
    font-size: 16px;
  }

  .item-actions {
    width: 100%;
    flex-direction: row;
  }

  .item-actions button {
    flex: 1;
    font-size: 15px;
  }
}
