/* Rating breakdown and achievement components */
.achievement-label {
  display: block;
  font-weight: 500;
  color: #282828;
  margin-bottom: 2px;
}

.achievement-points {
  display: block;
  font-size: 13px;
  color: #e0e0e0;
  font-weight: 600;
}

.rating-formula {
  display: block;
  font-size: 11px;
  color: #dbe0e5;
  font-weight: normal;
  margin-top: 2px;
  opacity: 0.8;
}

.rating-breakdown {
  border: none;
  margin: 0;
  padding: 0;
}

.rating-breakdown-summary {
  cursor: pointer;
  color: #00a6ff;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  padding: 4px 0;
}

.rating-breakdown-summary::-webkit-details-marker {
  display: none;
}

.rating-breakdown-summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.2s ease;
}

.rating-breakdown[open] .rating-breakdown-summary::before {
  transform: rotate(90deg);
}

.rating-breakdown-body {
  margin-top: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid skyblue;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #333;
  overflow: hidden;
}

/* Achievement table inside details */
.achievement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: 0;
}

.achievement-table thead {
  background: rgba(0, 166, 255, 0.15);
}

.achievement-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #0077b6;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(0, 166, 255, 0.3);
}

.achievement-table th:last-child,
.achievement-table td:last-child {
  text-align: right;
}

.achievement-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(135, 206, 235, 0.25);
  vertical-align: top;
}

.achievement-table tbody tr:last-child td {
  border-bottom: none;
}

.achievement-table tbody tr:hover {
  background: rgba(0, 166, 255, 0.08);
}

.achievement-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.25);
}

.achievement-table tbody tr:nth-child(even):hover {
  background: rgba(0, 166, 255, 0.08);
}

/* Table columns */
.achievement-table__award {
  width: 45%;
  font-weight: 500;
  color: #282828;
}

.achievement-table__formula {
  width: 30%;
  font-size: 12px;
  color: #555;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 12px;
}

.achievement-table__points {
  width: 25%;
  font-weight: 700;
  color: #f3f3f3;
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .achievement-table {
    font-size: 12px;
  }
  
  .achievement-table th,
  .achievement-table td {
    padding: 8px 6px;
  }
  
  .achievement-table__award {
    width: 50%;
  }
  
  .achievement-table__formula {
    width: 25%;
    font-size: 11px;
  }
  
  .achievement-table__points {
    width: 25%;
  }
}

/* Header tooltip for rating calculation */
.header-with-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 13px;
  font-weight: bold;
  color: #00a6ff;
  background: rgba(0, 166, 255, 0.1);
  border: 1px solid rgba(0, 166, 255, 0.3);
  border-radius: 50%;
  cursor: help;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tooltip-icon:hover {
  background: rgba(0, 166, 255, 0.2);
  border-color: #00a6ff;
}

.tooltip-content {
  position: absolute;
  top: 100%;
  right: -10px;
  z-index: 1000;
  width: 380px;
  max-width: 90vw;
  margin-top: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  pointer-events: none;
}

.header-with-tooltip:hover .tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.tooltip-body {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid skyblue;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

.tooltip-intro {
  margin: 0 0 12px;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(135, 206, 235, 0.4);
  font-size: 13px;
  color: #282828;
}

.tooltip-intro strong {
  color: #0077b6;
}

.tooltip-body h5 {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #00a6ff;
}

.tooltip-body h5:first-child {
  margin-top: 0;
}

.tooltip-list {
  margin: 6px 0;
  padding-left: 1.3em;
  list-style: disc;
}

.tooltip-list li {
  margin-bottom: 4px;
  color: #333;
}

.tooltip-list strong {
  color: #0077b6;
}

.tooltip-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}

.tooltip-table th,
.tooltip-table td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid rgba(135, 206, 235, 0.3);
}

.tooltip-table th {
  background: rgba(0, 166, 255, 0.15);
  color: #0077b6;
  font-weight: 600;
  text-align: left;
}

.tooltip-table th:first-child {
  text-align: left;
}

.tooltip-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: #282828;
}

.tooltip-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.4);
}

.tooltip-table tr:hover {
  background: rgba(0, 166, 255, 0.08);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .tooltip-content {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: calc(100% - 40px);
    max-width: none;
    max-height: 80vh;
    overflow-y: auto;
    margin-top: 0;
  }
  
  .header-with-tooltip:hover .tooltip-content {
    transform: translate(-50%, -50%);
  }
  
  .tooltip-body {
    font-size: 13px;
  }
  
  .tooltip-table {
    font-size: 12px;
  }
  
  .tooltip-table th,
  .tooltip-table td {
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  .tooltip-content {
    width: calc(100% - 30px);
  }
  
  .tooltip-body {
    padding: 12px;
  }
  
  .tooltip-table th,
  .tooltip-table td {
    padding: 5px 6px;
    font-size: 11px;
  }
}

.rating-ach-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rating-ach-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.rating-ach-item:last-child {
  margin-bottom: 0;
}

.rating-ach-icons {
  flex-shrink: 0;
}

.rating-ach-icons img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  object-fit: contain;
}

.rating-ach-meta {
  font-size: 13px;
  font-weight: normal;
  line-height: 1.35;
  color: #282828;
}

.rating-formula {
  opacity: 0.75;
  font-size: 12px;
  margin-left: 4px;
}

.rating-empty {
  opacity: 0.5;
}

/* Tandem badge */
.tandem-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  color: #00a6ff;
  border: 1px solid rgba(0, 166, 255, 0.45);
  background: rgba(0, 166, 255, 0.1);
  vertical-align: middle;
}

.league-table .table-row:nth-child(-n+10) .manager-cell .tandem-badge {
  -webkit-text-fill-color: #00a6ff;
  background-clip: border-box;
  -webkit-background-clip: border-box;
}
