/**
 * Icon System - Lucide Icons
 * Light line art icons for modern UI
 * 
 * IMPORTANT: This file ONLY styles icons, not the containers around them.
 * Use utility classes like .icon-text for icon + text combinations.
 */

/* ============================================
   BASE ICON STYLES
   Icons (before and after Lucide renders)
   ============================================ */

/* Before Lucide renders - placeholder sizing */
i[data-lucide] {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}

/* After Lucide renders to SVG */
svg.lucide {
    display: inline-block;
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================
   ICON SIZES
   ============================================ */
.icon-xs, .icon-xs svg.lucide, i[data-lucide].icon-xs { width: 14px; height: 14px; }
.icon-sm, .icon-sm svg.lucide, i[data-lucide].icon-sm { width: 18px; height: 18px; }
.icon-md, .icon-md svg.lucide, i[data-lucide].icon-md { width: 24px; height: 24px; }
.icon-lg, .icon-lg svg.lucide, i[data-lucide].icon-lg { width: 32px; height: 32px; }
.icon-xl, .icon-xl svg.lucide, i[data-lucide].icon-xl { width: 40px; height: 40px; }
.icon-2xl, .icon-2xl svg.lucide, i[data-lucide].icon-2xl { width: 48px; height: 48px; }

/* ============================================
   ICON COLORS
   ============================================ */
.icon-primary { color: var(--primary-500); }
.icon-secondary { color: var(--gray-500); }
.icon-muted { color: var(--gray-400); }
.icon-success { color: var(--success); }
.icon-error { color: var(--error); }
.icon-warning { color: var(--warning); }
.icon-info { color: var(--info); }
.icon-white { color: var(--white); }

/* ============================================
   ICON + TEXT UTILITY CLASSES
   Use these when you need icon and text together
   ============================================ */

/* Inline icon with text - use on parent container */
.icon-text {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.icon-text svg.lucide,
.icon-text i[data-lucide] {
    flex-shrink: 0;
}

/* Variations */
.icon-text-sm { gap: var(--space-1); }
.icon-text-lg { gap: var(--space-3); }

/* ============================================
   SECTION TITLE WITH ICON
   Common pattern: icon + heading in a row
   ============================================ */
.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: var(--space-4);
}

.section-title svg.lucide,
.section-title i[data-lucide] {
    width: 20px;
    height: 20px;
    color: var(--primary-600);
    flex-shrink: 0;
}

/* Smaller section title */
.section-title-sm {
    font-size: var(--text-base);
    gap: var(--space-2);
}

.section-title-sm svg.lucide,
.section-title-sm i[data-lucide] {
    width: 18px;
    height: 18px;
}

/* ============================================
   PAGE TITLE WITH ICON
   For main page headings
   ============================================ */
.page-title {
    margin-bottom: var(--space-6);
}

.page-title h1 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.page-title h1 svg.lucide,
.page-title h1 i[data-lucide] {
    width: 28px;
    height: 28px;
    color: var(--primary-600);
    flex-shrink: 0;
}

.page-title p {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: 0;
}

/* ============================================
   ICON CONTAINERS (circular/rounded backgrounds)
   ============================================ */
.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    color: var(--gray-600);
    flex-shrink: 0;
}

.icon-container svg.lucide,
.icon-container i[data-lucide] {
    width: 20px;
    height: 20px;
}

.icon-container-sm { width: 32px; height: 32px; }
.icon-container-sm svg.lucide { width: 16px; height: 16px; }

.icon-container-lg { width: 48px; height: 48px; }
.icon-container-lg svg.lucide { width: 24px; height: 24px; }

.icon-container-xl { width: 56px; height: 56px; border-radius: var(--radius-xl); }
.icon-container-xl svg.lucide { width: 28px; height: 28px; }

/* Color variants */
.icon-container-primary { background: var(--primary-100); color: var(--primary-600); }
.icon-container-success { background: var(--success-light); color: var(--success); }
.icon-container-warning { background: var(--warning-light); color: var(--warning); }
.icon-container-error { background: var(--error-light); color: var(--error); }
.icon-container-info { background: var(--info-light); color: var(--info); }

/* Circular */
.icon-container-circle { border-radius: var(--radius-full); }

/* Feature icon with gradient */
.icon-feature {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-purple);
    flex-shrink: 0;
}

.icon-feature svg.lucide { width: 28px; height: 28px; }

/* ============================================
   BUTTON ICONS
   Icons inside buttons
   ============================================ */
.btn svg.lucide,
.btn i[data-lucide] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-sm svg.lucide,
.btn-sm i[data-lucide] {
    width: 16px;
    height: 16px;
}

.btn-lg svg.lucide,
.btn-lg i[data-lucide] {
    width: 20px;
    height: 20px;
}

/* ============================================
   MENU/NAV ICONS
   ============================================ */
.menu-item,
.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.menu-item svg.lucide,
.menu-item i[data-lucide],
.nav-item svg.lucide,
.nav-item i[data-lucide] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.menu-item:hover svg.lucide,
.menu-item.active svg.lucide,
.nav-item:hover svg.lucide,
.nav-item.active svg.lucide {
    color: var(--primary-600);
}

/* ============================================
   EMPTY STATE ICON
   ============================================ */
.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-400);
    margin: 0 auto var(--space-4);
}

.empty-icon svg.lucide {
    width: 40px;
    height: 40px;
}

/* ============================================
   STAT CARD ICON
   ============================================ */
.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--primary-100);
    color: var(--primary-600);
    flex-shrink: 0;
}

.stat-icon svg.lucide {
    width: 24px;
    height: 24px;
}

.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }

/* ============================================
   ACTION ICONS (clickable icon buttons)
   ============================================ */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-icon:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.action-icon svg.lucide {
    width: 18px;
    height: 18px;
}

.action-icon-danger:hover {
    background: var(--error-light);
    color: var(--error);
}

/* ============================================
   SOCIAL ICONS
   ============================================ */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: all var(--transition-fast);
}

.social-icon:hover {
    background: var(--primary-500);
    transform: translateY(-2px);
}

.social-icon svg.lucide {
    width: 20px;
    height: 20px;
}

/* ============================================
   STAR RATING
   ============================================ */
.star-icon {
    width: 16px;
    height: 16px;
    color: var(--star-color, #FBBF24);
}

.star-icon.empty {
    color: var(--star-empty, #E5E7EB);
}

/* ============================================
   CART BADGE
   ============================================ */
.cart-icon-wrapper {
    position: relative;
    display: inline-flex;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: var(--font-bold);
    line-height: 18px;
    text-align: center;
    color: var(--white);
    background: var(--primary-600);
    border-radius: var(--radius-full);
}

/* ============================================
   ANIMATED ICONS
   ============================================ */
.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; }
}
