/* Enhanced Professional Icon Styling */

/* Base icon improvements for better visual appeal */
.navbar nav a i,
.nav-menu a i,
.mobile-nav-container a i,
.navbar nav a .menu-icon,
.nav-menu a .menu-icon,
.mobile-nav-container a .menu-icon {
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom menu icon styling for image-based icons */
.menu-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  vertical-align: middle;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: brightness(1) saturate(1);
}

/* Jigsaw icon specific styling */
.jigsaw-icon {
  width: 22px;
  height: 22px;
  opacity: 0.9;
  transform: translateY(0px);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  image-rendering: auto;
}

/* Desktop navigation - jigsaw icon hover effects */
.nav-menu.desktop-nav a:hover .jigsaw-icon {
  opacity: 1;
  transform: translateY(-1px) scale(1.1);
  filter: brightness(1.2) saturate(1.3) drop-shadow(0 2px 4px rgba(var(--primary-color-rgb), 0.3));
}

/* Mobile navigation - jigsaw icon styling */
.mobile-nav-container .primary-action .jigsaw-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1); /* Make it white for the primary action button */
}

.mobile-nav-container .primary-action:hover .jigsaw-icon {
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
  transform: scale(1.1);
}

/* Desktop navigation icon enhancements */
.nav-menu.desktop-nav a i,
.nav-menu.desktop-nav a .menu-icon {
  margin-right: 0.5rem;
  font-size: 1.1rem;
  color: var(--primary-color);
  opacity: 0.85;
  transform: translateY(0px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop navigation hover effects */
.nav-menu.desktop-nav a:hover i,
.nav-menu.desktop-nav a:hover .menu-icon {
  opacity: 1;
  transform: translateY(-1px) scale(1.1);
  color: var(--secondary-color);
  text-shadow: 0 2px 4px rgba(var(--primary-color-rgb), 0.3);
}

/* Special effects for primary action icons */
.nav-menu.desktop-nav a:hover .jigsaw-icon {
  animation: jigsaw-puzzle 0.8s ease-in-out;
}

.nav-menu.desktop-nav a:hover .fa-list-check {
  animation: sparkle 0.8s ease-in-out;
}

.nav-menu.desktop-nav a:hover .fa-wand-magic-sparkles {
  animation: magic 0.7s ease-in-out;
}

.nav-menu.desktop-nav a:hover .fa-lightbulb {
  animation: glow 0.6s ease-in-out;
}

/* Mobile navigation icon enhancements */
.mobile-nav-container .category-title i {
  font-size: 1.2rem;
  color: var(--primary-color);
  text-shadow: 0 1px 2px rgba(var(--primary-color-rgb), 0.2);
  transition: all 0.3s ease;
}

.mobile-nav-container .menu-category-header:hover .category-title i {
  transform: scale(1.15) rotate(5deg);
  color: var(--secondary-color);
  text-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.4);
}

/* Mobile menu item icons */
.mobile-nav-container .category-content a i {
  width: 24px;
  height: 24px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.1);
  border-radius: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-right: 0.75rem;
}

.mobile-nav-container .category-content a:hover i {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

/* Primary action button special styling */
.mobile-nav-container .primary-action i {
  color: white !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-nav-container .primary-action:hover i {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: scale(1.15) !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4) !important;
}

/* Dropdown chevron styling */
.nav-menu .fa-chevron-down,
.nav-menu .fa-chevron-right {
  font-size: 0.8rem;
  margin-left: 0.3rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.nav-menu .has-dropdown:hover .fa-chevron-down {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--secondary-color);
}

.nav-menu .has-dropdown:hover .fa-chevron-right {
  transform: translateX(3px);
  opacity: 1;
  color: var(--secondary-color);
}

/* Special icon treatments for specific functions */
.fa-tags {
  position: relative;
}

.fa-tags::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 6px;
  height: 6px;
  background: #28a745;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

a:hover .fa-tags::after {
  opacity: 1;
  animation: ping 1s ease-in-out infinite;
}

.fa-award {
  color: #f39c12 !important;
  text-shadow: 0 1px 2px rgba(243, 156, 18, 0.3);
}

a:hover .fa-award {
  color: #e67e22 !important;
  animation: bounce 0.6s ease-in-out;
}

/* Features list-check icon styling */
.fa-list-check {
  color: var(--primary-color) !important;
  font-weight: 600;
}

a:hover .fa-list-check {
  color: var(--secondary-color) !important;
  text-shadow: 0 1px 3px rgba(var(--primary-color-rgb), 0.4);
}

.fa-gauge-high {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Keyframe animations for enhanced interactivity */
@keyframes pulse {
  0%, 100% { transform: translateY(-1px) scale(1.1); }
  50% { transform: translateY(-2px) scale(1.2); }
}

@keyframes sparkle {
  0%, 100% { transform: translateY(-1px) scale(1.1) rotate(0deg); }
  25% { transform: translateY(-2px) scale(1.15) rotate(-5deg); }
  75% { transform: translateY(-2px) scale(1.15) rotate(5deg); }
}

@keyframes magic {
  0%, 100% { transform: translateY(-1px) scale(1.1); }
  33% { transform: translateY(-2px) scale(1.2) rotate(-10deg); }
  66% { transform: translateY(-2px) scale(1.2) rotate(10deg); }
}

@keyframes glow {
  0%, 100% { 
    transform: translateY(-1px) scale(1.1);
    filter: brightness(1);
  }
  50% { 
    transform: translateY(-2px) scale(1.15);
    filter: brightness(1.3);
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px) scale(1.1); }
}

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

@keyframes jigsaw-puzzle {
  0%, 100% { 
    transform: translateY(-1px) scale(1.1) rotate(0deg);
    filter: brightness(1.2) saturate(1.3) drop-shadow(0 2px 4px rgba(var(--primary-color-rgb), 0.3));
  }
  25% { 
    transform: translateY(-2px) scale(1.15) rotate(-2deg);
    filter: brightness(1.3) saturate(1.4) drop-shadow(0 3px 6px rgba(var(--primary-color-rgb), 0.4));
  }
  50% { 
    transform: translateY(-3px) scale(1.2) rotate(0deg);
    filter: brightness(1.4) saturate(1.5) drop-shadow(0 4px 8px rgba(var(--primary-color-rgb), 0.5));
  }
  75% { 
    transform: translateY(-2px) scale(1.15) rotate(2deg);
    filter: brightness(1.3) saturate(1.4) drop-shadow(0 3px 6px rgba(var(--primary-color-rgb), 0.4));
  }
}

@keyframes headerIconWelcome {
  0% { 
    transform: scale(0.8);
    filter: brightness(0) invert(1);
    opacity: 0.8;
  }
  50% { 
    transform: scale(1.1) rotate(-3deg);
    filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(255, 255, 255, 0.8));
    opacity: 1;
  }
  70% { 
    transform: scale(1.05) rotate(2deg);
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
  }
  100% { 
    transform: scale(1);
    filter: brightness(0) invert(1);
    opacity: 1;
  }
}

/* Enhanced visual hierarchy for icon categories */
.mobile-nav-container .menu-category.quick-actions .category-content a i {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Footer icon improvements */
.footer-container a i {
  transition: all 0.3s ease;
}

.footer-container a:hover i {
  transform: translateY(-2px) scale(1.1);
  color: var(--secondary-color);
}

/* Version icon in mobile menu footer */
.menu-footer .fa-code-branch {
  margin-right: 0.5rem;
  color: var(--primary-color);
  opacity: 0.7;
}

/* Responsive adjustments for very small screens */
@media (max-width: 320px) {
  .mobile-nav-container .category-content a i {
    width: 20px;
    height: 20px;
    font-size: 0.95rem;
  }
  
  .nav-menu.desktop-nav a i {
    font-size: 1rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .navbar nav a i,
  .mobile-nav-container a i {
    text-shadow: none;
    filter: contrast(1.5);
  }
}

/* Header jigsaw icon styling for STE Analyzer page */
.header-jigsaw-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1); /* Make it white to match the blue background */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: auto;
  animation: headerIconWelcome 2s ease-in-out 0.5s; /* Welcome animation after page load */
}

/* Header app-icon hover effects */
.app-icon:hover .header-jigsaw-icon {
  transform: scale(1.1) rotate(5deg);
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

/* Subtle animation for the header icon */
.app-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .navbar nav a i,
  .mobile-nav-container a i {
    transition: color 0.2s ease;
    animation: none;
  }
  
  .nav-menu.desktop-nav a:hover i {
    transform: none;
    animation: none;
  }
  
  .header-jigsaw-icon,
  .app-icon:hover .header-jigsaw-icon,
  .app-icon:hover {
    transform: none;
    animation: none;
  }
}