/* Custom CSS Effects for Image Replacement */

/* Enhanced Hero Visual Elements */
.hero-visual {
  width: 80%;
  height: 80%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  transform-style: preserve-3d;
  box-shadow: 0 15px 35px rgba(var(--primary-rgb), 0.3);
}

.hero-visual:before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  z-index: 1;
  animation: rotate 20s linear infinite;
}

.hero-container {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Abstract geometric pattern backgrounds */
.abstract-pattern {
  position: relative;
  overflow: hidden;
}

.abstract-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  z-index: 0;
  background-image: 
    linear-gradient(30deg, var(--primary-color) 12%, transparent 12.5%, transparent 87%, var(--primary-color) 87.5%, var(--primary-color)),
    linear-gradient(150deg, var(--primary-color) 12%, transparent 12.5%, transparent 87%, var(--primary-color) 87.5%, var(--primary-color)),
    linear-gradient(30deg, var(--primary-color) 12%, transparent 12.5%, transparent 87%, var(--primary-color) 87.5%, var (--primary-color)),
    linear-gradient(150deg, var(--primary-color) 12%, transparent 12.5%, transparent 87%, var(--primary-color) 87.5%, var(--primary-color)),
    linear-gradient(60deg, var(--accent-color) 25%, transparent 25.5%, transparent 75%, var(--accent-color) 75%, var(--accent-color)),
    linear-gradient(60deg, var(--accent-color) 25%, transparent 25.5%, transparent 75%, var(--accent-color) 75%, var(--accent-color));
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
}

/* Hexagon grid pattern */
.hex-pattern {
  position: relative;
  overflow: hidden;
}

.hex-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.07;
  z-index: 0;
  background-color: transparent;
  background-image: 
    linear-gradient(var(--primary-color) 1px, transparent 1px),
    linear-gradient(to right, var(--primary-color) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hex-pattern::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.07;
  z-index: 0;
  background-image: 
    radial-gradient(var(--accent-color) 2px, transparent 2px);
  background-size: 60px 60px;
  background-position: 0 0;
}

/* Interactive tech pattern */
.tech-pattern {
  position: relative;
  overflow: hidden;
}

.tech-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  z-index: 0;
  background-image: 
    repeating-linear-gradient(0deg, var(--primary-color), var(--primary-color) 1px, transparent 1px, transparent 20px),
    repeating-linear-gradient(90deg, var(--primary-color), var(--primary-color) 1px, transparent 1px, transparent 20px),
    linear-gradient(0deg, rgba(var(--primary-rgb), 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--primary-rgb), 0.1) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  animation: tech-pattern-move 10s linear infinite;
}

@keyframes tech-pattern-move {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }
  to {
    background-position: 100px 0, 100px 0, 20px 0, 20px 0;
  }
}

/* Circuit board pattern */
.circuit-pattern {
  position: relative;
  overflow: hidden;
}

.circuit-pattern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  z-index: 0;
  background: 
    linear-gradient(to bottom, transparent 9px, var(--primary-color) 10px, transparent 11px) 0 0,
    linear-gradient(to right, transparent 9px, var(--primary-color) 10px, transparent 11px) 0 0,
    radial-gradient(circle at 10px 10px, var(--accent-color) 2px, transparent 3px) 0 0;
  background-size: 40px 40px, 40px 40px, 40px 40px;
}

/* Glowing dots */
.glowing-dots {
  position: relative;
  overflow: hidden;
}

.glowing-dots::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  z-index: 0;
  background-image: 
    radial-gradient(var(--primary-color) 1px, transparent 2px),
    radial-gradient(var(--accent-color) 1px, transparent 2px);
  background-size: 50px 50px;
  background-position: 0 0, 25px 25px;
  animation: pulse-dots 3s ease infinite alternate;
}

@keyframes pulse-dots {
  0% {
    opacity: 0.2;
  }
  100% {
    opacity: 0.4;
  }
}

/* Code editor-like graphics */
.code-background {
  background-color: #1e1e2e;
  position: relative;
  overflow: hidden;
}

.code-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.07;
  z-index: 0;
  background-image: 
    linear-gradient(to bottom, transparent 19px, rgba(255, 255, 255, 0.05) 20px),
    linear-gradient(to right, transparent 49px, rgba(255, 255, 255, 0.05) 50px);
  background-size: 20px 20px, 50px 50px;
}

/* Enhanced glow for elements */
.glow-hover {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.glow-hover:hover {
  box-shadow: 
    0 0 10px rgba(var(--primary-rgb), 0.5),
    0 0 30px rgba(var(--primary-rgb), 0.3),
    0 0 50px rgba(var(--primary-rgb), 0.1);
  transform: translateY(-5px);
}

/* Animated gradient border */
.gradient-border {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  z-index: -1;
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--accent-color),
    var(--secondary-color),
    var(--primary-color)
  );
  background-size: 400% 400%;
  animation: gradient-move 4s ease infinite;
  border-radius: 10px;
}

@keyframes gradient-move {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Hero element abstract shapes */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.glow-1 {
  width: 60%;
  height: 60%;
  background: var(--primary-color);
  top: 20%;
  left: 20%;
  opacity: 0.3;
  animation: float-glow 7s ease-in-out infinite;
}

.glow-2 {
  width: 40%;
  height: 40%;
  background: var(--accent-color);
  bottom: 10%;
  right: 20%;
  opacity: 0.2;
  animation: float-glow 9s ease-in-out infinite 1s;
}

.glow-3 {
  width: 30%;
  height: 30%;
  background: var(--secondary-color);
  top: 15%;
  right: 15%;
  opacity: 0.15;
  animation: float-glow 8s ease-in-out infinite 2s;
}

@keyframes float-glow {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10px, -10px);
  }
}

/* Enhanced Abstract Patterns */
.abstract-image {
  position: relative;
  height: 100%;
  width: 100%;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-color));
  border-radius: 8px;
  overflow: hidden;
}

.abstract-image:before,
.abstract-image:after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(15px);
  animation: float-glow 10s ease-in-out infinite alternate;
}

.abstract-image:before {
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
  top: -20%;
  right: -20%;
  opacity: 0.4;
  animation-delay: 1s;
}

.abstract-image:after {
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
  bottom: -20%;
  left: -10%;
  opacity: 0.3;
  animation-delay: 2s;
}

/* Data visualization style charts */
.data-visual {
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px;
}

.data-bar {
  width: 8%;
  background: linear-gradient(to top, var(--primary-color), var(--accent-color));
  border-radius: 4px 4px 0 0;
  animation: data-bar-rise 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform-origin: bottom;
  opacity: 0;
}

.data-bar:nth-child(odd) {
  animation-delay: 0.2s;
}

.data-bar:nth-child(even) {
  animation-delay: 0.4s;
}

@keyframes data-bar-rise {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    height: var(--height, 80%);
    opacity: 1;
  }
}

/* Interactive radar chart */
.radar-chart {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.radar-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 50%;
}

.radar-circle:nth-child(1) { width: 40%; height: 40%; }
.radar-circle:nth-child(2) { width: 60%; height: 60%; }
.radar-circle:nth-child(3) { width: 80%; height: 80%; }
.radar-circle:nth-child(4) { width: 100%; height: 100%; }

.radar-shape {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background-color: rgba(var(--primary-rgb), 0.2);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  z-index: 1;
}

/* Progressive Loading Effect for Elements */
@keyframes progressive-appear {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.progressive-load {
  opacity: 0;
  animation: progressive-appear 0.5s ease-out forwards;
}

.progressive-delay-1 { animation-delay: 0.1s; }
.progressive-delay-2 { animation-delay: 0.2s; }
.progressive-delay-3 { animation-delay: 0.3s; }
.progressive-delay-4 { animation-delay: 0.4s; }
.progressive-delay-5 { animation-delay: 0.5s; }

/* Enhanced Parallax Movement */
.parallax-element {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Code Visualization Enhancements */
.code-visual-container {
  height: 100%;
  width: 100%;
}

.code-visual {
  padding-top: 30px;
}

.code-line {
  margin: 10px 0;
  padding: 0 15px;
  animation: typing-code 1.5s steps(30, end);
}

@keyframes typing-code {
  from { width: 0; opacity: 0; }
  to { width: 100%; opacity: 1; }
}

/* Media query for reduced animations */
@media (prefers-reduced-motion) {
  .tech-pattern::before,
  .gradient-border::before,
  .hero-glow,
  .float, .float-delayed, .float-reverse,
  .abstract-image:before, .abstract-image:after,
  .hero-visual:before,
  .progressive-load {
    animation: none !important;
    transition: none !important;
  }
  
  .data-bar {
    animation: none;
    height: var(--height, 80%);
    opacity: 1;
  }
  
  .code-line {
    animation: none;
  }
}
