/* Admin YouTube Stats Styles */
.ytstats-admin .card {
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}

.ytstats-admin .ytstats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
}

.ytstats-admin .ytstats-tabs a {
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: inherit;
  text-decoration: none;
}

.ytstats-admin .ytstats-tabs a.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}

.ytstats-admin .card-header {
  background-color: var(--primary);
  color: var(--primary-text);
  padding: 15px;
  border-radius: 8px 8px 0 0;
}

.ytstats-admin .card-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.ytstats-admin .card-body {
  padding: 15px;
  overflow-x: auto;
}

.ytstats-admin table {
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.ytstats-admin th,
.ytstats-admin td {
  border: 1px solid #ddd;
  padding: 4px 8px;
  text-align: left;
  vertical-align: top;
}

.ytstats-admin .empty {
  color: #777;
  font-style: italic;
}

.ytstats-admin .failed,
.ytstats-admin .outcome-failed {
  color: #b00020;
}

.ytstats-admin .outcome-partial {
  color: #8a6d00;
}

.ytstats-admin .note {
  color: #555;
  max-width: 60rem;
  font-size: 0.9rem;
}

.ytstats-admin .ytstats-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-bottom: 10px;
}

.ytstats-admin .ytstats-controls select {
  margin-left: 6px;
  max-width: 16rem;
}

.ytstats-admin .ytstats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 8px;
}

.ytstats-admin .ytstats-legend-item,
.ytstats-admin .ytstats-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  padding: 2px 8px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.ytstats-admin .ytstats-key {
  cursor: default;
  border: none;
}

.ytstats-admin .ytstats-legend-item.accent {
  font-weight: bold;
}

.ytstats-admin .ytstats-legend-item.off {
  opacity: 0.45;
  text-decoration: line-through;
}

.ytstats-admin .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.ytstats-admin .ytstats-svg {
  display: block;
  max-width: 100%;
  height: auto;
  background: #fff;
}

.ytstats-admin .ytstats-svg text {
  fill: #333;
}

.ytstats-admin .ytstats-figure {
  margin-bottom: 10px;
}

.ytstats-admin .ytstats-figure .value {
  font-size: 2rem;
  font-weight: bold;
  margin-right: 10px;
}

.ytstats-admin .ytstats-figure .label {
  color: #555;
}

.ytstats-admin #ytstats-status td:nth-child(2) {
  white-space: nowrap;
}

.ytstats-admin .ytstats-rank {
  font-size: 0.8rem;
  white-space: nowrap;
}

.ytstats-admin .ytstats-rank th {
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  background: #f3f3f3;
  color: #222;
}

.ytstats-admin .ytstats-rank .num {
  text-align: right;
}

.ytstats-admin .ytstats-rank tr.ours td {
  background: #fde8dc;
  color: #222;
  font-weight: bold;
}

.ytstats-admin .ytstats-settings {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ytstats-admin .ytstats-settings input[type="number"] {
  display: block;
  width: 8rem;
  margin-top: 4px;
}

.ytstats-admin .ytstats-ranking {
  max-height: 70vh;
  overflow: auto;
  margin-bottom: 10px;
}

.ytstats-admin .ytstats-ranking table {
  margin-bottom: 0;
}

.ytstats-admin form.ytstats-controls label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.ytstats-admin .ytstats-channel-input {
  width: 26rem;
  max-width: 100%;
  min-width: 0;
}

.ytstats-admin .ytstats-channel-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  max-width: 40rem;
}

.ytstats-admin .ytstats-channel-list {
  max-height: 50vh;
  overflow: auto;
  margin-bottom: 10px;
}

.ytstats-admin .ytstats-channel-list .num {
  text-align: right;
}

.ytstats-admin .ytstats-channel-list td:nth-child(3),
.ytstats-admin .ytstats-channel-list .actions {
  white-space: nowrap;
}

.ytstats-admin .ytstats-channel-list tr.ours td {
  background: #fde8dc;
  color: #222;
}

.ytstats-admin form.ytstats-controls {
  flex-direction: row;
  align-items: center;
}

.ytstats-admin form.ytstats-controls > * {
  align-self: auto;
  margin: 0;
}

.ytstats-admin .ytstats-channel-filter {
  margin-left: 6px;
  width: 16rem;
  max-width: 100%;
}

/* A hovered channel (HAR-60): the others dimmed, its line thicker, its legend entry emphasised. */
.ytstats-admin .ytstats-hovering .ytstats-series {
  opacity: 0.2;
}

.ytstats-admin .ytstats-hovering .ytstats-series.hover {
  opacity: 1;
}

.ytstats-admin .ytstats-series.hover .ytstats-line {
  stroke-width: 4;
}

/* Its name at the end of its line (HAR-62), so the chart names it without the legend in view. */
.ytstats-admin .ytstats-series.hover .ytstats-end-label {
  visibility: visible;
}

.ytstats-admin .ytstats-legend-item.hover {
  font-weight: bold;
  border-color: #333;
  background: #f0f0f0;
}
