/**
 * ZOZO.HOST Unified Professional Icon Design System
 * Powered by Phosphor Icons (UI) & Simple Icons (Official Brands)
 */

:root {
  /* Icon Base Sizing Scales */
  --icon-size-xs: 0.75rem;     /* 12px */
  --icon-size-sm: 0.875rem;    /* 14px */
  --icon-size-md: 1rem;        /* 16px - Base UI */
  --icon-size-base: 1.125rem;  /* 18px */
  --icon-size-lg: 1.25rem;     /* 20px */
  --icon-size-xl: 1.5rem;      /* 24px */
  --icon-size-2xl: 2rem;       /* 32px */
  --icon-size-3xl: 2.5rem;     /* 40px */
  --icon-size-4xl: 3rem;       /* 48px */

  /* Component Contextual Sizes */
  --icon-sidebar: 1.25rem;     /* 20px - Sidebar navigation */
  --icon-navbar: 1.125rem;     /* 18px - Topbar navigation */
  --icon-btn: 1rem;            /* 16px - Buttons */
  --icon-btn-sm: 0.875rem;     /* 14px - Small buttons */
  --icon-btn-lg: 1.125rem;     /* 18px - Large CTA buttons */
  --icon-table: 0.9375rem;     /* 15px - Data table actions */
  --icon-stat: 1.75rem;        /* 28px - Dashboard KPI stats */
  --icon-brand: 1.25rem;       /* 20px - Brand badges */
  --icon-brand-lg: 2rem;       /* 32px - Showcase brand cards */

  /* Icon Colors & Transitions */
  --icon-color: currentColor;
  --icon-color-muted: #64748b;
  --icon-color-subtle: #94a3b8;
  --icon-color-primary: var(--zozo-primary, #2563eb);
  --icon-color-success: #16a34a;
  --icon-color-warning: #f59e0b;
  --icon-color-danger: #dc2626;
  --icon-color-info: #0284c7;

  /* Duotone Opacity */
  --icon-duotone-secondary: 0.22;
  --icon-transition: color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

/* Dark theme overrides */
[data-bs-theme="dark"], .dark-theme, .theme-dark, .admin-dark {
  --icon-color-muted: #94a3b8;
  --icon-color-subtle: #64748b;
  --icon-duotone-secondary: 0.28;
}

/* ==========================================================================
   1. Base SVG Icon Styles
   ========================================================================== */

.icon,
svg.icon,
.icon-svg {
  display: inline-block;
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
  transition: var(--icon-transition);
  pointer-events: none;
}

/* Ensure child paths in Phosphor duotone render with standard opacity */
.icon-duotone path:first-child,
.icon-duotone [opacity] {
  opacity: var(--icon-duotone-secondary);
}

/* ==========================================================================
   2. Standard Sizing Utility Classes
   ========================================================================== */

.icon-xs   { width: var(--icon-size-xs) !important; height: var(--icon-size-xs) !important; }
.icon-sm   { width: var(--icon-size-sm) !important; height: var(--icon-size-sm) !important; }
.icon-md   { width: var(--icon-size-md) !important; height: var(--icon-size-md) !important; }
.icon-base { width: var(--icon-size-base) !important; height: var(--icon-size-base) !important; }
.icon-lg   { width: var(--icon-size-lg) !important; height: var(--icon-size-lg) !important; }
.icon-xl   { width: var(--icon-size-xl) !important; height: var(--icon-size-xl) !important; }
.icon-2xl  { width: var(--icon-size-2xl) !important; height: var(--icon-size-2xl) !important; }
.icon-3xl  { width: var(--icon-size-3xl) !important; height: var(--icon-size-3xl) !important; }
.icon-4xl  { width: var(--icon-size-4xl) !important; height: var(--icon-size-4xl) !important; }

/* Legacy Lucide compatibility classes mapped directly to Phosphor dimensions */
.lucide,
.lucide-sm,
.lucide-xs,
.lucide-lg,
.lucide-xl {
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
}
.lucide     { width: var(--icon-size-md); height: var(--icon-size-md); }
.lucide-xs  { width: var(--icon-size-xs); height: var(--icon-size-xs); }
.lucide-sm  { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.lucide-lg  { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.lucide-xl  { width: var(--icon-size-xl); height: var(--icon-size-xl); }

/* ==========================================================================
   3. Contextual Icon Sizing Classes
   ========================================================================== */

/* Navigation & Sidebar */
.icon-sidebar {
  width: var(--icon-sidebar);
  height: var(--icon-sidebar);
  margin-right: 0.625rem;
  opacity: 0.88;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.admin-nav-link:hover .icon-sidebar,
.admin-nav-link.active .icon-sidebar {
  opacity: 1;
}

.icon-navbar {
  width: var(--icon-navbar);
  height: var(--icon-navbar);
}

/* Buttons */
.btn .icon,
.btn .icon-btn {
  width: var(--icon-btn);
  height: var(--icon-btn);
  vertical-align: -0.125em;
}

.btn-sm .icon,
.btn-sm .icon-btn {
  width: var(--icon-btn-sm);
  height: var(--icon-btn-sm);
}

.btn-lg .icon,
.btn-lg .icon-btn {
  width: var(--icon-btn-lg);
  height: var(--icon-btn-lg);
}

.btn-icon .icon {
  margin: 0 !important;
}

/* Tables & Action Grids */
.table .icon,
.table-action-btn .icon,
.icon-table {
  width: var(--icon-table);
  height: var(--icon-table);
  vertical-align: -0.1em;
}

/* Dashboard KPIs / Stat Cards */
.icon-stat {
  width: var(--icon-stat);
  height: var(--icon-stat);
}

.stat-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.75rem;
  background: rgba(37, 99, 235, 0.08);
  color: var(--icon-color-primary);
}

/* ==========================================================================
   4. Brand & Technology Logos (Simple Icons)
   ========================================================================== */

.icon-brand {
  width: var(--icon-brand);
  height: var(--icon-brand);
  vertical-align: -0.15em;
  fill: currentColor;
  flex-shrink: 0;
}

.icon-brand-lg {
  width: var(--icon-brand-lg);
  height: var(--icon-brand-lg);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: #334155;
}

/* Dedicated Brand Colors for Official Brand Logos when specified */
.brand-ubuntu     { color: #E95420; }
.brand-debian     { color: #A80030; }
.brand-centos     { color: #93227E; }
.brand-almalinux  { color: #0F4266; }
.brand-rockylinux { color: #10B981; }
.brand-fedora     { color: #51A2DA; }
.brand-archlinux  { color: #1793D1; }
.brand-windows    { color: #0078D4; }
.brand-docker     { color: #2496ED; }
.brand-kubernetes { color: #326CE5; }
.brand-cpanel     { color: #FF6C2C; }
.brand-plesk      { color: #53B9EA; }
.brand-litespeed  { color: #003366; }
.brand-cloudflare { color: #F38020; }
.brand-wordpress  { color: #21759B; }
.brand-nvidia     { color: #76B900; }
.brand-amd        { color: #ED1C24; }
.brand-intel      { color: #0071C5; }
.brand-php        { color: #777BB4; }
.brand-mysql      { color: #4479A1; }
.brand-postgresql { color: #4169E1; }
.brand-redis      { color: #DC382D; }
.brand-python     { color: #3776AB; }
.brand-nodedotjs  { color: #5FA04E; }
.brand-github     { color: #181717; }
.brand-stripe     { color: #635BFF; }
.brand-paypal     { color: #003087; }
.brand-bitcoin    { color: #F7931A; }
.brand-ethereum   { color: #3C3C3D; }
.brand-telegram   { color: #26A5E4; }
.brand-discord    { color: #5865F2; }

/* Dark mode adjustments for dark brand logos */
[data-bs-theme="dark"] .brand-github,
.theme-dark .brand-github {
  color: #f8fafc;
}

/* ==========================================================================
   5. Animations & Motion Utilities
   ========================================================================== */

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

@keyframes icon-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.92); }
}

.icon-spin,
.icon-loading {
  animation: icon-spin 1s linear infinite;
  display: inline-block;
}

.icon-pulse {
  animation: icon-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Interactive Hovers */
.icon-hover-bounce:hover {
  transform: translateY(-2px);
}

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

.icon-hover-spin:hover {
  transform: rotate(45deg);
}

/* Accessible reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .icon,
  .icon-spin,
  .icon-loading,
  .icon-pulse,
  .icon-hover-bounce,
  .icon-hover-scale,
  .icon-hover-spin {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   6. Fallback & Accessibility
   ========================================================================== */

.icon-fallback {
  opacity: 0.7;
}

/* Screen reader only utility if missing */
.sr-only,
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
