/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: #121212;
  color: white;
  padding: 20px;
}

/* Profile Container */
.profile-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Profile Image */
.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  margin-right: 20px;
}

/* User Info */
.info {
  margin-top: 10px;
}

.info h3 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #00fa9a;
}

.info p {
  font-size: 14px;
  color: #cccccc;
  margin-bottom: 5px;
}

/* Input Fields */
.input-field {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  background-color: #1e1e1e;
  border: 1px solid #333;
  border-radius: 5px;
  color: white;
}

/* Buttons */
.button {
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  margin-top: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* Save Button */
.save-button {
  background-color: #00fa9a;
  color: black;
}

.save-button:hover {
  background-color: white;
}

/* Back Button */
.back-button {
  background-color: #333;
  color: white;
}

.back-button:hover {
  background-color: #555;
}

/* Delete Button */
.delete-button {
  background-color: #ff4d4d;
  color: white;
}

.delete-button:hover {
  background-color: #ff1a1a;
}

/* Page Title (Match Index/Teams Look) */
.page-title {
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: white;
  text-shadow: 0 0 10px rgba(0, 250, 154, 0.4);
  margin: 6px 0 8px;
  text-align: center;
}

.page-title::after {
  content: "";
  display: block;
  height: 3px;
  width: 84px;
  margin: 10px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, white, rgba(0, 250, 154, 0));
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .page-title {
    font-size: clamp(1.9rem, 6vw, 2.4rem);
    margin: 4px 0 6px;
  }
  .page-title::after {
    width: 64px;
    height: 2px;
    margin-top: 6px;
  }
}

/* ADDED: Ghost button variant (matches your site style) */
.button.ghost {
  background-color: transparent;
  color: #00fa9a;
  border: 2px solid #00fa9a;
  border-radius: 8px;
  box-shadow: 0 0 12px #00fa9a33;
}
.button.ghost:hover {
  background-color: #00fa9a;
  color: #000;
}

/* ADDED: History card and panel */
.history-card {
  margin-top: 24px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px;
}

.history-panel.hidden {
  display: none;
}

.history-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  transition: background-color 0.25s ease, transform 0.15s ease;
}
.history-item:hover {
  background-color: #333;
  transform: translateY(-1px);
}

.history-left {
  text-align: left;
}
.history-right {
  text-align: right;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.court {
  color: #00fa9a;
}

.meta {
  opacity: 0.85;
  font-size: 12px;
  margin-top: 2px;
}

.score {
  font-weight: 800;
  letter-spacing: 0.04em;
}
.elo {
  font-size: 12px;
  opacity: 0.95;
}
.result {
  margin-top: 4px;
  display: inline-block;
  font-weight: 800;
}
.result.win {
  color: #00fa9a;
}
.result.loss {
  color: #ff6b6b;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #1e1e1e;
  border: 1px solid #333;
  color: #e0e0e0;
}

.muted {
  color: #bbb;
  margin: 10px 0 0;
}

/* =========================
   1) Page title fixes (match index/teams)
   ========================= */

/* tighten spacing + keep it inside your 980px rhythm */
.page-title {
  max-width: 980px; /* NEW: align to site width */
  margin: 20px auto 8px; /* NEW: centered + compact */
  padding: 0 16px; /* NEW: side breathing room */
  color: #00fa9a; /* CHANGED: neon like other pages */
}

/* neon accent bar like other pages */
.page-title::after {
  content: "";
  display: block;
  height: 3px;
  width: 84px;
  margin: 10px auto 0;
  border-radius: 3px;
  /* CHANGED: use neon gradient instead of white */
  background: linear-gradient(90deg, #00fa9a, rgba(0, 250, 154, 0));
}

/* mobile fine‑tuning to match your pattern */
@media (max-width: 768px) {
  .page-title {
    margin: 16px auto 6px; /* a bit tighter on small screens */
  }
  .page-title::after {
    width: 64px;
    height: 2px;
    margin-top: 6px;
  }
}

/* =========================
   2) Constrain content width consistently
   ========================= */

/* Keep these sections aligned to your 980px column, centered */
.profile-container,
.history-card,
.input-field,
.save-button,
.delete-button {
  max-width: 980px; /* NEW */
  margin-left: auto; /* NEW */
  margin-right: auto; /* NEW */
}

/* Inputs need full width inside the 980 container */
.input-field {
  width: calc(100% - 0px); /* keep full width within max */
}

/* =========================
   3) History card polish
   ========================= */

.history-card {
  margin-top: 24px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 14px;
  padding-top: 12px; /* NEW: slightly tighter */
}

/* Make the toggle act like a header bar for the card */
#toggle-history.button.ghost {
  width: 100%; /* NEW: full width header button */
  display: flex; /* NEW */
  align-items: center; /* NEW */
  justify-content: space-between; /* NEW */
  gap: 10px; /* NEW */
  padding: 10px 12px; /* NEW: compact tap target */
  box-shadow: none; /* NEW: card already has depth */
  border-radius: 8px; /* matches card corners */
}

/* Caret alignment */
#history-caret {
  line-height: 1; /* NEW */
  opacity: 0.9; /* NEW */
}

/* Separate the toggle from the list content a bit */
.history-panel {
  margin-top: 10px; /* NEW */
}

/* List readability tweaks */
.history-list {
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Item spacing & balance */
.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 10px 12px;
  transition: background-color 0.25s ease, transform 0.15s ease;
}

/* Left/right columns align on baselines better */
.history-left {
  text-align: left;
  display: grid; /* NEW */
  gap: 2px; /* NEW */
}
.history-right {
  text-align: right;
  display: grid; /* NEW */
  gap: 2px; /* NEW */
}

/* Title row inside the left side */
.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2; /* NEW: reduce vertical wobble */
}
.court {
  color: #00fa9a;
}

.meta {
  opacity: 0.85;
  font-size: 12px;
  margin-top: 0; /* NEW: we used grid gap instead */
}

/* Right column emphasis */
.score {
  font-weight: 800;
  letter-spacing: 0.04em;
}
.elo {
  font-size: 12px;
  opacity: 0.95;
}
.result {
  display: inline-block;
  font-weight: 800;
  margin-top: 2px; /* NEW: slightly tighter */
}
.result.win {
  color: #00fa9a;
}
.result.loss {
  color: #ff6b6b;
}

/* Small tag */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #1e1e1e;
  border: 1px solid #333;
  color: #e0e0e0;
}

/* Empty state spacing */
.muted {
  color: #bbb;
  margin: 6px 0 0; /* NEW: tighter */
}

/* Mobile: stack item cleanly */
@media (max-width: 768px) {
  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .history-right {
    text-align: left;
  }
}
