/* Phase 8: recent results and semantic content enhancements */
.recent-results-panel {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(0, 255, 136, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(0, 255, 136, 0.08), transparent 40%),
    linear-gradient(145deg, rgba(47, 55, 174, 0.28), rgba(10, 16, 42, 0.94));
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.recent-results-panel h2 {
  margin: 0 0 14px;
  color: #00ff88;
  font-size: 22px;
  line-height: 1.25;
}

.recent-results-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.recent-summary-item {
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.recent-summary-label {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

.recent-summary-value {
  display: block;
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.recent-results-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-attempt {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.88);
}

.recent-attempt-number {
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.recent-attempt-detail {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.recent-attempt-score {
  color: #00ff88;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.recent-results-empty {
  margin: 0;
  padding: 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  line-height: 1.45;
}

.recent-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.recent-results-actions button {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid rgba(0, 255, 136, 0.35);
  border-radius: 10px;
  background: rgba(0, 255, 136, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.recent-results-actions button:hover,
.recent-results-actions button:focus-visible {
  border-color: rgba(0, 255, 136, 0.72);
  background: rgba(0, 255, 136, 0.14);
  outline: none;
}

.recent-results-actions .danger-action {
  border-color: rgba(255, 110, 110, 0.32);
  background: rgba(255, 80, 80, 0.07);
}

.recent-results-formula {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.semantic-formula {
  margin: 14px 0;
  padding: 13px 15px;
  border-left: 3px solid #00ff88;
  border-radius: 8px;
  background: rgba(0, 255, 136, 0.07);
  color: #ffffff;
  font-weight: 750;
  line-height: 1.5;
}

.semantic-related {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.semantic-related h3 {
  margin-top: 0 !important;
}

.content-section .content-block a {
  color: #64ffb2;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content-section .content-block a:hover,
.content-section .content-block a:focus-visible {
  color: #ffffff;
}

@media (max-width: 620px) {
  .recent-results-summary {
    grid-template-columns: 1fr;
  }

  .recent-attempt {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .recent-attempt-score {
    grid-column: 2;
    justify-self: start;
  }

  .recent-results-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .recent-results-actions button {
    width: 100%;
  }
}
