/* 
 * Additional animations to showcase AI capabilities
 */

/* Typing animation for headings */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent-blue) }
}

.ai-typing-animation {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent-blue);
  animation: 
    typing 3.5s steps(40, end),
    blink-caret 0.75s step-end infinite;
}

/* AI-powered text generation effect */
.ai-text-generation {
  position: relative;
  display: inline-block;
}

.ai-text-generation::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.5s ease;
}

.ai-text-generation:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Neural network visualization */
.neural-network {
  position: relative;
  height: 200px;
  margin: 2rem 0;
  overflow: hidden;
}

.neural-node {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--accent-blue);
  border-radius: 50%;
  opacity: 0.7;
}

.neural-connection {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  transform-origin: left center;
  opacity: 0.3;
  z-index: -1;
}

/* Data processing animation */
.data-processing {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 2rem 0;
  height: 60px;
}

.data-item {
  width: 40px;
  height: 40px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.data-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 30%, rgba(67, 97, 238, 0.1), transparent 70%);
  transform: translateX(-100%);
}

.data-item.processing::before {
  animation: data-process 2s infinite;
}

.data-item.processed {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: scale(1.05);
}

@keyframes data-process {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* AI decision tree visualization */
.decision-tree {
  position: relative;
  margin: 2rem 0;
  padding-top: 20px;
}

.tree-node {
  position: relative;
  padding: 10px 15px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.tree-node:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.tree-node::before,
.tree-node::after {
  content: '';
  position: absolute;
  background-color: var(--border-color);
}

.tree-node::before {
  top: -10px;
  left: 50%;
  width: 1px;
  height: 10px;
}

.tree-node::after {
  top: -10px;
  width: 50%;
  height: 1px;
}

.tree-node:first-child::before,
.tree-node:first-child::after {
  display: none;
}

.tree-level {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}

/* Voice recognition animation */
.voice-recognition {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  margin: 2rem 0;
}

.voice-bar {
  width: 4px;
  height: 20px;
  margin: 0 2px;
  background-color: var(--accent-blue);
  border-radius: var(--radius-full);
  animation: voice-wave 1.2s ease-in-out infinite;
}

.voice-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.voice-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.voice-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.voice-bar:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes voice-wave {
  0%, 100% { height: 20px; }
  50% { height: 40px; }
}

/* Image recognition animation */
.image-recognition {
  position: relative;
  margin: 2rem 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.image-recognition img {
  width: 100%;
  display: block;
}

.recognition-box {
  position: absolute;
  border: 2px solid var(--accent-blue);
  border-radius: 4px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.5s ease;
}

.recognition-box.active {
  opacity: 1;
  transform: scale(1);
}

.recognition-label {
  position: absolute;
  bottom: -25px;
  left: 0;
  background-color: var(--accent-blue);
  color: white;
  padding: 2px 8px;
  border-radius: 0 0 4px 4px;
  font-size: 0.75rem;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.recognition-box:hover .recognition-label {
  transform: translateY(-25px);
}

/* Sentiment analysis visualization */
.sentiment-analysis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 1rem;
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
}

.sentiment-scale {
  flex-grow: 1;
  height: 6px;
  margin: 0 1rem;
  background: linear-gradient(90deg, #ff4d4d, #ffcc00, #4dff4d);
  border-radius: var(--radius-full);
  position: relative;
}

.sentiment-indicator {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  background-color: white;
  border: 2px solid var(--accent-blue);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 1s ease;
}

.sentiment-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Code generation animation */
.code-generation {
  font-family: var(--font-mono);
  background-color: #1e1e3f;
  color: #a9b7c6;
  padding: 1rem;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  margin: 2rem 0;
}

.code-line {
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.code-line.visible {
  opacity: 1;
  transform: translateX(0);
}

.code-keyword {
  color: #cc7832;
}

.code-string {
  color: #6a8759;
}

.code-comment {
  color: #808080;
}

.code-function {
  color: #ffc66d;
}

.code-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: white;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

/* Floating particles animation */
.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.particle {
  position: absolute;
  background-color: var(--accent-blue);
  border-radius: 50%;
  opacity: 0.3;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  100% {
    transform: translateY(-100vh) rotate(360deg);
  }
}
