/* watchlist-widget.css */
/* Styles for the Firestore-based watchlist widget */

.watchlist-container {
  /* Ensure proper spacing and layout */
  margin-bottom: 1.5rem;
}

.watchlist-container .bg-card {
  /* Inherit theme variables */
  background-color: var(--card-bg, #ffffff);
  color: var(--text-color, #1f2937);
}

.dark .watchlist-container .bg-card {
  background-color: var(--card-bg-dark, #1f2937);
  color: var(--text-color-dark, #f9fafb);
}

/* Stock item hover effects */
.watchlist-container .stock-item {
  transition: all 0.2s ease-in-out;
}

.watchlist-container .stock-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Search suggestions styling */
.watchlist-container #stockSuggestions {
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .watchlist-container #stockSuggestions {
  border-color: #374151;
  background-color: #1f2937;
}

/* Price change indicators */
.watchlist-container .price-positive {
  color: #059669;
}

.watchlist-container .price-negative {
  color: #dc2626;
}

/* Button hover effects */
.watchlist-container button {
  transition: all 0.2s ease-in-out;
}

.watchlist-container button:hover {
  transform: translateY(-1px);
}

/* Loading states */
.watchlist-container .loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.dark .watchlist-container .loading-skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .watchlist-container .flex-wrap {
    flex-direction: column;
  }
  
  .watchlist-container .flex-wrap > * {
    width: 100%;
  }
  
  .watchlist-container #stockSuggestions {
    position: fixed;
    left: 1rem;
    right: 1rem;
    max-height: 50vh;
  }
}

/* Focus states for accessibility */
.watchlist-container input:focus,
.watchlist-container button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Alert indicators */
.watchlist-container .alert-indicator {
  position: relative;
}

.watchlist-container .alert-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background-color: #f59e0b;
  border-radius: 50%;
  border: 2px solid white;
}

.dark .watchlist-container .alert-indicator::after {
  border-color: #1f2937;
}

/* Animation for adding/removing items */
.watchlist-container .stock-item {
  animation: slideIn 0.3s ease-out;
}

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

.watchlist-container .stock-item.removing {
  animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Message notifications */
.watchlist-container .message {
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats section styling */
.watchlist-container .stats-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.dark .watchlist-container .stats-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
}

/* Export/Import button styling */
.watchlist-container .action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .watchlist-container .action-buttons {
    flex-direction: column;
  }
  
  .watchlist-container .action-buttons button {
    width: 100%;
    justify-content: center;
  }
}
