/* Market Data Auto-Updater Styles */

/* Botão de Atualização Manual */
#refreshMarketData {
  position: relative;
  overflow: hidden;
}

#refreshMarketData:hover {
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.2);
}

/* Indicador de Última Atualização */
#lastUpdateIndicator {
  font-size: 0.85rem;
  color: #6c757d;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

#lastUpdateIndicator i {
  color: #28a745;
}

/* Status Indicator */
#statusIndicator {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  background-color: rgba(40, 167, 69, 0.1);
  margin-left: 0.5rem;
}

#statusIndicator i {
  margin-right: 0.25rem;
}

/* Animação de pulse para dados atualizando */
.metric-card.updating {
  animation: pulse 1s ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
  }
}

/* Badge de API Status */
.api-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.api-status-badge.success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
}

.api-status-badge.loading {
  background-color: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.api-status-badge.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

/* Tooltip de informação */
.update-info-tooltip {
  position: relative;
  cursor: help;
}

.update-info-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(44, 62, 80, 0.95);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 0.5rem;
}

.update-info-tooltip:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(44, 62, 80, 0.95);
  margin-bottom: -6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #refreshMarketData {
    padding: 0.5rem;
  }

  #refreshMarketData span {
    display: none;
  }

  #refreshMarketData i {
    margin: 0 !important;
  }

  #lastUpdateIndicator {
    font-size: 0.75rem;
  }

  .api-status-badge {
    display: none;
  }
}

/* Success notification */
.update-success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #28a745;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.update-success-notification.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}