/* Unified Users CSS - All user views */

/* Form controls */
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Form groups */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #333;
  font-weight: 500;
  font-size: 14px;
}

/* Search functionality */
.search-container {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-result-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

.search-result-item:last-child {
  border-bottom: none;
}

/* Button styles */
.btn {
  padding: 8px 16px;
  border: 1px solid;
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
  border-color: #545b62;
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #218838;
}

/* Submit button */
.submit-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-top: 20px;
  transition: background-color 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
  background-color: #0056b3;
}

.submit-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.65;
}

/* Game list styles */
.game-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  background-color: transparent;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
  max-width: 1000px;
  margin: 0 auto;
}

/* Custom scrollbar for game list */
.game-list::-webkit-scrollbar {
  width: 8px;
}

.game-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.game-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.game-list::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.game-item {
  background: #f8f9fa;
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.game-item:hover {
  background: #f0f0f0;
  border-color: #dee2e6;
}

.game-info {
  flex: 1;
}

.game-name {
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 2px;
}

.game-name a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

.game-name a:hover {
  color: #007bff;
}

.game-id {
  font-size: 12px;
  color: #666;
}

.game-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-select {
  padding: 6px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: white;
  transition: all 0.2s ease;
  cursor: pointer;
  color: #495057;
}

.rating-select:hover {
  border-color: #dee2e6;
}

.rating-select:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.remove-btn {
  background-color: transparent;
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  min-width: 28px;
  text-align: center;
}

.remove-btn:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

/* Selected games for new user form */
.selected-games {
  margin: 20px 0;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background: white;
}

.selected-game {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 10px;
}

.selected-game:hover {
  border-color: #dee2e6;
}

/* Override for game-item with selected-game class */
.game-item.selected-game {
  padding: 15px 20px;
  margin-bottom: 0;
}

/* Header styles */
.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  color: #333;
  margin-bottom: 8px;
}

.page-header .subtitle {
  color: #666;
  font-size: 14px;
  margin: 0;
}

.rating-header {
  margin-bottom: 20px;
}

.rating-header h1 {
  color: #333;
  font-size: 24px;
  font-weight: normal;
  margin: 0 0 10px 0;
}

.rating-header p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* Controls section */
.controls-section {
  margin-bottom: 20px;
  padding: 15px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.search-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 300px;
}

.search-group label {
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  margin: 0;
}

.button-group {
  display: flex;
  gap: 10px;
}

/* Game list section */
.game-list-section {
  margin-top: 20px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.game-list-section h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 500;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.empty-state h3 {
  color: #666;
  font-size: 16px;
  margin: 0 0 10px 0;
  font-weight: normal;
}

.empty-state p {
  color: #999;
  font-size: 14px;
  margin: 0;
}

/* Messages */
.message {
  padding: 12px 20px;
  margin: 0 0 20px 0;
  border-radius: 4px;
  font-size: 14px;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Hidden form */
.hidden-form {
  display: none;
}

/* Users index styles */
.users-list {
  margin-top: 20px;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  background: white;
}

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

.user-item:hover {
  background-color: #f8f9fa;
}

.user-name {
  font-weight: 500;
  color: #333;
}

.owned-user-badge {
  background-color: #28a745;
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-left: 8px;
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.edit-button, .user-link {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
}

.edit-button:hover, .user-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.create-user-link {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
}

.create-user-link:hover {
  color: #0056b3;
  text-decoration: underline;
}

.info {
  background-color: #e9ecef;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
  color: #495057;
}

/* Responsive design */
@media (max-width: 768px) {
  .game-list {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 15px;
    max-width: 100%;
  }
  
  .game-item {
    padding: 10px 12px;
  }
  
  .game-name {
    font-size: 14px;
  }
  
  .rating-select {
    font-size: 13px;
    padding: 5px 8px;
  }
  
  .remove-btn {
    font-size: 12px;
    padding: 4px 6px;
    min-width: 24px;
  }
  
  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-group {
    min-width: auto;
  }
  
  .user-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  
  .game-list-section {
    max-width: 100%;
  }
}