/* ============================
   WoodMiser — Project Section (v7 baseline)
   Scoped to #projectSection so nothing leaks
   ============================ */

/* Card + header */
#projectSection .project-card {
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px;
  overflow: hidden;
}

#projectSection .project-header {
  background: linear-gradient(90deg, var(--accent, #0ea5e9), #63c5f5);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#projectSection .project-body {
  padding: 18px;
}

/* Two-column main grid: Inputs (L) / Execution (R) */
#projectSection .grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
}

/* Groups (fieldsets) */
#projectSection .group {
  border: 1px dashed var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

#projectSection .group h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  font-weight: 600;
}

/* Rows (label + input) */
#projectSection .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#projectSection .row.tight {
  justify-content: flex-start;
  column-gap: 12px;
}

/* Labels + inputs */
#projectSection label {
  font-size: 20px;
  line-height: 1.4;
}

#projectSection input[type='text'],
#projectSection input[type='number'] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line, #e5e7eb);
  outline: none;
}

/* Tighter Project Name width so it doesn't stretch too far right */
#projectSection #inpProjectName {
  width: 60%;
}

/* Checkboxes + helper chip */
#projectSection .checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

#projectSection .help {
  cursor: help;
  font-weight: 700;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 6px;
  padding: 0 6px;
  user-select: none;
}

/* Inline input wrappers (used for “Save Top/Bottom Solutions”) */
#projectSection .inline-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

#projectSection .inline-input.right {
  justify-content: flex-end;
}

/* KPI summary cards */
#projectSection .summary {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

#projectSection .kpi {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

#projectSection .kpi .label {
  font-size: 12px;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
}

#projectSection .kpi .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 4px;
}

/* Warnings / Notes area */
#projectSection .warnings {
  margin-top: 14px;
}

#projectSection textarea {
  width: 100%;
  min-height: 120px;
  border-radius: 12px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
}

/* Responsive: stack columns on smaller screens */
@media (max-width: 900px) {
  #projectSection .grid {
    grid-template-columns: 1fr;
  }
  #projectSection #inpProjectName {
    width: 100%;
  }
}

/* Messages row container */
.project-messages {
  display: flex;
  gap: 16px; /* space between the two panels */
  align-items: stretch;
  margin-top: 12px;
}

/* Each panel: ~45% width, flexible */
.project-messages .message-panel {
  flex: 1 1 45%;
  min-width: 280px; /* prevents awkward squish on medium widths */
}

/* Panel headings */
.project-messages .message-header {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #566; /* match your card title tone if you like */
  margin-bottom: 8px;
}

/* Warnings box (WM-populated) */
.project-messages .message-box {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  min-height: 120px;
  max-height: 240px;
  overflow: auto;
}

/* Notes textarea (user-populated) */
.project-messages .message-notes {
  width: 100%;
  min-height: 120px;
  max-height: 240px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
}

/* Stack vertically on narrow screens */
@media (max-width: 900px) {
  .project-messages {
    flex-direction: column;
  }
  .project-messages .message-panel {
    flex-basis: auto;
  }
}

/* ========== Warnings Box ========== */
#warningsBox {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  min-height: 60px;
  max-height: 150px;
  overflow-y: auto;
  background-color: #fdfdfd;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

/* Default style for any warning line */
.warning {
  margin-bottom: 4px;
}

/* Fatal errors: bold + red */
.warning.fatal {
  color: #b00020; /* deep red */
  font-weight: 600;
}

/* Non-fatal warnings: amber/orange */
.warning.nonfatal {
  color: #b36b00; /* amber */
}

/* Placeholder message when there are no warnings */
.no-warnings {
  color: #666;
  font-style: italic;
}

/* ======== calculate button ======== */
#btnCalculate .spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: spin 0.8s linear infinite;
}
#btnCalculate.loading .icon {
  display: none;
}
#btnCalculate.loading .spinner {
  display: inline-block;
}

#btnCalculate.btn-calculate {
  background-color: var(--primary-color, #0077cc);
  color: white;
  font-size: 1.1rem;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
}

#btnCalculate.btn-calculate:hover {
  background-color: #005fa3;
}

#btnCalculate .icon {
  font-size: 1.2em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* stylesProject.css */
#projectSection.screen.section-theme.theme-project #projectCard {
  background-color: #eef7ff !important;
}

/* common inner wrappers – adjust names to your actual markup */
#projectSection .project-card,
#projectSection .project-card .project-body,
#projectSection .project-card .inputsBlock,
#projectSection .project-card .executionBlock,
#projectSection .project-card .card,
#projectSection .project-card .pane {
  background-color: #fffaf0;
}

/* Tint the outer card/body */
#projectSection .project-card,
#projectSection .project-card .project-body {
  background-color: #fffaf0;
}

/* Let the tint show through */
#projectSection .group,
#projectSection .kpi,
#projectSection textarea,
.project-messages .message-box,
.project-messages .message-notes,
#warningsBox {
  background-color: transparent !important;
}

.project-body h3 {
  background-color: #f6efe3; /* subtle contrast with theme-project bg */
  padding: 10px 12px;
  margin: -16px -16px 16px -16px; /* pulls across panel width */
  border-bottom: 1px solid #e0e0e0;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 6px 6px 0 0;
  color: #333;
}

.calc-progress {
  margin-left: 12px;

  /* ★ doubled size from ~0.9rem → 1.8rem */
  font-size: 1.2rem;
  font-weight: 500;

  background: #fff3b0; /* soft yellow */
  color: #6a5500; /* dark gold text */
  border: 1px solid #e0c96f; /* subtle gold border */
  border-radius: 6px;

  padding: 4px 10px; /* scaled with font size */
  min-width: 60px; /* prevents layout shifts */
  display: inline-block;
  text-align: center;

  visibility: hidden; /* hidden by default */
}
