/* ========================================
   ICONS.CSS - Styles pour les icônes SVG
   ======================================== */

.icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-block;
  vertical-align: middle;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-md {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-lg {
  width: 2rem;
  height: 2rem;
}

.icon-xl {
  width: 2.5rem;
  height: 2.5rem;
}

.icon-2xl {
  width: 3rem;
  height: 3rem;
}

/* Icônes dans les boutons */
.btn .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.25rem;
}

.btn-icon .icon {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
}

/* Icônes dans les habitudes */
.habit-icon-wrapper {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.habit-icon-wrapper .icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Icônes d'actions */
.habit-action-btn .icon {
  width: 1rem;
  height: 1rem;
}

/* Animations pour les icônes */
.icon-spin {
  animation: icon-spin 1s linear infinite;
}

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

.icon-pulse {
  animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Icônes dans les stat cards */
.stat-icon svg {
  width: 2rem;
  height: 2rem;
}

/* Icônes dans le header */
.app-icon svg {
  width: 2rem;
  height: 2rem;
}

/* Grid d'icônes pour le sélecteur */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.icon-option {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-primary);
}

.icon-option:hover {
  background: var(--bg-primary);
  transform: scale(1.1);
}

.icon-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.icon-option .icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Responsive icons */
@media (max-width: 768px) {
  .icon-picker {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 480px) {
  .icon-picker {
    grid-template-columns: repeat(4, 1fr);
  }

  .icon-option {
    width: 2rem;
    height: 2rem;
  }

  .icon-option .icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}
