#profileContainer {
  padding: 24px;
  overflow-y: auto;
}

.profile-container {
  padding-top: 200px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.profile-column {
  min-width: 40%;
  padding-right: 70px;
}

/* The container for each label/input pair */
.profile-row {
  display: grid;
  /* Define a single column that takes up all available space. */
  /* This makes each item (label, input, error) stack vertically. */
  grid-template-columns: 1fr;

  /* Define the order of elements within the grid for each row */
  /* Label first, then input group, then error message */
  grid-template-areas:
    "label"
    "input-group"
    "error";

  gap: 0;
  /* No explicit gap between stacked items, use margins for fine-tuning */
  align-items: start;
  /* Align items to the top of their grid area */
  margin-bottom: 0px;
  /* Add more space between entire profile-rows */
  padding-bottom: 5px;
  /* Keep separation line if desired */
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row label {
  grid-area: label;
  /* Assign to the 'label' area */
  font-weight: 700;
  /* Make label text bolder as it's a heading for the field */
  font-size: 14px;
  text-transform: uppercase;
  color: #f3f3f3;
  padding-bottom: 5px;
  /* Space between label and the input field below it */
  margin-top: 5px;
  /* Add a little space from the previous row's error/content */
}

/* The container holding the input and the icon */
.profile-row-item {
  grid-area: input-group;
  display: flex;
  align-items: center;
  flex-grow: 1;

  /* 🎯 KEY: Set the positioning context */
  position: relative;

  /* Ensure nothing sticks out of the container boundary */
  overflow: hidden;
  width: 400px;
}

/* The input field */
.profile-item {
  /* width: 100%; */
  width: 100%;
  padding: 8px;
  background-color: #2a2a2ad2;
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s, background-color 0.2s;
  padding-right: 40px;
}

/* Style for disabled fields (like ID) */
.profile-item[disabled] {
  background-color: #1a1a1a;
  border-color: transparent;
  opacity: 0.4;
  cursor: default;
}

.profile-item:focus:not([disabled]) {
  border-color: #4CAF50;
  /* Highlight on focus */
  outline: none;
}

.profile-row-item #id {
  margin-bottom: 22px;
}

.edit-icon,
.save-icon {
  /* 🎯 KEY: Take the icon out of the normal flow */
  position: absolute;

  /* Position it inside the right edge of the input field */
  right: 10px;
  /* Adjust distance from the right edge */
  top: 50%;
  /* Start at half height */
  transform: translateY(-50%);
  /* Center vertically */

  height: 22px;
  /* Define icon size */
  cursor: pointer;
  z-index: 5;
  /* Ensure it is on top of the input text */

  /* Remove any margin that was pushing it away */
  margin-left: 0;
  opacity: 0.7;
  /* <--- IMPORTANT: Clear previous margin */
}

.edit-icon:hover,
.save-icon:hover {
  opacity: 1;
}

.save-icon {
  height: 28px;
  /* Example: if save icon is larger */
}

.visibility-toggle-icon {
  /* 🎯 KEY: Take the icon out of the normal flow and position it */
  position: absolute;

  /* Position it inside the right edge of the input field */
  right: 10px;
  /* Adjust distance from the right edge */
  top: 50%;
  /* Start at half height */
  transform: translateY(-50%);
  /* Center vertically */

  height: 22px;
  /* Define icon size */
  cursor: pointer;
  opacity: 0.7;
  z-index: 5;
  /* Ensure it is on top of the input text */
}

.visibility-toggle-icon:hover {
  opacity: 1;
}

.profile-save-button {
  margin-left: 272px;
  /* Give some space above the button */
  padding: 10px 20px;
  background-color: #4CAF50;
  /* Example button style */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.validation-error-message {
  grid-area: error;
  /* Assign to the 'error' area */
  color: red;
  font-size: 12px;
  margin-top: 5px;
  /* Space between the input and the error message */
  margin-bottom: 0;
  padding: 0;
  min-height: 18px;
  /* Reserve space to prevent layout shifting */
  padding-left: 0px;
}

/* ===============================
   1) GRID
   =============================== */

.trophy-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  padding: 20px auto;
  flex-direction: row;
  position: relative;
  /* padding-left: 15px; */
  padding-right: 15px;
}

/* ===============================
   2) CARD BASE
   =============================== */
.achievement-card {
  height: 420px;
  width: 380px;
  cursor: pointer;
  position: relative;
  display: flex;
  border-radius: 8px;
  color: #f0f0f0;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, 0.2);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
  flex-direction: column;
  justify-content: end;
  align-items: center;

  background-repeat: no-repeat !important;
  background-position: center 80% !important;
  background-size: contain !important;
}

.empty-message {
  position: absolute;
  top: 15px;
  /* near top edge */
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  padding: 10px 15px;
  color: #ddd;
  font-size: 0.9em;
  border-radius: 8px;
  z-index: 3;
  width: 90%;
  max-width: 220px;
}

.empty-message p:first-child {
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 3px;
}

/* ===============================
   4) TEXT / DETAILS
   =============================== */
.trophy-name {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 1.05em;
  color: #fff;
  text-align: center;
  z-index: 3;
  padding: 4px 16px;
  border-radius: 6px;

  white-space: nowrap;
  /* Prevents text from wrapping */
  max-width: 90%;
  /* Ensures it doesn't overflow the card */
  overflow: hidden;
  /* Hides excess text if too long */
  text-overflow: ellipsis;
  /* Adds "…" if text is too long */
}

.achievement-details {
  margin-top: auto;
  padding: 10px 10px 12px;
  text-align: center;
  width: 100%;
  z-index: 2;
  background: rgba(34, 34, 34, 0.8);
  border-radius: 0 0 8px 8px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.achievement-modal-content h3 {
  text-align: center;
  /* centers text horizontally */
  margin: 0 0 20px 0;
  /* spacing below the heading */
  font-size: 1.5em;
}

.achievement-details .team-logo {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  margin-bottom: 5px;
  border: 2px solid #fff;
  object-fit: cover;
}

.achievement-team {
  font-weight: 600;
  color: #3bf502;
}

.achievement-leagueName {
  font-size: 0.9em;
  color: #bbb;
}


/* ===============================
   5) GOLDEN STAR SUMMARY (multi-wins)
   =============================== */
.golden-star-summary {
  position: absolute;
  top: 10px;
  /* distance from top edge */
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  text-align: center;
  padding: 10px 20px;
  border-radius: 10px;
  z-index: 5;
  width: fit-content;
  transition: transform 0.25s, box-shadow 0.25s;
}

/* .golden-star-summary:hover {
  transform: translateX(-50%) scale(1.05);
} */

.golden-star-summary .star-icon {
  font-size: 2em;
  display: block;
  line-height: 1;
  color: gold;
  text-shadow: 0 0 15px gold;
}

.golden-star-summary .win-count {
  font-size: 1.3em;
  font-weight: 800;
  color: #ffd700;
  margin-top: 6px;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.5);
  }

  100% {
    transform: scale(1);
  }
}

/* Apply the animation when new notifications are present */
.golden-star-summary .star-icon,
.golden-star-summary .win-count {
  animation: pulse 1s infinite;
}

/* ===============================
   6) MODAL (moved OUT of mobile-only!)
   =============================== */
.achievement-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, .8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.achievement-modal-content {
  background-color: rgba(0, 0, 0, 0.8);
  padding: 30px;
  border-radius: 10px;
  max-width: 720px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #fff;
  position: relative;
  box-shadow: 0 5px 20px rgba(255, 215, 0, .2);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

.close-btn:hover {
  transform: scale(1.3);
  color: #ff4d4d;
}

.close-btn:active {
  transform: scale(1.05);
}


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

.achievement-list-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #333;
}

.achievement-list-item:last-child {
  border-bottom: none;
}

.achievement-list-item .list-team-logo {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  margin-left: 10px;
  margin-right: 3px;
  margin-bottom: 4px;
  object-fit: cover;
}

.achievement-list-item .achievement-year {
  font-weight: 700;
  color: gold;
  min-width: 45px;
}



@media (max-width: 768px) {
  .trophy-grid {
    gap: 25px;
  }
}

@media (max-width: 480px) {

  #profileContainer {
    padding: 14px;
    margin-bottom: 40px;
    overflow-y: auto;
  }

  .profile-container {
    padding-top: 170px;
    display: grid;
    gap: 8px;
  }

  .profile-column {
    flex: unset;
    /* Allow both columns to grow and fill space */
    min-width: unset;
    padding-right: unset;
  }

  .profile-column:last-child {
    flex: unset;
    /* Allow both columns to grow and fill space */
    min-width: unset;
    padding-right: unset;
    margin-top: 30px;
  }


  #passwordChangeColumn {
    /* Create the vertical line on the left side of the right column */
    border-top: 3px solid #ffffff;
    border-radius: 8px;
  }


  /* The container for each label/input pair */
  .profile-row {
    display: grid;
    justify-content: space-between;
    align-items: center;
    /* padding-top: 8px; */
    width: 100%;
  }

  .profile-row:last-child {
    border-bottom: none;
  }


  .profile-row label {
    font-size: 14px;
    text-transform: uppercase;
    color: #dfd9d9;
    flex-shrink: 0;
    padding-bottom: 8px;
    padding-top: 10px;
  }

  /* The container holding the input and the icon */
  .profile-row-item {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 200px;

    /* 🎯 KEY CHANGE 1: Set position context for the icon */
    position: relative;

    /* Ensure the icon doesn't stick out of the input's shadow/border area */
    overflow: hidden;
    width: 100%;
  }

  /* The input field */
  .profile-item {
    min-width: 250px;
    max-width: 400px;
  }

  /* Style for disabled fields (like ID) */
  .profile-item[disabled] {
    background-color: #1a1a1a;
    border-color: transparent;
    opacity: 0.4;
    cursor: default;
  }

  .profile-item:focus:not([disabled]) {
    border-color: #4CAF50;
    /* Highlight on focus */
    outline: none;
  }

  .edit-icon {
    /* 🎯 KEY CHANGE 3: Take the icon out of the normal flow */
    position: absolute;

    /* Position it to the right edge of the input container */
    right: 8px;
    /* Adjust this distance from the right edge of the input box */
    top: 50%;
    /* Center vertically */
    transform: translateY(-50%);
    /* Pull it back up by half its height */

    /* Reset mobile layout properties */
    margin-left: 0;
    /* Remove horizontal margin */
    height: 20px;
    cursor: pointer;
    z-index: 2;
    opacity: unset;
    /* Ensure it is on top of the input text */
  }

  /* Style for the 'V' (Save) icon when changes are pending */
  .save-icon {
    opacity: 1;
    height: 26px;
    transform: translateY(-50%) scale(1.1);
    /* Keep vertical centering */
    box-shadow: 0 0 8px rgba(76, 175, 79, 0);
    opacity: unset;
  }


  .visibility-toggle-icon {
    /* 🎯 Positioning: Take the icon out of the normal flow */
    position: absolute;

    /* Position it to the right edge of the input box */
    right: 10px;
    /* Adjust distance from the right edge */
    top: 50%;
    transform: translateY(-50%);
    /* Vertical centering */

    height: 22px;
    /* Set icon size */
    cursor: pointer;
    z-index: 3;
    opacity: unset;
    /* Ensure it is on top of the input text and other icons */
  }


  .profile-save-button {
    /* Give some space above the button */
    /* align-items: center;
    justify-content: center; */
    margin-left: 110px;
    padding: 10px 20px;
    background-color: #4CAF50;
    /* Example button style */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
  }

  .trophy-grid {
    gap: 25px;
    padding: 0px;
  }

  .achievement-card {
    height: 320px;
    width: 300px;
    padding: 15px;
    justify-content: flex-start;
    /* left alignment */
    flex-direction: column;
    align-items: center;
    justify-content: end;
    align-items: flex-end;
    gap: 10px;
  }

  .trophy-name {
    font-size: 0.95em;
    padding: 3px 12px;
  }

  .empty-message {
    position: absolute;
    top: 0px;
    /* near top edge */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 10px 15px;
    color: #ddd;
    font-size: 0.9em;
    border-radius: 8px;
    z-index: 3;
    width: 90%;
    max-width: 260px;
  }

  .golden-star-summary {
    position: absolute;
    top: 5px;
    /* distance from top edge */
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    text-align: center;
    padding: 10px 20px;
    border-radius: 10px;
    z-index: 5;
    width: fit-content;
    transition: transform 0.25s, box-shadow 0.25s;
  }

  .achievement-card {
    min-height: 180px;
  }

  .achievement-modal-content {
    padding: 22px;
    max-width: 80%;
    font-size: 12px;
  }

  .achievement-list-item .achievement-year {
    font-weight: 1000;
    color: gold;
    min-width: 30px;
  }

  .achievement-modal-content h3 {
    text-align: center;
    /* centers text horizontally */
    margin: 0 0 20px 0;
    /* spacing below the heading */
    font-size: 1.3em;
  }

  .close-btn {
  top: 6px;
  right: 10px;
}

.golden-star-summary .win-count {
  /* flex-wrap: wrap; */
display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;     
}

.achievement-list-item .list-team-logo {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: 12px;
  margin-right: 2px;
  margin-bottom: 4px;
  object-fit: cover;
}
}