/* Report Styles */

.report-header {
  margin: -2rem;
  padding: 2rem;
  display: flex;
  justify-content: space-between;

  .report-title {
    float: left;
    width: 70%;

    .report-title-title {
      font-size: 1rem;
      margin: 0;
    }

    .report-title-subject {
      color: var(--text-color);
      font-size: 2rem;
      font-weight: 400;
      line-height: 1;
      word-wrap: break-word;
    }

    .report-title-about {
      font-size: 0.9em;
      color: #999;
    }
  }

  .stats {
    width: 30%;
    text-align: right;
    font-size: 0.9em;
    float: right;
    color: #999;
  }

  .print-preview-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--lightblue);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;

    svg {
      flex-shrink: 0;
    }

    &:hover {
      color: var(--darkblue);
      text-decoration: underline;
    }
  }
}

.tabs-bar {
  margin-top: 1rem;
  margin-bottom: 2rem;

  ul {
    display: flex;
    margin: 0 -12rem;
    padding: 0 12rem;
    border-bottom: 1px solid #dedede;

    li {
      position: relative;
      float: left;
      width: 25%;
      margin: 0 1% -1px;
      overflow: hidden;
      text-overflow: ellipsis;

      a {
        border-radius: 4px 4px 0 0;
        background: #eee;
        border: 1px solid #dedede;
        color: #7b7b7b;
        display: block;
        font-size: 12px;
        font-weight: 700;
        padding: 5px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;

        &.active {
          background: #f6f6f6;
          border-bottom-color: #f6f6f6;
          color: #484848;
          box-shadow: none;
        }
      }
    }
  }
}

.report-frequency-table {
  .competence-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;

    h3 {
      width: 60%;
    }

    .ratings-legend {
      display: flex;
      justify-content: space-between;
      gap: 1rem;
      width: 40%;
    }

    .rating-legend-item {
      display: flex;
      font-weight: bold;
      gap: 0.5rem;
      justify-content: center;
      width: 40%;
    }
  }

  .competence {
    margin-block: 1.75rem;
  }

  .legend {
    margin: 0.25rem 0 1rem;
    font-size: 0.9rem;
    color: #666;
  }

  .kb {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-top: 1px solid #eee;
  }

  .kb-text {
    color: var(--metatext-color);
    font-size: 0.775rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
    width: 60%;
  }

  /* 5 fixed “slots” so rows align perfectly */
  .kb-scale {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    width: 40%;
  }

  .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    line-height: 1;
    height: 1.6rem;
    background: #fff;
    justify-content: center;
    width: 100%;
  }

  .pill-score {
    display: inline-block;
    width: 1.25rem;
    text-align: center;
    font-weight: 600;
    width: auto;
  }

  .pill-count {
    display: inline-block;
    width: 1.25rem;
    text-align: center;
    border-radius: 999px;
    padding: 0.1rem 0.35rem;
    background: #f3f3f3;
    font-variant-numeric: tabular-nums;
    width: auto;
  }

  .pill:hover {
    border-color: #ccc;
    background: #fafafa;
  }

  .pill-count.is-empty {
    opacity: 0;
  }

  .pill-count:where(:not(:empty)) {
    opacity: 0.95;
  }

  .pill.is-max .pill-count {
    background: #e9eefc;
    border: 1px solid #d6def8;
  }
}

#report_tab {
  display: block;
  margin: 0 auto;
  max-width: 700px;
}

.bar-charts-overview,
.competence-bar-chart {
  margin-bottom: 2rem;

  .overview {
    padding: 0 1rem;
  }

  .bar-charts-overview-header,
  .bar-charts-competence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f2f2f2;
    padding: 0.5rem 0.75rem;
  }

  .bar-charts-competence-header {
    margin-bottom: 1rem;
  }

  .legend {
    font-size: 0.9rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .legend .dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    display: inline-block;
    border: 2px solid var(--gold);
    background: #fff3d6;
  }

  .chart {
    margin: 0;
  }

  .labels {
    list-style: none;
    padding-left: 1.2rem;
    margin: 0.75rem 0 0;
  }

  .labels li {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .labels .letter {
    color: var(--gold);
    font-weight: 600;
    margin-right: 0.35rem;
    margin-right: 0.35rem;
  }

  svg {
    width: 100%;
  }

  svg .bar {
    fill: #fff7e0;
    stroke: var(--gold);
    stroke-width: 1.25;
  }

  svg .bar--empty {
    fill: #fafafa;
    stroke: #e6e6e6;
    stroke-dasharray: 3 2;
  }

  svg .bar-self {
    fill: #6b7fb3;
    opacity: 0.4;
    stroke: #142658;
    stroke-width: 1.25;
  }

  .legend .dot.self {
    border-color: #6b7fb3;
    background: #e7ecf8;
  }
}

/* Comments Styles  */

.comments-competence-title:has(+ .comment-label) {
  margin-bottom: 0;
}

.comment-label {
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 1rem;
  display: block;
}

.competence-comments {
  margin-bottom: 2rem;

  .comment {
    --assessor-color: var(--darkgray);
    background: var(--boringgray);
    padding: 0.5rem;
    border: 1px solid var(--darkgray);
    border-left: 0.5rem solid var(--assessor-color);
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 0.5rem;
  }

  .no-comment {
    color: var(--metatext-color);
    font-size: 0.875rem;
    line-height: 1.45;
    font-style: italic;
  }
}

/* Spider Charts Styles */

.spider-overview {
  .spider-header {
    align-items: center;
    background: #f2f2f2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;

    h3 {
      margin-bottom: 0;
      margin-top: 0;
    }

    &:has(a) h3 {
      width: 100%;
    }

    a {
      color: var(--lightblue);
      font-size: 0.875rem;
      font-weight: 600;
    }
  }

  .legend {
    align-items: center;
    color: #444;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .legend-item {
    align-items: center;
    display: flex;
    cursor: pointer;
    gap: 0.5rem;
    user-select: none;
    transition: opacity 0.2s;
  }

  .legend-item.inactive {
    opacity: 0.4;
  }

  .legend .dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
  }

  .legend .dot.other {
    border: 2px solid var(--gold);
    background: #fff3d6;
  }

  .legend .dot.assessor {
    border: 2px solid var(--assessor-color);
    background-color: color-mix(in srgb, var(--assessor-color) 20%, white);
  }

  .legend .dot.self {
    border: 2px solid #6b7fb3;
    background: #e7ecf8;
  }

  .legend .dot.label {
    border: 2px solid var(--label-color);
    background-color: color-mix(in srgb, var(--label-color) 20%, white);
  }

  .spider-chart {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1rem;
  }

  svg .radar-grid {
    stroke: #ddd;
  }

  svg .radar-axis {
    stroke: #ddd;
  }

  ol.axis-legend {
    columns: 2;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0;
    list-style: none;
    padding-left: 1.2rem;
    margin: 0.75rem 0 0;

    li {
      margin: 0.25rem 0;
      font-size: 0.875rem;
      line-height: 1.45;
    }

    li .letter {
      color: var(--gold);
      font-weight: 600;
      margin-right: 0.35rem;
      margin-right: 0.35rem;
    }
  }
}
