/* =====================================================
   Fish Tank Favorites & Background Selector Styles
   ===================================================== */

/* Favorite Button Styles */
.favorite-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 5px 10px;
  transition: all 0.3s ease;
  line-height: 1;
  position: relative;
}

.favorite-btn .star-icon {
  display: inline-block;
  color: #FFD700; /* 金色 */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
  font-size: 1.2em; /* 增大默认状态下的五角星 */
}

.favorite-btn .star-icon.filled {
  color: #FFD700; /* 金色实心星 */
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.favorite-btn:hover .star-icon {
  transform: scale(1.2);
  filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
}

.favorite-btn:hover .star-icon.filled {
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
}

.favorite-btn:active .star-icon {
  transform: scale(0.9);
}

.favorite-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.favorite-btn:disabled .star-icon {
  color: #999;
  filter: none;
}

.favorite-btn.favorited {
  animation: starPulse 0.5s ease;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1.1); }
  75% { transform: scale(1.25); }
}

/* Favorite Toast Notification */
.favorite-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.favorite-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.favorite-toast.success {
  background: #28a745;
}

.favorite-toast.error {
  background: #dc3545;
}

.favorite-toast.info {
  background: #17a2b8;
}

/* Background Selector Styles */
.background-selector {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.background-selector h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.background-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.background-option {
  position: relative;
  border: 3px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  aspect-ratio: 16/9;
}

.background-option:hover {
  border-color: #007bff;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.background-option.selected {
  border-color: #28a745;
  border-width: 4px;
}

.background-option.selected::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 5px;
  background: #28a745;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.background-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.background-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  padding: 8px;
  font-size: 12px;
}

.background-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.background-cost {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.background-cost.free {
  color: #4caf50;
}

.background-cost.paid {
  color: #ffc107;
}

/* Fish Categories in Private Tank */
.fish-category {
  margin: 30px 0;
}

.fish-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e9ecef;
}

.fish-category-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.fish-category-count {
  background: #007bff;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.fish-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

/* Fish Card in Private Tank */
.private-fish-card {
  position: relative;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 10px;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.private-fish-card:hover {
  border-color: #007bff;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.private-fish-card.dead {
  opacity: 0.6;
  border-color: #dc3545;
}

.fish-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 10;
}

.fish-badge.own {
  background: #d4edda;
  color: #155724;
}

.fish-badge.favorited {
  background: #fff3cd;
  color: #856404;
}

.fish-badge.dead {
  background: #f8d7da;
  color: #721c24;
}

.fish-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.fish-thumbnail canvas {
  max-width: 100%;
  max-height: 100%;
}

.fish-info-compact {
  text-align: center;
}

.fish-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fish-level {
  font-size: 11px;
  color: #666;
}

/* Background Change Modal */
.background-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.background-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.background-modal-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.background-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.background-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 22px;
}

.background-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.background-modal-close:hover {
  color: #333;
}

.background-preview {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 15px;
}

.background-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-details {
  margin-bottom: 20px;
}

.background-details h4 {
  margin: 0 0 5px 0;
  color: #333;
  font-size: 18px;
}

.background-details p {
  margin: 0 0 10px 0;
  color: #666;
  font-size: 14px;
}

.background-cost-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 20px;
}

.background-cost-display.free {
  background: #d4edda;
  color: #155724;
}

.background-cost-display.paid {
  background: #fff3cd;
  color: #856404;
}

.background-cost-display strong {
  font-size: 16px;
}

.background-actions {
  display: flex;
  gap: 10px;
}

.background-actions button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.background-actions .btn-confirm {
  background: #007bff;
  color: white;
}

.background-actions .btn-confirm:hover {
  background: #0056b3;
}

.background-actions .btn-cancel {
  background: #6c757d;
  color: white;
}

.background-actions .btn-cancel:hover {
  background: #5a6268;
}

/* Empty State */
.empty-fish-category {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.empty-fish-category p {
  margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .background-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .fish-category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  .background-modal-content {
    padding: 20px;
    width: 95%;
  }
  
  .favorite-toast {
    bottom: 10px;
    right: 10px;
    left: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .fish-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


















