/* Bot Configuration Styles - Fixed Layout */

/* Loading and Error States */
.loading-container {
  text-align: center;
  padding: 3rem;
  max-width: 800px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60vh;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(165, 109, 255, 0.1);
  border-left: 4px solid #a56dff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-container {
  text-align: center;
  padding: 3rem;
  color: #ff6b6b;
  max-width: 600px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 60vh;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.retry-button, .back-button {
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.retry-button {
  background: #a56dff;
  color: white;
}

.retry-button:hover {
  background: #8342f4;
  transform: translateY(-2px);
}

.back-button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Config Content - FIXED: Wider layout for better spacing */
.config-hero {
  flex: 1;
  padding: 0;
  max-width: 1000px; /* Increased from 900px */
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.config-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 950px; /* Increased from 850px */
  margin: 0 auto;
}

.config-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.config-icon {
  font-size: 2rem;
  color: #a56dff;
  margin-bottom: 0.5rem;
}

.config-header h1 {
  font-size: 1.8rem;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #a56dff, #d100ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.config-header p {
  color: #ccc;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

/* Configuration Categories */
.config-categories {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  margin-bottom: 1rem;
}

.config-category {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.category-header {
  padding: 1rem 1.5rem;
  background: rgba(165, 109, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.reset-personal-btn {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #ff6b6b;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.reset-personal-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: #f44336;
  transform: translateY(-1px);
}

.reset-personal-btn:active {
  transform: translateY(0);
}

.reset-personal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.category-header h2 {
  margin: 0 0 0.25rem 0;
  color: #a56dff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-description {
  margin: 0;
  color: #ccc;
  font-size: 0.85rem;
  line-height: 1.3;
}

.category-content {
  padding: 1.5rem;
}

/* Setting Items */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-info {
  flex: 1;
  max-width: 65%;
}

.setting-info label {
  display: block;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.setting-description {
  color: #999;
  font-size: 0.8rem;
  margin: 0;
  line-height: 1.3;
}

.setting-control {
  margin-left: 1rem;
  flex-shrink: 0;
}

.setting-control input[type="text"],
.setting-control input[type="number"] {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  min-width: 60px;
  transition: all 0.3s ease;
}

.setting-control input[type="text"]:focus,
.setting-control input[type="number"]:focus {
  outline: none;
  border-color: #a56dff;
  box-shadow: 0 0 0 3px rgba(165, 109, 255, 0.1);
}

/* Preferred name input styling */
#preferred-name-input {
  min-width: 200px !important;
  max-width: 250px !important;
}

#preferred-name-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

#preferred-name-input:focus {
  background: rgba(255, 255, 255, 0.08);
}

/* Category Sections */
.command-category-section {
  margin-bottom: 1.5rem;
}

.command-category-section:last-child {
  margin-bottom: 0;
}

.category-section-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(165, 109, 255, 0.3);
}

.category-section-header h4 {
  margin: 0;
  color: #a56dff;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-section-header h4 i {
  font-size: 0.9rem;
}

.category-section-content {
  margin-left: 0.75rem;
}

/* FIXED: Command Item Layout - Now with 3 columns for proper "Off" button placement */
.command-item {
  display: grid;
  grid-template-columns: 1fr auto auto; /* Three columns: info, permissions, toggle mode */
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 1rem;
  min-height: 50px;
}

.command-item:last-child {
  border-bottom: none;
}

.command-info {
  min-width: 0;
  text-align: left;
  padding-left: 0.5rem;
}

.command-name {
  color: #a56dff;
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  text-align: left;
  display: block;
}

.command-description {
  color: #ccc;
  font-size: 0.75rem;
  margin: 0;
  line-height: 1.3;
  text-align: left;
}

/* FIXED: Permission Radio Group - Properly sized to fit all buttons including "Off" */
.command-permissions {
  text-align: center;
  justify-self: center;
  min-width: 280px; /* Increased to fit all 5 buttons properly */
}

.permission-label {
  display: block;
  color: #999;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-align: center;
}

.permission-radio-group {
  display: flex;
  gap: 0.3rem; /* Tighter gap to fit all buttons */
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
}

.permission-radio-item {
  position: relative;
  flex-shrink: 0;
}

.permission-radio-item input[type="radio"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

.permission-radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.5rem; /* Reduced padding to fit all buttons */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #ccc;
  font-size: 0.65rem; /* Smaller font to fit */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 48px; /* Smaller min-width */
  text-align: center;
  white-space: nowrap;
}

.permission-radio-item input[type="radio"]:checked + .permission-radio-label {
  background: #a56dff;
  border-color: #a56dff;
  color: white;
  box-shadow: 0 2px 8px rgba(165, 109, 255, 0.3);
  transform: translateY(-1px);
}

.permission-radio-item input[type="radio"]:disabled + .permission-radio-label {
  opacity: 0.5;
  cursor: not-allowed;
}

.permission-radio-label:hover:not(.disabled) {
  border-color: #a56dff;
  background: rgba(165, 109, 255, 0.1);
  transform: translateY(-1px);
}

.permission-radio-item input[type="radio"]:checked + .permission-radio-label:hover {
  background: #8342f4;
  border-color: #8342f4;
}

/* FIXED: Off Option Styling - Now properly contained */
.permission-radio-label.off-option {
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.3);
  color: #ff6b6b;
}

.permission-radio-item input[type="radio"]:checked + .permission-radio-label.off-option {
  background: #f44336;
  border-color: #f44336;
  color: white;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.permission-radio-label.off-option:hover:not(.disabled) {
  border-color: #f44336;
  background: rgba(244, 67, 54, 0.2);
}

.permission-radio-item input[type="radio"]:checked + .permission-radio-label.off-option:hover {
  background: #d32f2f;
  border-color: #d32f2f;
}

/* FIXED: Toggle Mode Section - Now properly styled and positioned */
.command-toggle-mode {
  text-align: center;
  justify-self: center;
  min-width: 120px;
}

.toggle-mode-label {
  display: block;
  color: #999;
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
  text-align: center;
}

.toggle-mode-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  min-width: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-mode-select:focus {
  outline: none;
  border-color: #a56dff;
  box-shadow: 0 0 0 3px rgba(165, 109, 255, 0.1);
}

.toggle-mode-select:hover {
  border-color: #a56dff;
  background: rgba(165, 109, 255, 0.1);
}

.toggle-mode-select option {
  background: #1a1a1a;
  color: white;
  padding: 0.5rem;
}


.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.toggle-switch input {
  opacity: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.3s;
  border-radius: 26px;
  z-index: 1;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #a56dff;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch input:disabled {
  cursor: not-allowed;
}

/* Hover effects for better user experience */
.toggle-switch:hover .toggle-slider:not(.disabled) {
  background-color: #666;
}

.toggle-switch input:checked:hover + .toggle-slider {
  background-color: #8f4dff;
}

/* Focus styles for accessibility */
.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(165, 109, 255, 0.3);
}

/* Action Buttons */
.config-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  flex-shrink: 0;
}

.save-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.save-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.save-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.cancel-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  min-width: 160px;
  justify-content: center;
}

.cancel-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
}

/* Responsive Design - FIXED: Better mobile layout */
@media (max-width: 1024px) {
  .config-hero {
    max-width: 100%;
  }
  
  .config-container {
    max-width: 100%;
    margin: 0;
  }

  .command-permissions {
    min-width: 260px; /* Slightly smaller on tablets */
  }

  #preferred-name-input {
    min-width: 180px !important;
    max-width: 220px !important;
  }
}

@media (max-width: 768px) {
  .config-hero {
    padding: 0;
  }

  .config-container {
    padding: 1rem;
    max-width: 100%;
    margin: 0;
  }

  .config-header {
    margin-bottom: 1.5rem;
  }

  .config-categories {
    gap: 1rem;
  }

  .category-header {
    padding: 0.75rem 1rem;
  }

  .category-content {
    padding: 1rem;
  }

  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
  }

  .setting-info {
    max-width: 100%;
  }

  .setting-control {
    margin-left: 0;
    width: 100%;
  }

  .setting-control input {
    width: 100%;
    max-width: 100%;
  }

  #preferred-name-input {
    min-width: 100% !important;
    max-width: 100% !important;
  }

  /* FIXED: Mobile command layout - Stack vertically for better usability */
  .command-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
    padding: 0.75rem 0;
  }

  .command-info {
    text-align: center;
    width: 100%;
    padding-left: 0;
  }

  .command-name {
    text-align: center;
  }

  .command-description {
    text-align: center;
  }

  .command-permissions {
    width: 100%;
    min-width: auto;
  }

  .command-toggle-mode {
    width: 100%;
    min-width: auto;
  }

  .permission-radio-group {
    justify-content: center;
    gap: 0.4rem; /* Slightly more gap on mobile for touch targets */
  }

  .permission-radio-label {
    min-width: 55px; /* Larger touch targets on mobile */
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .toggle-mode-select {
    width: 100%;
    min-width: auto;
  }

  .config-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .save-button, .cancel-button {
    width: 100%;
    max-width: 250px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .config-header h1 {
    font-size: 1.8rem;
  }

  .config-icon {
    font-size: 2rem;
  }

  .category-header {
    padding: 0.5rem 0.75rem;
  }

  .category-content {
    padding: 0.75rem;
  }

  .permission-radio-group {
    gap: 0.25rem;
  }

  .permission-radio-label {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    min-width: 45px;
  }

  .command-item {
    gap: 0.75rem;
    padding: 0.5rem 0;
  }

  .save-button, .cancel-button {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
  }
}

/* Fixed Toggle Switch - Replace the existing .toggle-switch styles in settings.css */

/* Custom User Permissions Section */
.permissions-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.permission-subsection {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.permission-subsection:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.permission-subsection h3 {
  color: #a56dff;
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subsection-description {
  color: #999;
  font-size: 0.8rem;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

/* Blacklist and Custom Permissions Lists */
.users-list {
  min-height: 50px;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.75rem;
}

.users-list:empty::before {
  content: 'No users in this list';
  display: block;
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 1rem;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.user-item:last-child {
  margin-bottom: 0;
}

.user-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(165, 109, 255, 0.3);
}

.user-info-perm {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.user-info-perm i {
  color: #a56dff;
  font-size: 1rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-name {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-level {
  color: #999;
  font-size: 0.75rem;
}

.user-level-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.level-default {
  background: rgba(128, 128, 128, 0.2);
  color: #ccc;
}

.level-vip {
  background: rgba(233, 25, 137, 0.2);
  color: #ff69b4;
}

.level-mod {
  background: rgba(0, 128, 0, 0.2);
  color: #4caf50;
}

.level-lead-mod {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.remove-user-btn {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #ff6b6b;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.remove-user-btn:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: #f44336;
  transform: translateY(-1px);
}

.remove-user-btn:active {
  transform: translateY(0);
}

/* Add Permission Form */
.add-permission-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.username-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.username-input:focus {
  outline: none;
  border-color: #a56dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(165, 109, 255, 0.1);
}

.username-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.permission-select {
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.permission-select:focus {
  outline: none;
  border-color: #a56dff;
  box-shadow: 0 0 0 3px rgba(165, 109, 255, 0.1);
}

.permission-select:hover {
  border-color: #a56dff;
  background: rgba(165, 109, 255, 0.1);
}

.permission-select option {
  background: #1a1a1a;
  color: white;
  padding: 0.5rem;
}

.add-permission-button {
  background: linear-gradient(135deg, #a56dff, #d100ff);
  color: white;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(165, 109, 255, 0.3);
}

.add-permission-button:hover {
  background: linear-gradient(135deg, #8342f4, #b000d4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(165, 109, 255, 0.4);
}

.add-permission-button:active {
  transform: translateY(0);
}

.add-permission-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.permission-hint {
  color: #999;
  font-size: 0.75rem;
  font-style: italic;
  margin: 0;
}

/* Scrollbar Styling for Users Lists */
.users-list::-webkit-scrollbar {
  width: 8px;
}

.users-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.users-list::-webkit-scrollbar-thumb {
  background: rgba(165, 109, 255, 0.3);
  border-radius: 4px;
}

.users-list::-webkit-scrollbar-thumb:hover {
  background: rgba(165, 109, 255, 0.5);
}

/* Responsive Design for Permissions */
@media (max-width: 768px) {
  .add-permission-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .username-input,
  .permission-select,
  .add-permission-button {
    width: 100%;
  }

  .user-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .remove-user-btn {
    width: 100%;
    justify-content: center;
  }
}

/* View List Button */
.view-list-button {
  background: linear-gradient(135deg, #2d2d2d, #1a1a1a);
  color: #a56dff;
  border: 1px solid rgba(165, 109, 255, 0.3);
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-list-button:hover {
  background: linear-gradient(135deg, #3a3a3a, #2d2d2d);
  border-color: rgba(165, 109, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(165, 109, 255, 0.2);
}

.view-list-button:active {
  transform: translateY(0);
}

/* Global Blacklist Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, #1a1a1a, #121212);
  border-radius: 12px;
  border: 1px solid rgba(165, 109, 255, 0.2);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-header h2 i {
  color: #a56dff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.blacklist-description {
  color: #999;
  font-size: 0.9rem;
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

.blacklist-songs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blacklist-song-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.blacklist-song-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(165, 109, 255, 0.2);
}

.blacklist-song-item .song-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.blacklist-song-item .song-title {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blacklist-song-item .song-artist {
  color: #999;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blacklist-song-item .spotify-link {
  color: #1DB954;
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-left: 1rem;
}

.blacklist-song-item .spotify-link:hover {
  background: rgba(29, 185, 84, 0.15);
}

.blacklist-empty {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.blacklist-empty i {
  font-size: 2.5rem;
  color: #4caf50;
  margin-bottom: 1rem;
  display: block;
}

.blacklist-empty p {
  margin: 0;
  font-size: 0.95rem;
}

.blacklist-error {
  text-align: center;
  padding: 2rem;
  color: #f44336;
}

.blacklist-error i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.blacklist-error p {
  margin: 0;
  font-size: 0.95rem;
}

/* Modal Responsive */
@media (max-width: 600px) {
  .modal-content {
    max-height: 90vh;
    margin: 0.5rem;
  }

  .modal-header {
    padding: 1rem;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .blacklist-song-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .blacklist-song-item .spotify-link {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* ===================== Sticky unsaved-changes bar ===================== */

.unsaved-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 140%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 1.4rem;
  background: rgba(13, 10, 26, 0.95);
  border: 1px solid rgba(165, 109, 255, 0.5);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  z-index: 1200;
  transition: transform 0.25s ease;
  max-width: calc(100vw - 32px);
}

.unsaved-bar.show {
  transform: translate(-50%, 0);
}

.unsaved-text {
  color: white;
  font-weight: 600;
  white-space: nowrap;
}

.unsaved-text i {
  color: #ff9800;
  margin-right: 0.4rem;
}

.unsaved-actions {
  display: flex;
  gap: 0.6rem;
}

.unsaved-discard {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unsaved-discard:hover {
  background: rgba(255, 255, 255, 0.2);
}

.unsaved-save {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #4caf50, #45a049);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unsaved-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.35);
}

.unsaved-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .unsaved-bar {
    flex-direction: column;
    gap: 0.75rem;
    width: calc(100vw - 32px);
  }
}
