/*
  ==========================================
  EFFECTS.CSS - Semantyq
  ==========================================
  Efeitos visuais avançados:
  - Mega Dropdown com blur e animações
  - Card com borda animada (gradient sweep)
  - Animações suaves e modernas
*/

/* ========== MEGA DROPDOWN MENU ========== */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.dropdown-toggle:hover {
  color: var(--accent);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 280px;
  background: rgba(30, 28, 45, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.20);
  padding: 8px;
  z-index: 9999;
  
  /* Estado inicial - escondido */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  
  /* Animação */
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Tema claro - ajuste de background */
body.theme-light .dropdown-menu {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

/* Estado ativo - visível */
.dropdown.active .dropdown-menu,
.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Itens do menu */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dropdown-item .icon {
  transition: transform 0.2s ease;
}

.dropdown-item:hover .icon {
  transform: scale(1.05);
}

/* Divider no menu */
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* Seta do dropdown */
.dropdown-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.2s ease;
}

.dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* ========== CARD COM BORDA ANIMADA ========== */

.card-animated-border {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid transparent;
}

.card-animated-border::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(
    130deg,
    var(--accent),
    var(--primary),
    var(--accent),
    var(--primary)
  );
  background-size: 500% 500%;
  animation: borderRun 6s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-animated-border:hover::before {
  animation-duration: 4s;
  opacity: 0.8;
}

/* Ensure form controls inside the card are above the decorative pseudo-element */
.card-animated-border select,
.card-animated-border .w-100,
.card-animated-border button {
  position: relative;
  z-index: 2;
}

@keyframes borderRun {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Variante sutil (mais discreta) */
.card-animated-border-subtle::before {
  opacity: 0;
}

.card-animated-border-subtle:hover::before {
  opacity: 0.5;
}

/* Variante de perigo (vermelho e branco) */
.card-animated-border-danger {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-bg);
  border: 2px solid var(--error);
}

.card-animated-border-danger::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    #ff0000 0%,
    #ffffff 25%,
    #ff0000 50%,
    #ffffff 75%,
    #ff0000 100%
  );
  background-size: 300% 100%;
  animation: borderRunDanger 6s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.8;
  pointer-events: none;
}

.card-animated-border-danger:hover::before {
  animation-duration: 4s;
  opacity: 1;
}

@keyframes borderRunDanger {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 300% 50%;
  }
}

/* ========== FORM COM BORDA ANIMADA NO FOCO ========== */

.form-animated-border {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.form-animated-border::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: linear-gradient(
    130deg,
    var(--accent),
    var(--primary),
    var(--accent),
    var(--primary)
  );
  background-size: 500% 500%;
  animation: borderRun 6s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.form-animated-border:focus-within::before {
  animation-duration: 4s;
  opacity: 0.8;
}

/* ========== OUTROS EFEITOS VISUAIS ========== */

/* Hover com elevação suave */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Glow effect no hover */
.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 
    0 0 20px rgba(255, 122, 112, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Pulse animation */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from right */
.slide-in-right {
  animation: slideInRight 0.4s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Shimmer effect para loading */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--card-bg) 0%,
    var(--hover-bg) 50%,
    var(--card-bg) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Glass effect (glassmorphism) */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.theme-light .glass {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Badge com pulse */
.badge-pulse {
  position: relative;
}

.badge-pulse::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: inherit;
  animation: badgePulse 2s ease-out infinite;
  opacity: 0;
}

@keyframes badgePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Spotlight effect no hover */
.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.spotlight:hover::before {
  left: 100%;
}

body.theme-light .spotlight::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}
