/**
 * FontAwesome Icon Fix - ULTIMATE FIX
 * Ensures all FontAwesome icons display correctly regardless of theme
 * This file MUST be loaded AFTER main.css to override any conflicts
 */

/* ============================================
   ULTIMATE FIX - Highest Priority Rules
   ============================================ */

/* Force ALL FontAwesome icons to be visible - NO EXCEPTIONS */
*[class*="fa-"],
i[class*="fa-"],
.fa-solid,
.fa-brands,
.fa-regular,
i.fa-solid,
i.fa-brands,
i.fa-regular,
[class*="fa-solid"],
[class*="fa-brands"],
[class*="fa-regular"],
i[class*="fa-solid"],
i[class*="fa-brands"],
i[class*="fa-regular"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    display: inline-block !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    speak: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
    width: auto !important;
    height: auto !important;
    min-width: 1em !important;
    min-height: 1em !important;
    font-size: inherit !important;
}

/* Brand icons - different font weight */
.fa-brands,
i.fa-brands,
*[class*="fa-brands"],
[class*="fa-brands"],
i[class*="fa-brands"] {
    font-family: "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 400 !important;
}

/* Regular icons */
.fa-regular,
i.fa-regular,
*[class*="fa-regular"],
[class*="fa-regular"],
i[class*="fa-regular"] {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 400 !important;
}

/* Solid icons - most common */
.fa-solid,
i.fa-solid,
*[class*="fa-solid"],
[class*="fa-solid"],
i[class*="fa-solid"] {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 900 !important;
}

/* ============================================
   Specific Component Fixes
   ============================================ */

/* Category icons */
.category-icon i,
.dream-category-badge i,
.gallery-card-image .dream-category-badge i,
.character-section i,
.symbol-alerts-title i,
.mood-tracker-title i,
.meditation-widget-title i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Social icons */
.social-icon i,
.social-share-btn i,
.footer-social i,
.footer-social a i {
    font-family: "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 400 !important;
    font-style: normal !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* UI icons in buttons and links */
button i,
a i,
.btn i,
.header-icon-button i,
.lang-icon,
.download-btn i,
.dream-image-download-btn i {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Download button icons - specific fix */
.download-btn i,
.download-btn .fa-download,
.dream-image-download-btn i,
.dream-image-download-btn .fa-download {
    font-family: "Font Awesome 6 Free", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-size: inherit !important;
    display: inline-block !important;
    line-height: 1 !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* ============================================
   Theme Overrides - Force Visibility
   ============================================ */

/* Ensure all icons are visible - override any theme styles */
[data-theme="dark"] i[class*="fa-"],
[data-theme="light"] i[class*="fa-"],
[data-theme="dark"] *[class*="fa-"],
[data-theme="light"] *[class*="fa-"],
body i[class*="fa-"],
body *[class*="fa-"],
html i[class*="fa-"],
html *[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
    /* Force white color for dark theme, dark color for light theme */
    color: var(--icon-color, #ffffff) !important;
}

/* Dark theme icons - force white */
[data-theme="dark"] i[class*="fa-"],
[data-theme="dark"] *[class*="fa-"] {
    color: #ffffff !important;
}

/* Light theme icons - force dark */
[data-theme="light"] i[class*="fa-"],
[data-theme="light"] *[class*="fa-"] {
    color: #1a1a2e !important;
}

/* Brand icons in theme contexts */
[data-theme="dark"] .fa-brands,
[data-theme="light"] .fa-brands,
[data-theme="dark"] i.fa-brands,
[data-theme="light"] i.fa-brands {
    font-family: "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 400 !important;
}

/* ============================================
   Override Any Hidden/Display None Rules
   ============================================ */

/* Force display - override any display:none rules */
i[class*="fa-"],
*[class*="fa-"] {
    display: inline-block !important;
}

/* Override any visibility:hidden */
i[class*="fa-"],
*[class*="fa-"] {
    visibility: visible !important;
}

/* Override any opacity:0 */
i[class*="fa-"],
*[class*="fa-"] {
    opacity: 1 !important;
}

/* Override any width/height:0 */
i[class*="fa-"],
*[class*="fa-"] {
    width: auto !important;
    height: auto !important;
    min-width: 1em !important;
    min-height: 1em !important;
}

/* Override any font-size:0 */
i[class*="fa-"],
*[class*="fa-"] {
    font-size: inherit !important;
}
