/* ============================================
   MICRO-INTERACTIONS & SUBTLE ANIMATIONS
   Enhancing UX with smooth, professional interactions
   ============================================ */

/* === SMOOTH SCROLL BEHAVIOR === */
html {
  scroll-behavior: smooth;
}

/* === FOCUS VISIBLE STATES === */
*:focus-visible {
  outline: 2px solid var(--accent-cyan, #00E5FF);
  outline-offset: 4px;
  border-radius: 4px;
  transition: outline-offset 0.2s ease;
}

/* === BUTTON RIPPLE EFFECT === */
.btn-accent,
.hero-btn-primary,
.hero-btn-secondary,
.form-submit-btn,
.resume-download-btn {
  position: relative;
  overflow: hidden;
}

.btn-accent::before,
.hero-btn-primary::before,
.hero-btn-secondary::before,
.form-submit-btn::before,
.resume-download-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-accent:active::before,
.hero-btn-primary:active::before,
.hero-btn-secondary:active::before,
.form-submit-btn:active::before,
.resume-download-btn:active::before {
  width: 300px;
  height: 300px;
}

/* === CARD HOVER LIFT === */
.about-card,
.project-card-modern,
.project-hero-card,
.skill-card-modern,
.education-card,
.contact-info-card,
.resume-highlights-card,
.resume-download-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-card:hover,
.project-card-modern:hover,
.project-hero-card:hover,
.skill-card-modern:hover,
.education-card:hover,
.contact-info-card:hover,
.resume-highlights-card:hover,
.resume-download-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 229, 255, 0.2),
    0 0 40px rgba(123, 47, 247, 0.15);
}

/* === ICON PULSE ANIMATION === */
@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.hero-icon-link:hover i,
.social-icon:hover i,
.info-icon:hover i {
  animation: iconPulse 0.6s ease-in-out;
}

/* === TEXT SELECTION STYLING === */
::selection {
  background: rgba(0, 229, 255, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(0, 229, 255, 0.3);
  color: #fff;
}

/* === SMOOTH IMAGE LOADING === */
img {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

img[loading="lazy"] {
  opacity: 0;
  animation: fadeInImage 0.5s ease forwards;
}

@keyframes fadeInImage {
  to {
    opacity: 1;
  }
}

/* === LINK HOVER UNDERLINE ANIMATION === */
a:not(.btn):not(.nav-link):not(.hero-icon-link):not(.social-icon) {
  position: relative;
  transition: color 0.3s ease;
}

a:not(.btn):not(.nav-link):not(.hero-icon-link):not(.social-icon)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--accent-cyan, #00E5FF);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:not(.btn):not(.nav-link):not(.hero-icon-link):not(.social-icon):hover::after {
  width: 100%;
}

/* === SKILL BADGE GLOW === */
.skill-badge,
.tech-badge,
.project-tech-badge,
.hero-tech-tag {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-badge::before,
.tech-badge::before,
.project-tech-badge::before,
.hero-tech-tag::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-cyan, #00E5FF), var(--accent-purple, #7B2FF7));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  filter: blur(8px);
}

.skill-badge:hover::before,
.tech-badge:hover::before,
.project-tech-badge:hover::before,
.hero-tech-tag:hover::before {
  opacity: 0.6;
}

/* === FORM INPUT FOCUS ANIMATION === */
.form-input,
.form-textarea {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus,
.form-textarea:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 229, 255, 0.2);
}

/* === STAT NUMBER COUNTER ANIMATION === */
.stat-number,
.stat-value,
.hero-metric-value {
  display: inline-block;
  transition: transform 0.3s ease;
}

.stat-item:hover .stat-number,
.stat-item:hover .stat-value,
.hero-metric-item:hover .hero-metric-value {
  transform: scale(1.15);
  color: var(--accent-cyan, #00E5FF);
}

/* === SCROLL PROGRESS INDICATOR === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan, #00E5FF), var(--accent-purple, #7B2FF7));
  z-index: 9999;
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* === NAVBAR SCROLL SHADOW === */
.navbar-modern {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.navbar-modern.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* === PROJECT CARD IMAGE ZOOM === */
.project-card-image img,
.project-hero-image img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-modern:hover .project-card-image img,
.project-hero-card:hover .project-hero-image img {
  transform: scale(1.08);
}

/* === TOOLTIP ANIMATION === */
.copy-email-tooltip,
[data-tooltip] {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.copy-email-tooltip.show,
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* === LOADING SPINNER === */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--accent-cyan, #00E5FF);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* === STAGGER ANIMATION FOR LISTS === */
/* DISABLED - Can cause lag on some devices
.skill-card-modern,
.project-card-modern,
.highlight-item,
.expertise-item {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

.skill-card-modern:nth-child(1) { animation-delay: 0.1s; }
.skill-card-modern:nth-child(2) { animation-delay: 0.15s; }
.skill-card-modern:nth-child(3) { animation-delay: 0.2s; }
.skill-card-modern:nth-child(4) { animation-delay: 0.25s; }
.skill-card-modern:nth-child(5) { animation-delay: 0.3s; }
.skill-card-modern:nth-child(6) { animation-delay: 0.35s; }
.skill-card-modern:nth-child(7) { animation-delay: 0.4s; }
.skill-card-modern:nth-child(8) { animation-delay: 0.45s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
*/

/* === BUTTON SHINE EFFECT === */
@keyframes buttonShine {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

.btn-accent::after,
.hero-btn-primary::after,
.resume-download-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent);
  transition: left 0.5s ease;
}

.btn-accent:hover::after,
.hero-btn-primary:hover::after,
.resume-download-btn:hover::after {
  animation: buttonShine 1s ease;
}

/* === CURSOR POINTER FOR INTERACTIVE ELEMENTS === */
.skill-card-modern,
.project-card-modern,
.project-hero-card,
.hero-icon-link,
.social-icon,
.filter-btn,
.nav-link,
.mobile-nav-link {
  cursor: pointer;
}

/* === REDUCED MOTION SUPPORT === */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* === DARK MODE SUPPORT (Future Enhancement) === */
@media (prefers-color-scheme: light) {
  /* Portfolio is designed for dark theme, but we can add light mode support later */
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {

  .about-card,
  .project-card-modern,
  .skill-card-modern {
    border-width: 2px;
  }
}

/* === MOBILE TOUCH FEEDBACK === */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover effects on touch devices */
  .about-card:hover,
  .project-card-modern:hover,
  .skill-card-modern:hover {
    transform: none;
  }

  /* Add active states instead */
  .about-card:active,
  .project-card-modern:active,
  .skill-card-modern:active {
    transform: scale(0.98);
  }
}

/* === PRINT STYLES === */
@media print {

  .navbar-modern,
  .scroll-progress,
  .scroll-down-arrow,
  .hero-social-icons {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .about-card,
  .project-card-modern,
  .skill-card-modern {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}