/* Animated Border Effect - Similar to VS Code */

/* Base Animation */
@keyframes borderRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(0deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(360deg);
  }
}

@keyframes glow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Animated Border Container */
.animated-border-wrapper {
  position: relative;
  padding: 2px;
  border-radius: 12px;
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.4),
    rgba(118, 75, 162, 0.4),
    rgba(102, 126, 234, 0.4)
  );
  background-size: 200% 200%;
  animation: borderRotate 3s ease-in-out infinite;
}

.animated-border-wrapper:hover {
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.8),
    rgba(118, 75, 162, 0.8),
    rgba(102, 126, 234, 0.8)
  );
  background-size: 200% 200%;
  animation: borderRotate 2s ease-in-out infinite;
}

.animated-border-content {
  background: white;
  border-radius: 10px;
  height: 100%;
  width: 100%;
}

/* Shimmer Effect */
.shimmer-effect {
  position: relative;
  overflow: hidden;
}

.shimmer-effect::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(102, 126, 234, 0.3) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite;
  pointer-events: none;
}

/* Glow Border Effect */
.glow-border {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(90deg, 
                rgba(102, 126, 234, 0.5), 
                rgba(118, 75, 162, 0.5), 
                rgba(102, 126, 234, 0.5)
              ) border-box;
  background-size: 200% 200%;
  animation: borderRotate 3s linear infinite;
  border-radius: 12px;
}

.glow-border:hover {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5),
              0 0 40px rgba(102, 126, 234, 0.3);
}

/* Rotating Border */
.rotating-border {
  position: relative;
  border-radius: 12px;
  padding: 2px;
}

.rotating-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(
    45deg,
    rgba(102, 126, 234, 0.6),
    rgba(118, 75, 162, 0.6),
    rgba(59, 130, 246, 0.6),
    rgba(102, 126, 234, 0.6)
  );
  background-size: 300% 300%;
  animation: borderRotate 4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Pulse Glow */
.pulse-glow {
  position: relative;
  animation: glow 2s ease-in-out infinite;
}

.pulse-glow::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.3),
    rgba(118, 75, 162, 0.3)
  );
  filter: blur(8px);
  opacity: 0;
  animation: glow 2s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

/* Card Specific */
.animated-card {
  position: relative;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.animated-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(
    90deg,
    #667eea,
    #764ba2,
    #667eea
  );
  background-size: 200% 100%;
  animation: borderRotate 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, 
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.animated-card:hover::before {
  opacity: 1;
}

/* Button Animation */
.animated-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.animated-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.animated-btn:hover::before {
  left: 100%;
}

/* Stats Card Glow */
.stats-card-animated {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.stats-card-animated::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    45deg,
    rgba(102, 126, 234, 0.5),
    rgba(118, 75, 162, 0.5),
    rgba(16, 185, 129, 0.5),
    rgba(245, 158, 11, 0.5)
  );
  background-size: 400% 400%;
  animation: borderRotate 5s ease infinite;
  border-radius: 14px;
  z-index: -1;
  filter: blur(4px);
  opacity: 0.7;
}

/* University Card Animation */
.university-card-animated {
  position: relative;
  transition: all 0.3s ease;
}

.university-card-animated::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  border: 2px solid transparent;
  background: linear-gradient(135deg, #667eea, #764ba2) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, 
                linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.university-card-animated:hover::after {
  opacity: 1;
  animation: borderRotate 2s linear infinite;
  background: linear-gradient(
    90deg,
    rgba(102, 126, 234, 0.8),
    rgba(118, 75, 162, 0.8),
    rgba(102, 126, 234, 0.8)
  ) border-box;
  background-size: 200% 100%;
}

/* Focus Glow */
.focus-glow:focus,
.focus-glow:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3),
              0 0 20px rgba(102, 126, 234, 0.2);
  border-color: #667eea;
}

/* Loading Shimmer */
.loading-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: borderRotate 1.5s ease-in-out infinite;
}

/* Neon Border */
.neon-border {
  position: relative;
  border: 2px solid #667eea;
  border-radius: 12px;
  box-shadow: 
    0 0 5px #667eea,
    0 0 10px #667eea,
    0 0 20px #667eea,
    inset 0 0 5px #667eea;
  animation: glow 1.5s ease-in-out infinite;
}

/* Gradient Border Animation */
@keyframes gradientBorder {
  0%, 100% {
    border-image-source: linear-gradient(90deg, #667eea, #764ba2);
  }
  25% {
    border-image-source: linear-gradient(180deg, #764ba2, #667eea);
  }
  50% {
    border-image-source: linear-gradient(270deg, #667eea, #764ba2);
  }
  75% {
    border-image-source: linear-gradient(360deg, #764ba2, #667eea);
  }
}

.gradient-border-animated {
  border: 3px solid;
  border-image-slice: 1;
  border-image-source: linear-gradient(90deg, #667eea, #764ba2);
  animation: gradientBorder 3s linear infinite;
  border-radius: 12px;
}

/* Scanning Line Effect */
.scan-line {
  position: relative;
  overflow: hidden;
}

.scan-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(102, 126, 234, 0.5),
    transparent
  );
  animation: scan 3s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% {
    top: -100%;
  }
  50% {
    top: 100%;
  }
}

/* Rainbow Border */
@keyframes rainbow {
  0%, 100% { border-color: #667eea; }
  14% { border-color: #764ba2; }
  28% { border-color: #3b82f6; }
  42% { border-color: #10b981; }
  57% { border-color: #f59e0b; }
  71% { border-color: #ef4444; }
  85% { border-color: #8b5cf6; }
}

.rainbow-border {
  border: 2px solid #667eea;
  animation: rainbow 5s linear infinite;
  border-radius: 12px;
}
