/**
 * Premium Effects & Interactions
 * Glassmorphism, Floating Cards, Micro-interactions
 */

/* ===== Glassmorphism Effect ===== */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-navbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

/* ===== Floating Cards ===== */
.floating-card {
  border-radius: 16px;
  box-shadow: var(--shadow-float);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.floating-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--secondary-500), var(--success));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.floating-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-2xl);
}

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

/* ===== Glow Effects ===== */
.glow-primary {
  box-shadow: var(--shadow-glow);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
  }
}

.glow-success {
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

/* ===== Premium Button Effects ===== */
.btn-premium {
  background: var(--gradient-secondary);
  color: white;
  padding: 16px 32px;
  border-radius: var(--radius-full);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-secondary);
}

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

.btn-premium:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--shadow-glow);
}

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

.btn-premium:active {
  transform: translateY(0) scale(0.98);
}

/* ===== Shimmer Effect ===== */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ===== Ripple Effect ===== */
.ripple {
  position: relative;
  overflow: hidden;
}

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

.ripple:active::after {
  width: 300px;
  height: 300px;
  opacity: 0;
}

/* ===== Gradient Border ===== */
.gradient-border {
  position: relative;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--secondary-500), var(--success));
}

.gradient-border-content {
  background: white;
  border-radius: 14px;
  padding: 20px;
}

/* ===== Micro Interactions ===== */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
}

/* ===== Smooth Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Premium Card Styles ===== */
.premium-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.05), transparent);
  transition: left 0.6s;
}

.premium-card:hover::before {
  left: 100%;
}

.premium-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2xl);
  border-color: var(--secondary-200);
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Animated Underline ===== */
.animated-underline {
  position: relative;
  text-decoration: none;
}

.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-500);
  transition: width 0.3s ease;
}

.animated-underline:hover::after {
  width: 100%;
}

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== Pulse Animation ===== */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* ===== Bounce Animation ===== */
.bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-5%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* ===== Fade In Animations ===== */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.fade-in-down {
  animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Slide In Animations ===== */
.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== Floating Animation ===== */
.float {
  animation: float 6s ease-in-out infinite;
}

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

/* ===== Rotate Animation ===== */
.rotate {
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ===== Beam Effect (Magic UI inspired) ===== */
.beam-card {
  position: relative;
  overflow: hidden;
}

.beam-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -200%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.1) 25%,
    rgba(99, 102, 241, 0.3) 50%,
    rgba(99, 102, 241, 0.1) 75%,
    transparent 100%
  );
  animation: beam-sweep 4s ease-in-out infinite;
  transform: skewX(-20deg);
}

@keyframes beam-sweep {
  0% {
    left: -200%;
  }
  50%, 100% {
    left: 200%;
  }
}

/* ===== Enhanced Glassmorphism for Cards ===== */
.glass-card-enhanced {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ===== Pulse Glow for Featured Cards ===== */
.pulse-glow-featured {
  animation: pulse-glow-featured 3s ease-in-out infinite;
}

@keyframes pulse-glow-featured {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(99, 102, 241, 0.4),
      0 0 40px rgba(99, 102, 241, 0.2),
      0 8px 32px rgba(15, 23, 42, 0.15);
  }
  50% {
    box-shadow: 
      0 0 40px rgba(99, 102, 241, 0.6),
      0 0 80px rgba(99, 102, 241, 0.3),
      0 12px 48px rgba(15, 23, 42, 0.2);
  }
}

/* ===== 3D Transform Effects ===== */
.transform-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.transform-3d-hover {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.transform-3d-hover:hover {
  transform: 
    perspective(1000px)
    rotateX(2deg)
    rotateY(-2deg)
    translateY(-8px)
    scale(1.02);
}

/* ===== Staggered Fade In Up ===== */
.stagger-fade-in-1 {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.stagger-fade-in-2 {
  animation: fadeInUp 0.8s ease-out 0.5s both;
}

.stagger-fade-in-3 {
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stagger-fade-in-4 {
  animation: fadeInUp 0.8s ease-out 1.1s both;
}

/* ===== Enhanced Hover Lift with Depth ===== */
.hover-lift-depth {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift-depth:hover {
  transform: translateY(-12px);
  box-shadow: 
    0 20px 40px rgba(15, 23, 42, 0.15),
    0 0 60px rgba(99, 102, 241, 0.1);
}

/* ===== Gradient Border Animated ===== */
.gradient-border-animated {
  position: relative;
  border-radius: 16px;
}

.gradient-border-animated::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(
    45deg,
    var(--secondary-500),
    var(--success),
    var(--secondary-500)
  );
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient-rotate 3s linear infinite;
}

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

/* ===== Spotlight Effect ===== */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.15) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

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