﻿/* ============================================
   MacySoft Icon Library - Unified Icon System
   ============================================ */

/* Base Icon Styles */
.ms-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  line-height: 1;
  vertical-align: middle;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom SVG Icons */
.ms-custom-icon {
  width: 1em;
  height: 1em;
  object-fit: contain;
}

/* Icon Sizes */
.ms-icon-xs {
  font-size: 0.75rem;
  width: 0.75rem;
  height: 0.75rem;
}

.ms-icon-sm {
  font-size: 0.875rem;
  width: 0.875rem;
  height: 0.875rem;
}

.ms-icon-md {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
}

.ms-icon-lg {
  font-size: 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
}

.ms-icon-xl {
  font-size: 2rem;
  width: 2rem;
  height: 2rem;
}

.ms-icon-2xl {
  font-size: 3rem;
  width: 3rem;
  height: 3rem;
}

.ms-icon-3xl {
  font-size: 4rem;
  width: 4rem;
  height: 4rem;
}

/* Icon Colors */
.ms-icon-primary {
  color: var(--primary-blue, #1e40af);
}

.ms-icon-secondary {
  color: var(--medium-gray, #6b7280);
}

.ms-icon-success {
  color: #10b981;
}

.ms-icon-danger {
  color: #ef4444;
}

.ms-icon-warning {
  color: #f59e0b;
}

.ms-icon-info {
  color: #3b82f6;
}

.ms-icon-light {
  color: #f3f4f6;
}

.ms-icon-dark {
  color: #1f2937;
}

.ms-icon-white {
  color: #ffffff;
}

.ms-icon-muted {
  color: #9ca3af;
}

/* Icon Background Styles */
.ms-icon-circle {
  border-radius: 50%;
  padding: 0.5rem;
}

.ms-icon-rounded {
  border-radius: 0.375rem;
  padding: 0.5rem;
}

.ms-icon-square {
  border-radius: 0;
  padding: 0.5rem;
}

/* Background Colors for Icon Containers */
.ms-icon-bg-primary {
  background-color: var(--primary-blue, #1e40af);
  color: white;
}

.ms-icon-bg-secondary {
  background-color: var(--medium-gray, #6b7280);
  color: white;
}

.ms-icon-bg-success {
  background-color: #10b981;
  color: white;
}

.ms-icon-bg-danger {
  background-color: #ef4444;
  color: white;
}

.ms-icon-bg-warning {
  background-color: #f59e0b;
  color: white;
}

.ms-icon-bg-info {
  background-color: #3b82f6;
  color: white;
}

.ms-icon-bg-light {
  background-color: #f3f4f6;
  color: #1f2937;
}

.ms-icon-bg-dark {
  background-color: #1f2937;
  color: white;
}

/* Icon Gradients */
.ms-icon-gradient-primary {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ms-icon-gradient-success {
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ms-icon-gradient-danger {
  background: linear-gradient(135deg, #ef4444, #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Icon Animations */
.ms-icon-spin {
  animation: ms-icon-spin 2s linear infinite;
}

.ms-icon-pulse {
  animation: ms-icon-pulse 2s ease-in-out infinite;
}

.ms-icon-beat {
  animation: ms-icon-beat 1s ease-in-out infinite;
}

.ms-icon-fade {
  animation: ms-icon-fade 2s ease-in-out infinite;
}

.ms-icon-bounce {
  animation: ms-icon-bounce 1s infinite;
}

@keyframes ms-icon-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes ms-icon-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

@keyframes ms-icon-beat {
  0%, 100% {
    transform: scale(1);
  }
  25%, 75% {
    transform: scale(1.1);
  }
  50% {
    transform: scale(1.2);
  }
}

@keyframes ms-icon-fade {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

@keyframes ms-icon-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Icon Hover Effects */
.ms-icon-hover:hover {
  transform: scale(1.2);
  transition: transform 0.3s ease;
}

.ms-icon-hover-rotate:hover {
  transform: rotate(15deg);
  transition: transform 0.3s ease;
}

.ms-icon-hover-color-primary:hover {
  color: var(--primary-blue, #1e40af);
  transition: color 0.3s ease;
}

.ms-icon-hover-shadow:hover {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
  transition: filter 0.3s ease;
}

/* Icon Button Styles */
.ms-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: all 0.3s ease;
}

.ms-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.ms-icon-btn:active {
  background-color: rgba(0, 0, 0, 0.1);
}

.ms-icon-btn-primary {
  color: var(--primary-blue, #1e40af);
}

.ms-icon-btn-primary:hover {
  background-color: rgba(30, 64, 175, 0.1);
}

/* Icon with Badge */
.ms-icon-badge-container {
  position: relative;
  display: inline-flex;
}

.ms-icon-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  white-space: nowrap;
  border-radius: 10px;
  background-color: #ef4444;
  color: white;
}

.ms-icon-badge-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  border: 2px solid white;
}

/* Icon Stacks */
.ms-icon-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2em;
  height: 2em;
  line-height: 2em;
  vertical-align: middle;
}

.ms-icon-stack-1x {
  position: absolute;
}

.ms-icon-stack-2x {
  font-size: 2em;
}

/* Icon List Styles */
.ms-icon-list {
  list-style: none;
  padding-left: 0;
}

.ms-icon-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ms-icon-list-icon {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

/* Responsive Icon Sizes */
@media (max-width: 768px) {
  .ms-icon-lg {
    font-size: 1.25rem;
  }
  
  .ms-icon-xl {
    font-size: 1.75rem;
  }
  
  .ms-icon-2xl {
    font-size: 2.5rem;
  }
  
  .ms-icon-3xl {
    font-size: 3.5rem;
  }
}

/* Icon Grid for Icon Library Display */
.ms-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.ms-icon-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ms-icon-grid-item:hover {
  background: #f9fafb;
  border-color: var(--primary-blue, #1e40af);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ms-icon-grid-item .ms-icon {
  font-size: 2rem;
  color: var(--primary-blue, #1e40af);
}

.ms-icon-grid-item-name {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  word-break: break-word;
}

/* Icon Search Box */
.ms-icon-search {
  margin-bottom: 2rem;
}

.ms-icon-search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
  background-size: 1.25rem;
  transition: border-color 0.3s ease;
}

.ms-icon-search-input:focus {
  outline: none;
  border-color: var(--primary-blue, #1e40af);
}

/* Icon Category Headers */
.ms-icon-category {
  margin: 3rem 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

.ms-icon-category-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-gray, #1f2937);
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ms-icon-category-count {
  font-size: 0.875rem;
  color: #6b7280;
  margin-left: 0.5rem;
}
