﻿/* Custom Animations for Portfolio */

/* Smooth fade-in animation for page load */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gradient animation for backgrounds */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Pulse effect for attention */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Hover effects for cards */
.portfolio-card,
.archive__item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeIn 0.6s ease-out;
}

.portfolio-card:hover,
.archive__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Author profile animation */
.author__avatar {
  transition: transform 0.3s ease;
  animation: scaleIn 0.5s ease-out;
}

.author__avatar:hover {
  transform: scale(1.05) rotate(2deg);
}

/* Page content fade in */
.page__content {
  animation: fadeIn 0.8s ease-out;
}

/* Sidebar animation */
.sidebar {
  animation: slideInLeft 0.6s ease-out;
}

/* Main content animation */
#main {
  animation: slideInRight 0.6s ease-out;
}

/* Button hover effects */
.btn,
.author__urls-wrapper button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover,
.author__urls-wrapper button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Link hover effects */
a {
  transition: color 0.3s ease;
  position: relative;
}

.page__content a:not(.btn):hover {
  color: #0066cc;
}

.page__content a:not(.btn)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: width 0.3s ease;
}

.page__content a:not(.btn):hover::after {
  width: 100%;
}

/* Animated gradient background option */
.gradient-background {
  background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #4facfe);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Section dividers with animation */
.section-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, #667eea, transparent);
  margin: 2rem 0;
  animation: fadeIn 1s ease-out;
}

/* Portfolio grid animations */
.archive__item:nth-child(1) { animation-delay: 0.1s; }
.archive__item:nth-child(2) { animation-delay: 0.2s; }
.archive__item:nth-child(3) { animation-delay: 0.3s; }
.archive__item:nth-child(4) { animation-delay: 0.4s; }
.archive__item:nth-child(5) { animation-delay: 0.5s; }
.archive__item:nth-child(6) { animation-delay: 0.6s; }

/* Typing effect for headers (optional) */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

/* Skills badges with hover effect */
.skill-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  margin: 0.3rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
}

.skill-badge:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Responsive animations - disable on mobile for performance */
@media (max-width: 768px) {
  .archive__item,
  .portfolio-card {
    animation: fadeIn 0.4s ease-out;
  }

  .author__avatar:hover {
    transform: none;
  }
}

/* Loading spinner (optional) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-spinner {
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-left-color: #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Parallax effect helper */
.parallax-element {
  transition: transform 0.3s ease-out;
}

/* Image zoom on hover */
.archive__item-teaser img {
  transition: transform 0.5s ease;
}

.archive__item-teaser:hover img {
  transform: scale(1.1);
}

/* Text highlight animation */
@keyframes highlight {
  0% {
    background-size: 0% 100%;
  }
  100% {
    background-size: 100% 100%;
  }
}

.text-highlight {
  background: linear-gradient(120deg, #f093fb 0%, #f5576c 100%);
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: 0 100%;
  animation: highlight 1s ease-out forwards;
  padding: 0 0.2rem;
  color: white;
}

/* Icon animation on hover */
.social-icons a {
  transition: all 0.3s ease;
}

.social-icons a:hover {
  transform: translateY(-3px) scale(1.1);
}

/* Staggered list animation */
.cv-list li {
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

.cv-list li:nth-child(1) { animation-delay: 0.1s; }
.cv-list li:nth-child(2) { animation-delay: 0.2s; }
.cv-list li:nth-child(3) { animation-delay: 0.3s; }
.cv-list li:nth-child(4) { animation-delay: 0.4s; }
.cv-list li:nth-child(5) { animation-delay: 0.5s; }
