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

.friends-row {
  display: flex;
  gap: 16px;
  margin: 30px auto;
  padding-right: 0px;
  margin-top: 265px;
  flex-wrap: wrap;
}

.friends-row-item {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.friend-box {
  padding: 12px 12px;
  /* color: white; */
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-weight: bold;
  white-space: nowrap;
  transition: background 0.3s, transform 0.2s;
  /* min-width: 250px;
  max-width: 280px; */
}

#usersData {
  display: flex;
  justify-content: center;
  padding-left: 0px;
  padding-right: 0px;
  margin-top: 130px;
  font-size: 18px;
  color: #ffffff;
}

/* 1. APPROVED/FRIENDS Tab (Green) */
.tab-btn.active-tab[data-tab="approved"] {
  background-color: white;
  /* Dark Green fill */
  color: #333;
  box-shadow: 0 0 8px rgba(3, 231, 56, 2.6);
  /* Green glowing shadow */
}

/* 2. PENDING Tab (Yellow/Orange) */
.tab-btn.active-tab[data-tab="pending"] {
  background-color: white;
  /* Orange fill */
  color: #333;
  /* Dark text for contrast against bright yellow/orange */
  box-shadow: 0 0 8px rgba(255, 193, 7, 2.6);
  /* Yellow/Orange glowing shadow */
}

/* 3. REJECTED Tab (Red) */
.tab-btn.active-tab[data-tab="rejected"] {
  background-color: white;
  /* Red fill */
  color: #333;
  box-shadow: 0 0 8px rgba(220, 53, 69, 2.6);
  /* Red glowing shadow */
}

/* Base Styling */
.friend-item {
  display: flex;
  justify-content: space-between;
  /* Pushes name to left, actions to right */
  align-items: center;
  padding: 7px 12px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-family: Arial, sans-serif;
}

.friend-name {
  font-weight: bold;
  font-size: 16px;
  min-width: 180px;
  max-width: 280px;
}

.friend-actions button {
  padding: 6px 12px;
  /* margin-left: 8px; */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.2s, background-color 0.2s;
  margin-right: 6px;
}

.friend-actions button:last-child {
  margin-right: 0;
  /* clean edge */
}

.friend-actions button:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.status-approved {
  border-left: 5px solid #28a745;
  /* Green border on the side */
  background-color: #e6ffed;
  /* Very light green background */
}

/* Styles for the APPROVED action buttons */
.status-approved .action-delete {
  background-color: #dc3545;
  /* Red for deletion */
  color: white;
}

.status-approved .action-reject {
  background-color: #0a57fc;
  /* Gray for "Change to Rejected" */
  color: white;
}

.status-pending {
  border-left: 5px solid #ffc107;
  /* Yellow/Orange border on the side */
  background-color: #fff9e6;
  /* Very light yellow background */
}

/* Styles for the PENDING action buttons */
.status-pending .action-approve {
  background-color: #28a745;
  /* Green for approval (primary action) */
  color: white;
  font-weight: bold;
}

.status-pending .action-reject {
  background-color: #0a57fc;
  /* Gray for rejection */
  color: white;
}

.status-pending .action-delete {
  background-color: #dc3545;
  /* Blue for direct deletion (a neutral, non-status-changing action) */
  color: white;
}


.status-rejected {
  border-left: 5px solid #dc3545;
  /* Red border on the side */
  background-color: #fdeaea;
  /* Very light red/pink background */
  color: #555;
  /* Slightly muted text color */
}

/* Styles for the REJECTED action buttons */
.status-rejected .action-delete {
  background-color: #dc3545;
  /* Red for the only remaining action */
  color: white;
}

.friend-actions-menu-toggle,
.friend-actions-menu {
  display: none;
}



.add-friend-bar {
  display: flex;
  gap: 5px;
  /* margin-bottom: 25px; */
  margin-top: 200px;
  padding: 8px;
  background-color: rgba(90, 87, 87, 0.308);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  position: fixed;
  z-index: 200;
  width: 25%;
}

.add-friend-input {
  flex-grow: 1;
  padding: 8px 15px;
  border: none;
  border-radius: 6px;
  background-color: rgba(0, 0, 0, 0.666);
  color: #fff;
  font-size: 16px;
  outline: none;
  width: 25%;
}

.add-friend-input::placeholder {
  color: #a0a0a0;
}

.add-friend-input:focus {
  background-color: rgba(0, 0, 0, 0.777);
  box-shadow: 0 0 0 2px #28a745;
  /* Light green border on focus */
}

.add-friend-button {
  background-color: #28a745;
  /* Action color: Green */
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.2s, box-shadow 0.2s;
  line-height: 1;
}

.add-friend-button:hover {
  background-color: #34b752;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.search-icon-symbol {
  font-size: 20px;
  /* Make the icon a bit bigger */
  display: block;
  /* Helps with centering */
  line-height: 1;
}

.search-icon {
  font-size: 15px;
  line-height: 1;
  display: block;
}

/* Class to hide the icon without removing it from flow (for smooth toggling) */
.hidden-icon {
  display: none;
}

/* Style for the 'X' icon to ensure it's clickable */
.search-clear-icon {
  font-weight: bold;
}


#searchResultsContainer {
  max-width: 600px;
  margin: 260px 0 0;
  padding: 0;
}

/* Base style for a single search result item */
.search-result-item {
  flex-grow: 1;
  padding: 10px 15px;
  border: none;
  border-radius: 6px;
  background-color: rgba(15, 16, 19, 0.966);
  color: #fff;
  font-size: 14px;
  outline: none;
  justify-content: space-between;
  display: flex;
  gap: 10px;
}

.result-username {
  font-weight: bold;
  font-size: 14px;
  margin-right: 15px;
  margin-right: 0;
  /* ⬅️ Crucial: Allow the username to take up only the space it needs */
  flex-shrink: 0;
}

/* Base style for the status badge */
.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  /* text-transform: uppercase; */
  margin-left: 10px;
  /* Keep a small gap from the action button or the end */
  /* ⬅️ Crucial: Prevent the status badge from growing */
  flex-shrink: 0;
}

/* --- Status Colors --- */

/* "available" - Grey */
.status-badge.available {
  background-color: #6c757d;
  /* Muted grey */
  color: #fff;
}

/* "pending" - Yellow */
.status-badge.pending {
  background-color: #ffc107;
  /* Yellow/Orange */
  color: #333;
  /* Dark text for contrast */
}

/* "approved" - Green */
.status-badge.approved {
  background-color: #28a745;
  /* Green */
  color: #fff;
}

/* "rejected" - Red */
.status-badge.rejected {
  background-color: #dc3545;
  /* Red */
  color: #fff;
}

/* Add Friend Button (only visible for 'available' status) */
.action-add-friend {
  background-color: #09962a;
  /* Blue for primary action */
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: auto;
  /* Push to the right */
  margin-right: 10px;
}

.action-add-friend:hover {
  background-color: #28a745;
  transform: scale(1.06);
}

.friend-actions button.action-delete.confirming-action,
.friend-actions-menu button.action-delete.confirming-action.menu-item {
  background-color: #dc3545;
  /* Strong Red */
  color: white;
  font-weight: bold;
  animation: pulse 1s infinite;
}

/* --- REJECT ACTION CONFIRMATION (ORANGE) --- */
.friend-actions button.action-reject.confirming-action,
.friend-actions-menu button.action-reject.confirming-action.menu-item {
  background-color: #0a57fc;
  /* Orange */
  color: white;
  font-weight: bold;
  animation: pulse 1s infinite;
}

/* --- APPROVE ACTION CONFIRMATION (GREEN) --- */
.friend-actions button.action-approve.confirming-action,
.friend-actions-menu button.action-approve.confirming-action.menu-item {
  background-color: #28a745;
  /* Green */
  color: white;
  font-weight: bold;
  animation: pulse 1s infinite;
  /* Using pulse, or pulse-approve if defined */
}

/* * Optional: You might want to remove the default styles 
* when the confirmation style is applied.
*/
.friend-actions button.confirming-action,
.friend-actions-menu button.confirming-action {
  border-color: transparent !important;
  /* Hides default border if any */
}

.tab-btn:disabled {
  cursor: default;
  pointer-events: none;
}




@media (max-width: 480px) {

  /* Outer section or container */
  #friendsContainer {
    padding: 14px;
    -webkit-overflow-scrolling: touch;
    /* smooth scroll on iOS */
    margin-inline: 0;
    overflow-y: unset;
  }

  .friends-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0px;
    padding-top: 250px;
    padding-left: 2px;
    padding-right: 0px;
    text-align: start;
    flex-direction: column;
    width: 100%;
    z-index: 0;
  }

  /* Each league box */
  .friend-box {
    padding: 6px 14px;
    font-weight: bold;
    white-space: nowrap;
    transition: background 0.3s, transform 0.2s;
  }

  .friends-row-item {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    margin-right: 0px;
  }

  #usersData {
    display: flex;
    justify-content: center;
    padding-left: 0px;
    padding-right: 0px;
    margin-top: 100px;
    font-size: 14px;

  }

  .friend-name {
    font-weight: bold;
    font-size: 14px;
    min-width: 250px;
    max-width: 350px;
  }



  .friend-actions button {
    display: none;
  }

  /* Hamburger (⋮) icon */
  .friend-actions-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: var(--btn-bg, #222);
    /* match your existing button bg */
    color: var(--btn-fg, #fff);
    /* match your existing button color */
    cursor: pointer;
    font-size: 22px;
  }

  .friend-actions-menu-toggle:active {
    transform: scale(0.96);
  }

  /* Dropdown container */
  .friend-actions-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* spacing between buttons */
    position: absolute;
    right: 8px;
    top: 44px;
    padding: 10px;
    border-radius: 12px;
    background: var(--menu-bg, #1a1a1a);
    /* same tone as your dark theme */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    min-width: 80px;
  }

  .friend-actions-menu.open {
    opacity: 1;
    pointer-events: auto;
    /* transform: translateY(0); */
  }

  /* Menu items mimic your existing buttons */
  .friend-actions-menu .menu-item {
    padding: 6px 12px;
    /* margin-left: 8px; */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: sans-serif;
    transition: opacity 0.2s, background-color 0.2s;
  }

  /* Optional: per-action colors if your desktop had them */
  .menu-item.action-approve {
    background: #28a745;
    /* green */
  }

  .menu-item.action-reject {
    background: #0a57fc;
    /* red */
  }

  .menu-item.action-delete {
    background: #dc3545;
    /* gray delete */
  }

  .add-friend-bar {
    display: flex;
    flex-wrap: wrap;
    margin-top: 190px;
    left: 15px;
    right: 0px;
    width: 90%;
  }

  .add-friend-input {
    flex-grow: 1;
    padding: 6px 10px;
    border: none;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 12px;
    outline: none;
  }

  .add-friend-input::placeholder {
    color: #a0a0a0;
  }

  .add-friend-input:focus {
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 2px #28a745;
    /* Light green border on focus */
  }

  .add-friend-button {
    background-color: #28a745;
    /* Action color: Green */
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.2s, box-shadow 0.2s;
    line-height: 1;
  }

  .add-friend-btn:hover {
    background-color: #10922f;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
  }

  #searchResultsContainer {
    max-width: 600px;
    margin: 240px auto 0;
    padding: 0;
    margin-left: 1px;
  }

  .search-result-item {
    font-size: 12px;
  }

  .action-add-friend {
    background-color: #0d7e27;
    /* Blue for primary action */
    color: white;
    border: none;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: auto;
    /* Push to the right */
    margin-right: 6px;

  }

  .friend-item {
    display: flex;
    justify-content: space-between;
    /* Pushes name to left, actions to right */
    align-items: center;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    font-family: Arial, sans-serif;
  }

  .friend-actions button.action-delete.confirming-action,
  .friend-actions-menu button.action-delete.confirming-action.menu-item {
    background-color: #dc3545;
    /* Strong Red */
    color: white;
    font-weight: bold;
    animation: pulse 1s infinite;
  }

  /* --- REJECT ACTION CONFIRMATION (ORANGE) --- */
  .friend-actions button.action-reject.confirming-action,
  .friend-actions-menu button.action-reject.confirming-action.menu-item {
    background-color: #0a57fc;
    /* Orange */
    color: white;
    font-weight: bold;
    animation: pulse 1s infinite;
  }

  /* --- APPROVE ACTION CONFIRMATION (GREEN) --- */
  .friend-actions button.action-approve.confirming-action,
  .friend-actions-menu button.action-approve.confirming-action.menu-item {
    background-color: #28a745;
    /* Green */
    color: white;
    font-weight: bold;
    animation: pulse 1s infinite;
    /* Using pulse, or pulse-approve if defined */
  }

  /* * Optional: You might want to remove the default styles 
* when the confirmation style is applied.
*/
  .friend-actions button.confirming-action,
  .friend-actions-menu button.confirming-action {
    border-color: transparent !important;
    /* Hides default border if any */
  }
}