/* ===========================================
   ANIMATIONS CSS - Portfolio Enhancements
   =========================================== */

/* ---- Typing cursor animation ---- */
.typing-cursor {
  display: inline-block;
  width: 3px;
  background-color: #8cc63f;
  margin-left: 2px;
  animation: blink 0.7s infinite;
}

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

/* ---- Hero section parallax & fade ---- */
.page-home {
  background-attachment: fixed;
  background-size: cover;
  background-position: center center;
}

.caption-header h5,
.caption-header h1,
.caption-header .badge {
  opacity: 0;
  transform: translateY(30px);
  animation: heroFadeUp 0.8s ease forwards;
}

.caption-header h5 { animation-delay: 0.2s; }
.caption-header h1 { animation-delay: 0.5s; }
.caption-header .badge { animation-delay: 0.8s; }

@keyframes heroFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Floating mouse icon bounce ---- */
.floating-button {
  animation: floatBounce 2s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---- Gradient text shimmer on name ---- */
.caption-header h1 b.fg-theme {
  background: linear-gradient(90deg, #8cc63f, #2960f7, #fd7e14, #8cc63f);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShimmer 4s ease infinite;
}

@keyframes gradientShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---- Smooth section reveal on scroll ---- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Staggered card entrance ---- */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Skill badge animations ---- */
.progress-wrapper .btn-theme {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.progress-wrapper .btn-theme:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.progress-wrapper .btn-theme::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.progress-wrapper .btn-theme:hover::after {
  transform: rotate(45deg) translateX(100%);
}

/* ---- Service card hover effects ---- */
.card-service {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  border-radius: 12px;
}

.card-service:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-service .icon {
  transition: transform 0.4s ease, background-color 0.4s ease;
}

.card-service:hover .icon {
  transform: scale(1.1) rotate(5deg);
  background-color: #8cc63f;
  color: #fff;
}

.card-service .icon span {
  transition: color 0.4s ease;
}

.card-service:hover .icon span {
  color: #fff;
}

/* ---- Portfolio / Blog card hover ---- */
.post-grid .card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
  border-radius: 12px;
}

.post-grid .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(140, 152, 164, 0.35);
}

.post-grid .card .img-place {
  overflow: hidden;
}

.post-grid .card .img-place img {
  transition: transform 0.5s ease;
}

.post-grid .card:hover .img-place img {
  transform: scale(1.1);
}

/* ---- Timeline hover effect ---- */
.timeline li {
  transition: transform 0.3s ease;
}

.timeline li:hover {
  transform: translateX(8px);
}

.timeline li .details {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.timeline li:hover .details {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.timeline li::before {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline li:hover::before {
  transform: scale(1.4);
  box-shadow: 0 0 0 4px rgba(116, 116, 116, 0.3);
}

/* ---- About image hover ---- */
.page-about .img-place {
  transition: transform 0.5s ease;
}

.page-about .img-place:hover {
  transform: scale(1.03);
}

.page-about .img-place::before {
  transition: top 0.4s ease, right 0.4s ease;
}

.page-about .img-place:hover::before {
  top: -12px;
  right: -25px;
}

/* ---- Navbar smooth transitions ---- */
.navbar {
  transition: background-color 0.4s ease, padding 0.3s ease;
}

.navbar .nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #8cc63f;
  transition: width 0.3s ease, left 0.3s ease;
}

.navbar .nav-link:hover::after,
.navbar .nav-item.active .nav-link::after {
  width: 100%;
  left: 0;
}

/* ---- Back to top button animation ---- */
.btn-back_to_top {
  transition: visibility 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
}

.btn-back_to_top.visible {
  visibility: visible !important;
  opacity: 1;
}

.btn-back_to_top:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* ---- Footer link hover ---- */
.vg-footer .list-unstyled a {
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease, color 0.3s ease;
}

.vg-footer .list-unstyled a:hover {
  transform: translateX(5px);
  color: #8cc63f !important;
}

/* ---- Download CV button pulse ---- */
.btn-theme-outline {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

/* ---- Badge subhead pulse on scroll ---- */
.badge-subhead {
  transition: transform 0.3s ease;
}

.badge-subhead:hover {
  transform: scale(1.05);
}

/* ---- Particle-like floating dots (hero section) ---- */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.hero-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}

.hero-particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; width: 4px; height: 4px; }
.hero-particle:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; width: 6px; height: 6px; }
.hero-particle:nth-child(3) { left: 40%; animation-duration: 10s; animation-delay: 4s; width: 3px; height: 3px; }
.hero-particle:nth-child(4) { left: 55%; animation-duration: 18s; animation-delay: 1s; width: 5px; height: 5px; }
.hero-particle:nth-child(5) { left: 70%; animation-duration: 14s; animation-delay: 3s; width: 7px; height: 7px; }
.hero-particle:nth-child(6) { left: 85%; animation-duration: 11s; animation-delay: 5s; width: 4px; height: 4px; }
.hero-particle:nth-child(7) { left: 15%; animation-duration: 16s; animation-delay: 6s; width: 5px; height: 5px; }
.hero-particle:nth-child(8) { left: 60%; animation-duration: 13s; animation-delay: 7s; width: 3px; height: 3px; }

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* ---- Smooth page section transitions ---- */
.vg-page {
  transition: background-color 0.3s ease;
}

/* ---- Section divider line animation ---- */
.section-line {
  display: block;
  margin: 20px auto;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #8cc63f, transparent);
  transition: width 1s ease;
}

.section-line.revealed {
  width: 80px;
}

/* ---- Color picker setting animation ---- */
.config {
  transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.color-item {
  transition: transform 0.3s ease;
}

.color-item:hover {
  transform: scale(1.2);
}

/* ---- AJ button pulse ---- */
.btn-fab.btn-theme {
  animation: subtlePulse 3s ease-in-out infinite;
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(140, 198, 63, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(140, 198, 63, 0); }
}

/* ---- Responsive adjustments ---- */
@media (max-width: 768px) {
  .caption-header h1 {
    font-size: 32px;
  }
  
  .hero-particle {
    display: none;
  }
  
  .hero-particle:nth-child(-n+4) {
    display: block;
  }
}

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