/* This file is a complete mess, mostly because I am bad at CSS. I would like to rewrite it at some point, but for now it works and I don't want to break it. */

:root {
  --mndot-blue: #003865;
  --mndot-gray-900: #2e2e2e;
  --mndot-gray-700: #5c5c5c;
  --mndot-gray-100: #f4f4f4;
  --mndot-gray-light: #cfcfcf;
  --mndot-gray-lighter: #f0f0f0;
  --border-radius: 6px;
  --border-color: #d0d0d0;
}

body {
  font-family: "Brandon Grotesque", "Open Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: var(--mndot-gray-100);
  color: var(--mndot-gray-900);
  scrollbar-gutter: stable;
}

.site-header {
  display: flex;
  align-items: center;            /* Vertically center title with logo */
  gap: 1.5rem;
  background: var(--mndot-blue);
  color: white;
  padding: 1.25rem 2rem;
}

.header-logo {
  height: 4rem;
  flex-shrink: 0;
}

.header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-text h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header-text p {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

main {
  padding: 2rem;
  max-width: 1100px;
  margin: auto;
}

section {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

section h2 {
  margin-top: 0;
  color: var(--mndot-blue);
  font-size: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

label {
  font-weight: 600;
  font-size: 0.9rem;
}

input, select {
  width: 100%;
  padding: 0.45rem;
  margin-top: 0.25rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.static-field {
  width: 100%;
  padding: 0.45rem;
  margin-top: 0.25rem;
  background: var(--mndot-gray-100);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  box-sizing: border-box;
}

.hint {
  font-size: 0.9rem;
  color: var(--mndot-gray-700);
}

.autocomplete-container {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-top: none;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-item {
  padding: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.autocomplete-item:hover {
  background: var(--mndot-gray-100);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.result-card {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
}

.result-card h3 {
  margin-top: 0;
  color: var(--mndot-blue);
}

.total {
  font-size: 1.5rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th, td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: left;
}

th {
  background: var(--mndot-gray-100);
}

/* Tooltip styling */
.tooltip-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: top;
  cursor: pointer;
}

.tooltip-icon img {
  width: 100%;
  height: 100%;
}

.tooltip-text {
  visibility: hidden;
  width: 260px;
  background-color: #003366;
  color: #ffffff;
  text-align: left;
  padding: 8px;
  border-radius: 4px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  font-size: 0.85em;
  line-height: 1.3em;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: pre-line;
}

.tooltip-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Mobile tooltip styling */
@media (max-width: 600px) {
  .tooltip-text {
    position: fixed;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;

    top: 20%;
    bottom: auto;
    transform: none;
  }
}


/* FAQ Section Styles */
.faq-item {
  margin-bottom: 1.5rem;
}

.faq-question {
  font-weight: bold;
  color: var(--mndot-blue);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.faq-answer {
  color: var(--mndot-gray-900);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Reports page styles */
.report-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.report-section {
  margin-bottom: 30px;
}

.report-section h2 {
  color: var(--mndot-blue);
  border-bottom: 2px solid var(--mndot-blue);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-weight: 600;
  color: #333;
}

.form-group input[type="file"],
.form-group input[type="date"] {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 14px;
  font-family: inherit;
}

.date-range {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.date-range .form-group {
  flex: 1;
  min-width: 150px;
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.report-filter-group {
  margin-bottom: 10px;
}

.report-filter-section {
  display: none;
}

.report-filter-section.is-open {
  display: flex;
}

button {
  padding: 12px 24px;
  font-size: 14px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-process {
  background-color: var(--mndot-blue);
  color: white;
}

.btn-process:hover {
  background-color: #003f87;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-process:disabled {
  background-color: var(--mndot-gray-light);
  cursor: not-allowed;
}

.btn-download {
  background-color: #28a745;
  color: white;
}

.btn-download:hover {
  background-color: #218838;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-download:disabled {
  background-color: var(--mndot-gray-light);
  cursor: not-allowed;
}

.status-message {
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  display: none;
}

.status-message.show {
  display: block;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.results-table th,
.results-table td {
  padding: 12px;
  text-align: right;
  border: 1px solid var(--border-color);
}

.results-table th {
  background-color: var(--mndot-blue);
  color: white;
  font-weight: 600;
}

.results-table td:first-child,
.results-table th:first-child {
  text-align: left;
}

.results-table tr:nth-child(even) {
  background-color: var(--mndot-gray-lighter);
}

.results-table tr:hover {
  background-color: #e8f0f7;
}

.results-table__totals {
  font-weight: bold;
}

.results-table__totals-cell {
  font-weight: bold;
  background-color: #f0f0f0;
}

.results-table--detailed {
  margin-bottom: 20px;
}

.loading {
  text-align: center;
  padding: 20px;
  color: var(--mndot-blue);
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--mndot-gray-light);
  border-top-color: var(--mndot-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.report-errors {
  margin-top: 20px;
  padding: 15px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--border-radius);
}

.report-errors__title {
  margin-top: 0;
  color: #856404;
}

.report-errors__list {
  margin-bottom: 0;
}

.report-errors__item {
  color: #856404;
}

.report-details {
  margin-top: 40px;
}

.report-details__title {
  color: var(--mndot-blue);
  border-bottom: 2px solid var(--mndot-blue);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.report-details__toggle {
  margin-bottom: 15px;
}

.report-details__table {
  display: none;
}

.report-details__table.is-open {
  display: block;
}

.is-hidden {
  display: none;
}

@media (max-width: 768px) {
  .report-container {
    padding: 15px;
  }

  .date-range {
    flex-direction: column;
  }

  .date-range .form-group {
    min-width: 100%;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .results-table {
    font-size: 12px;
  }

  .results-table th,
  .results-table td {
    padding: 8px;
  }
}

.faq-answer p {
  margin: 0 0 0.5rem 0;
}

.faq-answer ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.faq-answer li {
  margin-bottom: 0.4rem;
}

