/* ===== BUDDYSTORE ENHANCED EFFECTS ===== */
/* Advanced styling enhancements while preserving structure */

/* ===== RIPPLE EFFECTS ===== */

/* Ripple effect container */
.ripple-container {
  position: relative;
  overflow: hidden;
}

/* Ripple animation */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
  z-index: 1;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Enhanced button ripple effects */
.btn, button, .telegram-login, .header-btn, .add-user-btn, .logout-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== ENHANCED PARTICLE SYSTEM ===== */

/* Fixed particle system that doesn't stop at top on reload */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.6), rgba(0, 198, 255, 0.3), transparent);
  border-radius: 50%;
  filter: blur(1px);
  animation: particleFloat 12s infinite linear;
  will-change: transform;
}

/* Randomized particle positions and sizes */
.particle:nth-child(1) { 
  left: 5%; 
  width: 8px; 
  height: 8px; 
  animation-duration: 15s;
}
.particle:nth-child(2) { 
  left: 15%; 
  width: 12px; 
  height: 12px; 
  animation-duration: 18s;
}
.particle:nth-child(3) { 
  left: 25%; 
  width: 4px; 
  height: 4px; 
  animation-duration: 12s;
}
.particle:nth-child(4) { 
  left: 35%; 
  width: 10px; 
  height: 10px; 
  animation-duration: 20s;
}
.particle:nth-child(5) { 
  left: 45%; 
  width: 6px; 
  height: 6px; 
  animation-duration: 14s;
}
.particle:nth-child(6) { 
  left: 55%; 
  width: 14px; 
  height: 14px; 
  animation-duration: 16s;
}
.particle:nth-child(7) { 
  left: 65%; 
  width: 3px; 
  height: 3px; 
  animation-duration: 22s;
}
.particle:nth-child(8) { 
  left: 75%; 
  width: 9px; 
  height: 9px; 
  animation-duration: 13s;
}
.particle:nth-child(9) { 
  left: 85%; 
  width: 7px; 
  height: 7px; 
  animation-duration: 17s;
}
.particle:nth-child(10) { 
  left: 95%; 
  width: 5px; 
  height: 5px; 
  animation-duration: 19s;
}
.particle:nth-child(11) { 
  left: 12%; 
  width: 11px; 
  height: 11px; 
  animation-duration: 21s;
}
.particle:nth-child(12) { 
  left: 22%; 
  width: 4px; 
  height: 4px; 
  animation-duration: 11s;
}
.particle:nth-child(13) { 
  left: 32%; 
  width: 13px; 
  height: 13px; 
  animation-duration: 24s;
}
.particle:nth-child(14) { 
  left: 42%; 
  width: 6px; 
  height: 6px; 
  animation-duration: 15s;
}
.particle:nth-child(15) { 
  left: 52%; 
  width: 8px; 
  height: 8px; 
  animation-duration: 18s;
}
.particle:nth-child(16) { 
  left: 62%; 
  width: 15px; 
  height: 15px; 
  animation-duration: 23s;
}
.particle:nth-child(17) { 
  left: 72%; 
  width: 5px; 
  height: 5px; 
  animation-duration: 12s;
}
.particle:nth-child(18) { 
  left: 82%; 
  width: 10px; 
  height: 10px; 
  animation-duration: 16s;
}
.particle:nth-child(19) { 
  left: 92%; 
  width: 7px; 
  height: 7px; 
  animation-duration: 20s;
}
.particle:nth-child(20) { 
  left: 8%; 
  width: 12px; 
  height: 12px; 
  animation-duration: 14s;
}
.particle:nth-child(21) { 
  left: 18%; 
  width: 4px; 
  height: 4px; 
  animation-duration: 17s;
}
.particle:nth-child(22) { 
  left: 28%; 
  width: 9px; 
  height: 9px; 
  animation-duration: 19s;
}
.particle:nth-child(23) { 
  left: 38%; 
  width: 6px; 
  height: 6px; 
  animation-duration: 13s;
}
.particle:nth-child(24) { 
  left: 48%; 
  width: 11px; 
  height: 11px; 
  animation-duration: 21s;
}
.particle:nth-child(25) { 
  left: 58%; 
  width: 8px; 
  height: 8px; 
  animation-duration: 15s;
}

/* Enhanced particle animation - no delay, starts from random positions */
@keyframes particleFloat {
  0% {
    transform: translateY(calc(100vh + 50px)) rotate(0deg) scale(0);
    opacity: 0;
  }
  5% {
    opacity: 1;
    transform: translateY(calc(100vh + 30px)) rotate(18deg) scale(1);
  }
  95% {
    opacity: 1;
    transform: translateY(-50px) rotate(342deg) scale(1);
  }
  100% {
    transform: translateY(-100px) rotate(360deg) scale(0);
    opacity: 0;
  }
}

/* Mouse interaction particles */
.particle-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #007aff, transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: trailFade 1s ease-out forwards;
  z-index: 9999;
}

@keyframes trailFade {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0);
  }
}

/* ===== ENHANCED BUTTON EFFECTS ===== */

/* Magnetic 3D button effects */
.btn:hover, button:hover, .telegram-login:hover, .header-btn:hover, .add-user-btn:hover, .logout-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3);
}

.btn:active, button:active, .telegram-login:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

/* Enhanced glow effect */
.btn.primary, .header-btn.primary, .add-user-btn {
  box-shadow: 0 0 20px rgba(0, 122, 255, 0.3);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(0, 122, 255, 0.3);
  }
  50% { 
    box-shadow: 0 0 30px rgba(0, 122, 255, 0.5);
  }
}

/* ===== ENHANCED CARD EFFECTS ===== */

/* Enhanced card hover effects */
.package-card, .card, .login-box, .stat-card, .settings-section {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateZ(0);
}

.package-card:hover, .card:hover, .stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.login-box:hover {
  transform: translateY(-5px) scale(1.01);
}

.settings-section:hover {
  transform: translateY(-3px);
}

/* ===== ENHANCED FORM EFFECTS ===== */

/* Input focus animations */
.form-input, .form-select, .form-textarea, input, select, textarea {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.form-input:focus, .form-select:focus, .form-textarea:focus, input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced form validation */
.form-input:invalid:not(:placeholder-shown), .form-select:invalid:not(:placeholder-shown) {
  border-color: #ff3b30;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ===== ENHANCED FEATURE ICONS ===== */

/* Feature icon animations */
.feature-icon {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}

.feature-item:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

/* ===== ENHANCED ACHIEVEMENT BADGES ===== */

.achievement-badge, .badge, .membership-badge {
  position: relative;
  overflow: hidden;
  animation: badgeGlow 3s ease-in-out infinite;
  transition: all 0.3s ease;
}

.achievement-badge:hover, .badge:hover {
  transform: translateY(-2px) scale(1.05);
}

@keyframes badgeGlow {
  0%, 100% { 
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  }
  50% { 
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
  }
}

/* ===== ENHANCED NAVIGATION ===== */

/* Navigation link hover effects */
.navbar-link, a {
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.navbar-link:hover, a:hover {
  transform: translateY(-1px);
}

/* ===== ENHANCED LOADING STATES ===== */

/* Better skeleton screens */
.skeleton, .loading-skeleton {
  background: linear-gradient(90deg, 
    rgba(0, 122, 255, 0.1) 25%, 
    rgba(0, 198, 255, 0.2) 50%, 
    rgba(0, 122, 255, 0.1) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 2s ease-in-out infinite;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent);
  animation: skeletonSweep 2s ease-in-out infinite;
}

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

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

/* ===== ENHANCED PRICE EFFECTS ===== */

/* Price calculation animations */
.price-box {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.price-update {
  animation: priceUpdate 0.5s ease-out;
}

@keyframes priceUpdate {
  0% { 
    transform: scale(1.05);
    background: rgba(0, 122, 255, 0.2);
  }
  100% { 
    transform: scale(1);
    background: rgba(0, 122, 255, 0.1);
  }
}

/* ===== ENHANCED NOTIFICATION EFFECTS ===== */

.notification {
  position: relative;
  overflow: hidden;
}

.notification::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, 
    transparent, 
    rgba(255, 255, 255, 0.1), 
    transparent);
  transform: rotate(45deg);
  animation: notificationShine 3s ease-in-out infinite;
}

@keyframes notificationShine {
  0% { transform: rotate(45deg) translateX(-200%); }
  50% { transform: rotate(45deg) translateX(0%); }
  100% { transform: rotate(45deg) translateX(200%); }
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
  .package-card:hover, .card:hover, .login-box:hover {
    transform: translateY(-4px) scale(1.01);
  }
  
  .btn:hover {
    transform: translateY(-2px) scale(1.01);
  }
  
  /* Reduce particle count on mobile */
  .particle:nth-child(n+15) {
    display: none;
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .particle {
    display: none;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Hardware acceleration for animated elements */
.package-card, .card, .btn, button, .particle, .login-box, .feature-icon {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}