/* Simple and refined styling for VALORANT KPI tool */
:root {
  --heading-font-size: 1.75rem;
  --color-physical: #ffd1d1;
  --color-alert: #ffe8cc;
  --color-thinking: #d6f5d6;
  --color-teamplay: #e6d5ff;
  --color-judgement: #fff9cc;
  --color-study: #d6f0ff;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0 20px var(--footer-height, 150px);
  background-color: #f5f7fa;
  color: #333;
}

h1 {
  text-align: center;
  font-weight: 350;
  margin: 20px 0 10px;
  font-size: var(--heading-font-size);
}

.subtitle {
  text-align: center;
}

.github-link {
  text-align: center;
}

.github-link .github-logo {
  width: var(--heading-font-size);
  height: var(--heading-font-size);
}

#kpi-container {
  width: 95%;
  margin: 0 auto;
}

@media (min-width: 1800px) {
  #kpi-container {
    width: 55%;
  }
}

#json-drop-area {
  width: 12vw;
  height: 6vw;
  min-width: 150px;
  padding: 20px 10px;
  border: 2px dashed #bbb;
  text-align: center;
  color: #666;
  background-color: #fafafa;
  font-size: 1.25vw;
}

#json-drop-area.dragover {
  border-color: #333;
  background-color: #f0f0f0;
}

#selection-container {
  width: 95%;
  margin: 0 auto 20px;
}

.selection-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.selection-button {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #000;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.selection-button.selected {
  border-color: #ff7777;
}

.map-label {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 10%;
  background-color: #000;
  color: #fff;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.map-button {
    width: 120px;
    height: 120px;
    font-size: 2rem;
    border-radius: 6% / 6%;
}

.agent-button {
    width: 60px;
    height: 60px;
    font-size: 1rem;
    border-radius: 12% / 12%;
    background-color: #999;
}

.selection-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.selection-button.selected img {
    filter: none;
    background-color: #fff1f1;
}

#average-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  padding: 8px 10px;
  border-top: 1px solid #ccc;
  z-index: 1000;
  font-size: var(--heading-font-size);
  display: flex;
  align-items: center;
  justify-content: center;
}
#controls-container {
  position: absolute;
  right: 0;
  top: 10%;
  margin-right: 3%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
/* mode switch positioned via controls-container */
#mode-switch {}

#file-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch input {
  display: none;
}

#complexity-switch-container {
  display: flex;
  justify-content: center;
  margin: 0 0 20px;
}

#complexity-switch {
  display: inline-flex;
}

.toggle-label {
  display: flex;
  align-items: center;
  background-color: #ccc;
  border-radius: 16px;
  cursor: pointer;
  position: relative;
  width: 150px;
  height: 32px;
  font-size: 0.9rem;
}

#complexity-switch .toggle-label {
  width: 225px;
  height: 48px;
  border-radius: 24px;
  font-size: 1.25rem;
}

.toggle-label span {
  flex: 1;
  text-align: center;
  z-index: 1;
}

.toggle-label::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 4px);
  height: calc(100% - 4px);
  background: #fff;
  border-radius: 14px;
  transition: transform 0.2s, background-color 0.2s;
}

#complexity-toggle + .toggle-label::after {
  border-radius: 21px;
  background: #fff9d6;
}

#mode-toggle:checked + .toggle-label::after {
  transform: translateX(100%);
}

#complexity-toggle:checked + .toggle-label::after {
  transform: translateX(100%);
  background: #ffe7e7;
}

#complexity-toggle:not(:checked) + .toggle-label::after {
  background: #fff9d6;
}

#mode-toggle:checked + .toggle-label .toggle-grading {
  color: #666;
}

#mode-toggle:checked + .toggle-label .toggle-stats {
  color: #000;
}

#mode-toggle:not(:checked) + .toggle-label .toggle-grading {
  color: #000;
}

#mode-toggle:not(:checked) + .toggle-label .toggle-stats {
  color: #666;
}

#complexity-toggle:checked + .toggle-label .toggle-simple {
  color: #666;
}

#complexity-toggle:checked + .toggle-label .toggle-advanced {
  color: #000;
}

#complexity-toggle:not(:checked) + .toggle-label .toggle-simple {
  color: #000;
}

#complexity-toggle:not(:checked) + .toggle-label .toggle-advanced {
  color: #666;
}

.toggle-switch input:disabled + .toggle-label {
  opacity: 0.5;
  cursor: not-allowed;
}

#chart-score-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

#radar-chart {
  /* Wider aspect ratio (3:2) so horizontal labels aren't cut off */
  width: clamp(225px, 33vw, 330px);
  height: clamp(150px, 22vw, 220px);
  margin: 0;
}

#score-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#attribute-averages {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, auto);
  column-gap: 12px;
  row-gap: 2px;
  font-size: 1rem;
  margin-top: 4px;
}

.attribute-average {
  display: flex;
  align-items: center;
  white-space: nowrap;
  padding: 2px 4px;
  border-radius: 4px;
}

.attribute-average.physical {
  background-color: var(--color-physical);
}

.attribute-average.alert {
  background-color: var(--color-alert);
}

.attribute-average.thinking {
  background-color: var(--color-thinking);
}

.attribute-average.teamplay {
  background-color: var(--color-teamplay);
}

.attribute-average.judgement {
  background-color: var(--color-judgement);
}

.attribute-average.study {
  background-color: var(--color-study);
}

.attribute-label {
  width: 6em;
}

#export-btn {
  padding: 6px 12px;
  font-size: 1rem;
}

#export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.section-heading {
  margin-top: 20px;
  text-align: left;
}

.subsection-heading {
  margin-top: 15px;
  text-align: left;
}

.divider {
  border: none;
  border-bottom: 1px solid #ccc;
  margin: 20px 0;
}

.kpi-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  padding: 4px 8px;
  border-radius: 1% / 7%;
  background-color: #f1f2fb;
}

.kpi-item.kpi-item-skipped {
  background-color: #d9dbe2;
  color: #777;
}

.kpi-item.kpi-item-skipped .attribute-tag,
.kpi-item.kpi-item-skipped .item-note {
  opacity: 0.6;
}

.kpi-item.kpi-item-skipped .star {
  color: #bbb;
}

.kpi-item.kpi-item-skipped .star.selected {
  color: #c7c7c7;
}

.kpi-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.item-note {
  color: #666;
  font-size: 0.85em;
  margin-top: 2px;
}

.item-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.attribute-tag {
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.75em;
}

.skip-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content:center;
  align-self: center;
  padding-bottom: 0.75em;
  transform: translateY(calc(0.75em / 2));
  gap: 2px;
}

.skip-label {
  position: absolute;
  bottom: 0;
  font-size: 0.5em;
  text-align: center;
}

.star-rating {
  display: flex;
  gap: 4px;
  align-self: center;
}

.simple-rating {
  display: flex;
  gap: 12px;
  align-self: center;
}

.simple-rating-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease;
}

.simple-rating-option:hover .simple-rating-emoji,
.simple-rating-option:focus-visible .simple-rating-emoji {
  transform: translateY(-1px);
}

.simple-rating-option:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 4px;
  border-radius: 12px;
}

.simple-rating-emoji {
  font-size: clamp(1.4rem, 1.8vw, 2rem);
  line-height: 1;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
  filter: grayscale(100%);
  opacity: 0.4;
}

.simple-rating-option.selected .simple-rating-emoji {
  filter: none;
  opacity: 1;
}

.skip-container input[type="checkbox"] {
  transform: scale(1.375);
}

.star-rating.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.star {
  font-size: clamp(1.5vw, calc(1rem + 1vw), 3vw);
  cursor: pointer;
  color: #ccc;
}

.star.selected {
  color: gold;
}

.score-container {
  display: none;
  align-items: center;
  margin-left: 8px;
  gap: 6px;
}

.data-count {
  background-color: #e2e8f0;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.8em;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 0.5vw;
}

.score-number {
  font-size: 1.75em;
  line-height: 1;
}

#summary-container {
  width: 95%;
  margin: 40px auto 120px;
}

.summary-heading {
  text-align: center;
  background-color: #e2e8f0;
  padding: 8px 0;
  border-radius: 1% / 15%;
  font-size: 1.3rem;
  font-weight: 500;
  width: 98%;
}

.summary-label {
  display: block;
  margin-top: 15px;
  font-weight: 600;
}

.summary-input {
  width: 98%;
  border: 1px solid #f2f2f8;
  border-radius: 1% / 8%;
  resize: vertical;
  font-family: inherit;
  font-size: 1em;
}

#footer {
  text-align: center;
}

#footer p {
  margin: 6px 0;
}

#footer .riot-disclaimer {
  font-size: 0.75rem;
  color: #999;
}
