/**
 * InternEzy — Modern Minimal Interactive Animations
 * Handles cursor spotlight, 3D card tilt, click ripples, and page-specific micro-interactions.
 */

/* Responsive to user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor-glow, .click-ripple {
    display: none !important;
  }
}

/* Base cursor spotlight container */
.cursor-glow-container {
  position: relative;
  overflow: hidden;
}

/* Card Spotlight Glow */
.spotlight-card {
  position: relative;
  background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  will-change: transform;
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(
    450px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(11, 184, 156, 0.08),
    rgba(37, 99, 235, 0.05) 50%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card:hover {
  border-color: rgba(11, 184, 156, 0.4);
  box-shadow: 0 12px 28px -8px rgba(10, 31, 68, 0.08), 0 0 1px 1px rgba(11, 184, 156, 0.12);
}

/* Global Click Ripple Effect */
.click-ripple {
  position: fixed;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(11, 184, 156, 0.35) 0%, rgba(37, 99, 235, 0.2) 60%, transparent 100%);
  border: 1.5px solid rgba(11, 184, 156, 0.5);
  animation: ripple-expand 0.45s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
}

@keyframes ripple-expand {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.5);
    opacity: 0;
  }
}

/* Magnetic Button Feel */
.magnetic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
  will-change: transform;
}

.magnetic-btn:active {
  transform: scale(0.97) !important;
}

/* -------------------------------------------------------------------------- */
/* Page Specific Nuances                                                      */
/* -------------------------------------------------------------------------- */

/* 1. Home Page: Subtle Ambient Grid Illumination */
[data-page="home"] .hero-section {
  position: relative;
  background-image: 
    radial-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: var(--grid-offset-x, 0px) var(--grid-offset-y, 0px);
}

/* 2. Courses Page: Node / Tech Pulse on Hover */
[data-page="courses"] .spotlight-card:hover,
[data-page="course-detail"] .spotlight-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

/* 3. Career & Mentor Page: Elevation Trajectory */
[data-page="career"] .spotlight-card:hover,
[data-page="mentor"] .spotlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -10px rgba(37, 99, 235, 0.12);
}

/* 4. Contact Page: Focus Ring Glow */
[data-page="contact"] .form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
