/* Base styles are inherited from application.scss */

.building-page-container {
  margin: 0 auto;
  max-width: 1200px;
  padding: 180px 20px 50px 20px;
}

header {
  margin-bottom: 40px;
}

header h1 {
  margin: 0;
  font-size: 36px;
}

header h2 {
  margin: 0;
  font-weight: 300;
  font-size: 24px;
}

main.building-report {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
}

.building-report__content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  transition: filter 0.3s ease;
}

.building-report--locked .building-report__content {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.building-report__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  padding-top: 400px;
  z-index: 2;
  pointer-events: none;
}

.building-report__overlay-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: 32px;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}

.building-report__overlay-card h3 {
  margin-top: 0;
  font-size: 28px;
  margin-bottom: 12px;
}

.building-report__overlay-card p {
  margin-bottom: 24px;
  color: #4b5563;
  font-size: 16px;
}

.building-report__cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.building-report__cta-note {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

section {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  padding: 24px;
}

section h3 {
  margin-top: 0;
  font-size: 24px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table th,
.info-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #e6e6e6;
}

.info-table th {
  font-weight: bold;
  width: 15%;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 24px;
}

.score {
  font-size: 36px;
  font-weight: bold;
  text-wrap: nowrap;
  padding: 16px 24px;
  border-radius: 8px;
}

.score-a {
  background-color: #e6f4ea;
  color: #137333;
}
.score-b {
  background-color: #e8f0fe;
  color: #1967d2;
}
.score-c {
  background-color: #fef7e0;
  color: #b06000;
}
.score-d {
  background-color: #fce8e6;
  color: #c5221f;
}
.score-f {
  background-color: #fce8e6;
  color: #a50e0e;
}

.score-explanation {
  font-size: 18px;
}

.complaints-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.complaints-table th,
.complaints-table td {
  text-align: left;
  padding: 4px;
  border-bottom: 1px solid #e6e6e6;
}

.complaints-table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}

.details-toggle {
  display: inline-block;

  background-color: #007bff;
  color: white;

  border: none;
  padding: 5px 10px;
  border-radius: 4px;

  cursor: pointer;

  text-align: center;
}

.details-toggle summary {
  font-size: 13px;
}

/* Footer styles moved to layout/_footer.scss for consistency */

.details-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.details-table th,
.details-table td {
  text-align: left;
  border: 1px solid #e6e6e6;
}

.details-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  width: 20%;
}

.complaint-details {
  display: none;
}

tbody tr:has(details[open]) + .complaint-details {
  display: table-row;
}

.complaint-details td {
  background-color: #fff;
  padding: 8px;
}

.building-not-found section {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.building-not-found h2 {
  color: #c5221f;
  margin-top: 0;
}

.building-not-found ul {
  margin-bottom: 20px;
}

.building-not-found a {
  color: #007bff;
  text-decoration: none;
}

.building-not-found a:hover {
  text-decoration: underline;
}

.complaint-tally {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  padding: 24px;
}

.complaint-tally h3 {
  margin-top: 0;
  font-size: 24px;
}

.complaint-tally__list {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.complaint-tally__item {
  margin-top: 12px;
  padding: 8px 0;
}

.complaint-tally__item:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
}

.complaint-tally__item--visible .problem-code {
  font-weight: bold;
}

.complaint-tally__item--obscured {
  opacity: 0.6;
}

.complaint-tally__item--obscured .problem-code {
  font-weight: bold;
  color: #ccc;
  background: linear-gradient(90deg, #e0e0e0 0%, #d0d0d0 50%, #e0e0e0 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
}

.complaint-tally .problem-code {
  font-weight: bold;
}

.complaint-tally .complaint-count {
  color: #666;
  margin-left: 5px;
}

.complaint-tally .latest-date {
  display: block;
  font-size: 0.9em;
  color: #888;
  margin-top: 4px;
}

@media (max-width: 1024px) {
  .building-page-container {
    padding: 120px 16px 50px 16px;
  }

  .score-display {
    flex-direction: column;
    align-items: flex-start;
  }

  .complaints-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background:
      linear-gradient(to right, white 30%, rgba(255,255,255,0)),
      linear-gradient(to left, white 30%, rgba(255,255,255,0)),
      radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.2), rgba(0,0,0,0)),
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.2), rgba(0,0,0,0));
    background-position: 0 0, 100% 0, 0 0, 100% 0;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
  }

  .complaints-table-wrapper::-webkit-scrollbar {
    height: 12px;
  }

  .complaints-table-wrapper::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 6px;
  }

  .complaints-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 6px;
    border: 2px solid #f7fafc;
  }

  .complaints-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
  }

  .complaints-table {
    font-size: 14px;
    min-width: 800px;
    table-layout: auto;
  }

  .complaints-table th,
  .complaints-table td {
    white-space: nowrap;
    padding: 8px;
  }

  .complaints-table th:nth-child(4),
  .complaints-table td:nth-child(4) {
    white-space: normal;
    min-width: 200px;
    max-width: 300px;
  }
}
