/**
 * ProTrader - Efeitos Imersivos
 * Efeitos visuais avançados para uma experiência mais imersiva
 */

/* Fundo dinâmico */
.dynamic-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(var(--color-primary-rgb), 0.05), transparent 60%),
              radial-gradient(circle at 85% 30%, rgba(var(--color-secondary-rgb), 0.05), transparent 50%);
}

.bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(var(--color-text-rgb), 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-text-rgb), 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: -1;
}

.bg-glow {
  position: absolute;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--color-secondary-rgb), 0.1) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.bg-glow:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: -5s;
}

.bg-glow:nth-child(2) {
  top: 60%;
  left: 70%;
  animation-delay: -10s;
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.1) 0%, transparent 70%);
}

.bg-glow:nth-child(3) {
  top: 30%;
  left: 60%;
  width: 30%;
  height: 30%;
  animation-delay: -15s;
  background: radial-gradient(circle, rgba(var(--color-secondary-rgb), 0.08) 0%, transparent 70%);
}

/* Efeito de profundidade para cards */
.depth-effect {
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform 0.3s ease-out;
  will-change: transform;
  transform: perspective(1000px) rotateX(0) rotateY(0);
}

/* Efeito imersivo 3D que segue o mouse */
.depth-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(125deg, 
    rgba(0, 255, 0, 0.15), 
    rgba(0, 255, 0, 0.05) 40%, 
    transparent 80%);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.depth-effect:hover::before {
  opacity: 1;
}

.depth-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.depth-layer-1 {
  transform: translateZ(-10px);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.05), rgba(var(--color-secondary-rgb), 0.05));
  filter: blur(5px);
  opacity: 0.5;
}

.depth-layer-2 {
  transform: translateZ(-5px);
  border: 1px solid rgba(var(--color-text-rgb), 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Efeito de linha de grade para gráficos */
.chart-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(var(--color-text-rgb), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-text-rgb), 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 0;
  pointer-events: none;
}

/* Efeito de brilho para elementos importantes */
.glow-highlight {
  position: relative;
}

.glow-highlight::after {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(var(--color-secondary-rgb), 0.2) 0%, transparent 70%);
  filter: blur(15px);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.glow-highlight:hover::after {
  opacity: 1;
}

/* Efeito de destaque para valores positivos/negativos */
.value-positive {
  color: var(--color-success);
  position: relative;
}

.value-negative {
  color: var(--color-danger);
  position: relative;
}

.value-positive::after,
.value-negative::after {
  content: '';
  position: absolute;
  left: -5px;
  right: -5px;
  top: 0;
  bottom: 0;
  background: currentColor;
  opacity: 0.1;
  border-radius: 4px;
  z-index: -1;
}

/* Efeito de linha de tempo */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
}

.timeline-item {
  position: relative;
  margin-bottom: 15px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-secondary);
  border: 2px solid var(--color-background);
}

/* Efeito de destaque para seleção */
::selection {
  background-color: rgba(var(--color-secondary-rgb), 0.3);
  color: var(--color-text);
}

/* Efeito de destaque para elementos ativos */
.active-element {
  position: relative;
  overflow: hidden;
}

.active-element::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(var(--color-primary-rgb), 0.2), 
    rgba(var(--color-secondary-rgb), 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.active-element:hover::before {
  opacity: 1;
}

/* Animação de flutuação */
@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10px, 10px);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* Efeito de ondulação para cliques */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(var(--color-text-rgb), 0.2);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Efeito de movimento 3D para cards */
.card-3d-effect {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.card-3d-effect:hover {
  transform: rotateX(5deg) rotateY(5deg);
}

/* Efeito de brilho de borda */
.border-glow {
  position: relative;
  overflow: hidden;
}

.border-glow::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: inherit;
  background: linear-gradient(45deg, 
    var(--color-primary), 
    var(--color-secondary), 
    var(--color-primary));
  z-index: -1;
  animation: border-rotate 3s linear infinite;
}

@keyframes border-rotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Efeito de brilho de texto */
.text-glow {
  text-shadow: 0 0 5px rgba(var(--color-primary-rgb), 0.5);
  animation: text-pulse 2s infinite alternate;
}

@keyframes text-pulse {
  0% {
    text-shadow: 0 0 5px rgba(var(--color-primary-rgb), 0.5);
  }
  100% {
    text-shadow: 0 0 15px rgba(var(--color-primary-rgb), 0.8);
  }
}

/* Efeito de destaque para dados em tempo real */
.realtime-data {
  position: relative;
}

.realtime-data::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
  animation: pulse 1.5s infinite;
}

/* Efeito de destaque para alertas */
.alert-highlight {
  animation: alert-pulse 2s infinite;
}

@keyframes alert-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--color-danger-rgb), 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(var(--color-danger-rgb), 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--color-danger-rgb), 0);
  }
}

/* Efeito de transição para mudanças de dados */
.data-transition {
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.data-transition.changed {
  animation: highlight-change 1s ease;
}

@keyframes highlight-change {
  0% {
    background-color: rgba(var(--color-secondary-rgb), 0.2);
  }
  100% {
    background-color: transparent;
  }
}

/* Efeito de foco para elementos interativos */
.focus-effect:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--color-secondary-rgb), 0.5);
}

/* Efeito de carregamento para dados */
.loading-skeleton {
  background: linear-gradient(90deg, 
    rgba(var(--color-text-rgb), 0.05) 25%, 
    rgba(var(--color-text-rgb), 0.1) 50%, 
    rgba(var(--color-text-rgb), 0.05) 75%);
  background-size: 200% 100%;
  animation: loading-skeleton 1.5s infinite;
  border-radius: 4px;
  height: 1em;
}

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