/**
 * PHC TOP Pro 2.0 - ICON SYSTEM STYLES
 * 
 * Icon sizing, hover effects, animations
 * Fully responsive sizing with CSS variables
 * 
 * @package PHC_TOP
 * 
 */

/* ========================================
   ICON BASE STYLES
   ======================================== */

.phc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size, 32px);
  height: var(--icon-size, 32px);
  min-width: var(--icon-size, 32px);
  min-height: var(--icon-size, 32px);
  flex-shrink: 0;
  color: var(--icon-color, #FF9156);
  line-height: 1;
  margin: 0;
  padding: 0;
}

.phc-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
}

/* ========================================
   ICON SIZES (Responsive)
   ======================================== */

.phc-icon-xs {
  --icon-size: 16px;
}

.phc-icon-sm {
  --icon-size: 24px;
}

.phc-icon-md {
  --icon-size: 32px;
}

.phc-icon-lg {
  --icon-size: 48px;
}

.phc-icon-xl {
  --icon-size: 64px;
}

.phc-icon-2xl {
  --icon-size: 96px;
}

/* ========================================
   RESPONSIVE ICON SCALING
   ======================================== */

/* Mobile: Scale down slightly */
@media (max-width: 479px) {
  .phc-icon-lg {
    --icon-size: 40px;
  }
  
  .phc-icon-xl {
    --icon-size: 56px;
  }
  
  .phc-icon-2xl {
    --icon-size: 80px;
  }
}

/* Large Mobile: Standard sizing */
@media (min-width: 480px) and (max-width: 767px) {
  .phc-icon-lg {
    --icon-size: 44px;
  }
  
  .phc-icon-xl {
    --icon-size: 60px;
  }
}

/* Tablet and up: Full sizing */
@media (min-width: 768px) {
  .phc-icon-lg {
    --icon-size: 48px;
  }
  
  .phc-icon-xl {
    --icon-size: 64px;
  }
  
  .phc-icon-2xl {
    --icon-size: 96px;
  }
}

/* ========================================
   HOVER EFFECTS
   ======================================== */

/* Scale effect */
.phc-icon-hover-scale {
  transition: transform 0.3s ease-in-out;
}

.phc-icon-hover-scale:hover {
  transform: scale(1.2);
}

/* Rotate effect */
.phc-icon-hover-rotate {
  transition: transform 0.3s ease-in-out;
}

.phc-icon-hover-rotate:hover {
  transform: rotate(15deg);
}

/* Glow effect */
.phc-icon-hover-glow {
  transition: filter 0.3s ease-in-out;
}

.phc-icon-hover-glow:hover {
  filter: drop-shadow(0 0 8px var(--icon-color, #FF9156));
}

/* Bounce effect */
.phc-icon-hover-bounce {
  transition: transform 0.3s ease-in-out;
}

.phc-icon-hover-bounce:hover {
  animation: phc-bounce 0.6s ease-in-out;
}

/* Color shift effect */
.phc-icon-hover-color {
  transition: filter 0.3s ease-in-out;
}

.phc-icon-hover-color:hover {
  filter: brightness(1.2) saturate(1.1);
}

/* Lift effect */
.phc-icon-hover-lift {
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.phc-icon-hover-lift:hover {
  transform: translateY(-4px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* ========================================
   ANIMATIONS
   ======================================== */

/* Pulse animation */
.phc-icon-animate-pulse {
  animation: phc-pulse 2s ease-in-out infinite;
}

@keyframes phc-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Spin animation */
.phc-icon-animate-spin {
  animation: phc-spin 2s linear infinite;
}

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

/* Bounce animation */
@keyframes phc-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Float animation */
.phc-icon-animate-float {
  animation: phc-float 3s ease-in-out infinite;
}

@keyframes phc-float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Shake animation */
.phc-icon-animate-shake {
  animation: phc-shake 0.5s ease-in-out infinite;
}

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

/* Heartbeat animation */
.phc-icon-animate-heartbeat {
  animation: phc-heartbeat 1.3s ease-in-out infinite;
}

@keyframes phc-heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

/* ========================================
   ICON IN TEXT
   ======================================== */

p .phc-icon,
li .phc-icon,
span .phc-icon {
  vertical-align: middle;
  margin-right: var(--space-sm);
}

/* ========================================
   ICON BUTTONS
   ======================================== */

.phc-icon-button {
  background: none;
  border: none;
  padding: var(--space-sm);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.phc-icon-button:hover {
  background-color: rgba(255, 145, 86, 0.1);
}

.phc-icon-button:focus {
  outline: 2px solid var(--icon-color, #FF9156);
  outline-offset: 2px;
}

/* ========================================
   ICON LINKS
   ======================================== */

.phc-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 4px;
  transition: transform 0.3s ease-in-out;
}

.phc-icon-link:hover {
  text-decoration: none;
}

.phc-icon-link:focus {
  outline: 2px solid var(--icon-color, #FF9156);
  outline-offset: 2px;
}

/* ========================================
   ICON CONTAINERS
   ======================================== */

.phc-icon-circle {
  background-color: rgba(255, 145, 86, 0.1);
  border-radius: 50%;
  padding: var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.phc-icon-square {
  background-color: rgba(255, 145, 86, 0.1);
  border-radius: 4px;
  padding: var(--space-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.phc-icon-badge {
  position: relative;
  display: inline-flex;
}

.phc-icon-badge::after {
  content: attr(data-badge);
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--icon-color, #FF9156);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* ========================================
   ICON COLORS
   ======================================== */

.phc-icon-primary {
  --icon-color: #FF9156;
}

.phc-icon-success {
  --icon-color: #5DB91F;
}

.phc-icon-warning {
  --icon-color: #FFA500;
}

.phc-icon-danger {
  --icon-color: #E63946;
}

.phc-icon-info {
  --icon-color: #0066CC;
}

.phc-icon-dark {
  --icon-color: #1F1F1F;
}

.phc-icon-light {
  --icon-color: #F5F5F5;
}

.phc-icon-white {
  --icon-color: #FFFFFF;
}

/* ========================================
   ICON GRID
   ======================================== */

.phc-icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: var(--component-gap);
}

.phc-icons-grid-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  border: 1px solid #eee;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.phc-icons-grid-item:hover {
  border-color: var(--icon-color, #FF9156);
  background-color: rgba(255, 145, 86, 0.05);
  transform: translateY(-2px);
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.phc-icon[role="img"] {
  display: inline-block;
}

/* High contrast mode */
@media (prefers-contrast: more) {
  .phc-icon {
    border: 1px solid currentColor;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .phc-icon,
  .phc-icon-hover-scale,
  .phc-icon-hover-rotate,
  .phc-icon-hover-glow,
  .phc-icon-hover-bounce,
  .phc-icon-hover-color,
  .phc-icon-hover-lift,
  .phc-icon-animate-pulse,
  .phc-icon-animate-spin,
  .phc-icon-animate-float,
  .phc-icon-animate-shake,
  .phc-icon-animate-heartbeat {
    animation: none !important;
    transition: none !important;
  }
}

/* ========================================
   LOADING STATE
   ======================================== */

.phc-icon.phc-loading {
  animation: phc-spin 1s linear infinite;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .phc-icon-animate-pulse,
  .phc-icon-animate-spin,
  .phc-icon-animate-float,
  .phc-icon-animate-shake,
  .phc-icon-animate-heartbeat {
    animation: none !important;
  }
}
