/* 🎨 Senticor Modern Icon System */

.senticor-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  color: currentColor;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* SVG inside icons should maintain aspect ratio */
.senticor-icon svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Fix for icons in circular containers */
[style*="border-radius: 50%"] .senticor-icon,
[style*="border-radius:50%"] .senticor-icon {
  width: auto !important;
  height: auto !important;
}

[style*="border-radius: 50%"] .senticor-icon svg,
[style*="border-radius:50%"] .senticor-icon svg {
  width: 20px;
  height: 20px;
}

/* Icon container fix - prevent stretching */
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

[data-icon] svg {
  flex-shrink: 0;
  display: block;
}

/* Fix icons in any flex container with fixed dimensions */
div[style*="display: flex"][style*="width:"] .senticor-icon,
div[style*="display:flex"][style*="width:"] .senticor-icon,
div[style*="display: flex"][style*="height:"] .senticor-icon,
div[style*="display:flex"][style*="height:"] .senticor-icon {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
}

/* Ensure SVGs in icon containers don't stretch */
div[style*="border-radius"] [data-icon] svg,
div[style*="border-radius"] .senticor-icon {
  max-width: none !important;
  max-height: none !important;
}

/* Fix for icons in cards and metric boxes */
div[style*="48px"] [data-icon],
div[style*="36px"] [data-icon] {
  width: auto !important;
  height: auto !important;
}

/* Ensure proper icon sizing in all containers */
.senticor-icon svg {
  display: block;
  width: inherit;
  height: inherit;
}

/* Icon sizes */
.senticor-icon--xs { width: 14px; height: 14px; }
.senticor-icon--sm { width: 18px; height: 18px; }
.senticor-icon--md { width: 24px; height: 24px; }
.senticor-icon--lg { width: 32px; height: 32px; }
.senticor-icon--xl { width: 48px; height: 48px; }

/* Icon states */
.senticor-icon--primary {
  color: var(--primary-color);
}

.senticor-icon--secondary {
  color: var(--sage-green);
}

.senticor-icon--accent {
  color: var(--terracotta);
}

.senticor-icon--muted {
  color: var(--text-light);
  opacity: 0.7;
}

/* Hover effects */
.senticor-icon--hover:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.2));
}

.senticor-icon--pulse {
  animation: iconPulse 2s infinite;
}

.senticor-icon--spin {
  animation: iconSpin 2s linear infinite;
}

.senticor-icon--float {
  animation: iconFloat 3s ease-in-out infinite;
}

/* Navigation icon styles */
.nav-icon {
  margin-right: 0.75rem;
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.nav-item:hover .nav-icon {
  opacity: 1;
  transform: scale(1.1);
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--primary-color);
}

[data-theme="dark"] .nav-item.active .nav-icon {
  color: #8B6FD1;
}

/* Process flow icons */
.process-icon {
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.process-icon:hover {
  background: rgba(124, 58, 237, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

[data-theme="dark"] .process-icon {
  background: rgba(139, 111, 209, 0.12);
  border-color: rgba(139, 111, 209, 0.2);
}

[data-theme="dark"] .process-icon:hover {
  background: rgba(139, 111, 209, 0.18);
  box-shadow: 0 8px 24px rgba(139, 111, 209, 0.2);
}

/* Feature icons */
.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(61, 112, 93, 0.05));
  border: 2px solid rgba(124, 58, 237, 0.1);
  color: var(--primary-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-icon:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(61, 112, 93, 0.1));
  border-color: var(--primary-color);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.2);
}

[data-theme="dark"] .feature-icon {
  background: linear-gradient(135deg, rgba(139, 111, 209, 0.15), rgba(107, 197, 184, 0.08));
  border-color: rgba(139, 111, 209, 0.2);
  color: #8B6FD1;
}

[data-theme="dark"] .feature-icon:hover {
  background: linear-gradient(135deg, rgba(139, 111, 209, 0.25), rgba(107, 197, 184, 0.15));
  border-color: #8B6FD1;
  box-shadow: 0 12px 40px rgba(139, 111, 209, 0.25);
}

/* Status icons */
.status-icon {
  width: 24px;
  height: 24px;
}

.status-icon--success {
  color: #22C55E;
}

.status-icon--warning {
  color: #F59E0B;
}

.status-icon--error {
  color: #EF4444;
}

.status-icon--info {
  color: #60A5FA;
}

/* Social icons */
.social-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.social-icon:hover {
  opacity: 1;
  transform: scale(1.1);
  color: var(--primary-color);
}

/* Logo icon */
.logo-icon {
  width: 32px;
  height: 32px;
}

/* Animated keyframes */
@keyframes iconPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

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

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

/* Icon button combinations */
.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(124, 58, 237, 0.05);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.icon-button--primary {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.icon-button--primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

[data-theme="dark"] .icon-button {
  border-color: rgba(139, 111, 209, 0.3);
  color: var(--text-light);
}

[data-theme="dark"] .icon-button:hover {
  background: rgba(139, 111, 209, 0.1);
  border-color: #8B6FD1;
  color: #8B6FD1;
}

/* Responsive icon adjustments */
@media (max-width: 768px) {
  .feature-icon {
    width: 56px;
    height: 56px;
    padding: 14px;
  }
  
  .process-icon {
    width: 40px;
    height: 40px;
    padding: 10px;
  }
  
  .nav-icon {
    width: 18px;
    height: 18px;
  }
}

/* Special gradient fills for branded icons */
.senticor-icon--gradient {
  background: linear-gradient(135deg, var(--primary-color), #8B6FD1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading state for icons */
.senticor-icon--loading {
  opacity: 0.5;
  animation: iconPulse 1.5s infinite;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .senticor-icon {
    stroke-width: 2.5;
  }
  
  .nav-icon,
  .process-icon,
  .feature-icon {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .senticor-icon,
  .nav-icon,
  .process-icon,
  .feature-icon,
  .icon-button {
    transition: none;
    animation: none;
  }
  
  .senticor-icon--pulse,
  .senticor-icon--spin,
  .senticor-icon--float {
    animation: none;
  }
}
