/* === Project Status & Stats Styles === */

.project-status-wrapper {
  background: #f8f8f8;
  padding: 20px 20px 8px;
  border-radius: 12px 12px 0 0;
  font-family: inherit;
  text-align: center;
}

.project-status-label {
  font-weight: 700;
  font-size: 0.85em;
  color: #333;
  text-transform: uppercase;
  margin-bottom: 8px;
  user-select: none;
}

.cancelled-tag {
  display: inline-block;
  background-color: #C62828; /* Softer rich red */
  color: white;
  font-weight: 700;
  font-size: 1em;
  padding: 6px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  user-select: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  letter-spacing: 0.06em;
}

.status-bar-container {
  display: flex;
  border-radius: 30px;
  overflow: hidden;
  height: 20px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 8px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.1);
}

.status-segment {
  flex: 1;
  transition: background-color 0.4s ease;
}

.status-segment.unfilled {
  background-color: #e0e0e0;
}

.status-segment.proposed {
  background-color: #E6A83D;
}

.status-segment.approved {
  background-color: #5C4B8B;
}

.status-segment.under-construction {
  background-color: #0081E0;
}

.status-segment.complete {
  background-color: #00AE53;
}

.status-segment.cancelled {
  background-color: #ccc;
}

.status-segment:not(:last-child) {
  border-right: 2px solid white;
}

.status-steps-labels {
  display: flex;
  max-width: 560px;
  margin: 4px auto 0 auto;
}

.status-step-label {
  flex: 1;
  text-align: center;
  font-size: 0.75em;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  user-select: none;
  transition: color 0.3s ease;
}

/* ==== Updated Project Stats with CSS Grid ==== */
.project-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  grid-template-rows: auto auto; /* labels on first row, values second */
  gap: 8px 32px;
  justify-items: center;
  background: #f8f8f8;
  padding: 16px 20px 20px;
  border-radius: 0 0 12px 12px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  color: inherit;
}

.project-stats div.stat-block {
  display: contents; /* allows label and span to be direct grid children */
}

.project-stats .label {
  grid-row: 1;
  font-weight: 700;
  color: #333;
  font-size: 0.85em;
  text-transform: uppercase;
  margin-bottom: 1px;
  text-decoration: none;
  pointer-events: none;
  user-select: none;
  text-align: center;
}

.project-stats.greyed .label {
  color: #999999;
}

.project-stats span {
  grid-row: 2;
  color: #111;
  font-size: 1em;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  max-width: 20ch; /* wrap text longer than ~20 chars */
  margin: 0 auto;
}

.project-stats.greyed span {
  color: #999999;
}

.last-updated-note {
  font-style: italic;
  font-size: 0.85em;
  color: #666;
  margin-top: 12px;
  max-width: 560px;
  margin-left: auto;
  margin-right: 0;
  text-align: right;
  font-family: inherit;
}

/* === Responsive tweaks for project info === */
@media (max-width: 480px) {
  .project-stats {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 12px 0;
    padding: 16px 12px 20px;
  }

  .project-stats .label {
    grid-row: auto;
    margin-bottom: 2px;
  }

  .project-stats span {
    grid-row: auto;
    max-width: 100%;
  }

  .status-steps-labels {
    max-width: 100%;
    margin: 8px auto 0 auto;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .status-step-label {
    flex: 1 1 auto;
    padding: 0 6px;
    white-space: normal;
    line-height: 1.2em;
    text-align: center;
  }
}

/* === Report a Data Error Modal Styling === */

/* Modal overlay */
#data-error-modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  /* Flex center the modal content */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px; /* Padding so modal doesn't hug screen edges on small */
  box-sizing: border-box;
}

/* Modal content box */
#data-error-modal > div {
  background: #fff;
  border-radius: 10px;
  max-width: 420px;
  width: 100%;
  padding: 24px 30px 30px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
}

/* Close button */
#data-error-close {
  position: absolute;
  top: 12px;
  right: 14px;
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease-in-out;
}

#data-error-close:hover {
  color: #000;
}

/* Modal heading */
#data-error-modal h3 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  text-align: center;
}

/* Textarea */
#data-error-message {
  width: 100%;
  height: 110px;
  resize: vertical;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1.8px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  color: #444;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

#data-error-message:focus {
  outline: none;
  border-color: #0081E0; /* your blue */
  box-shadow: 0 0 5px rgba(0, 129, 224, 0.6);
}

/* Submit button */
#data-error-submit {
  background-color: #0081E0;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: background-color 0.3s ease;
  box-sizing: border-box;
}

#data-error-submit:hover,
#data-error-submit:focus {
  background-color: #005f9e;
  outline: none;
}

/* Success and error messages */
#data-error-success,
#data-error-error {
  margin-top: 14px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  user-select: none;
}

#data-error-success {
  color: #00AE53; /* green */
}

#data-error-error {
  color: #C62828; /* red */
}

/* Responsive tweaks for modal */
@media (max-width: 480px) {
  #data-error-modal > div {
    padding: 20px 18px 24px;
    max-width: 100%;
  }

  #data-error-message {
    height: 90px;
    font-size: 0.9rem;
  }

  #data-error-submit {
    font-size: 0.95rem;
    padding: 10px 20px;
  }

  #data-error-close {
    top: 10px;
    right: 10px;
    font-size: 26px;
  }
}
