/* 
 * Icons Fix CSS
 * Đảm bảo icons hiển thị đúng trong mọi trường hợp
 */

/* Force Font Awesome to load properly */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* Ensure icons have proper styling */
.fas, .far, .fab, .fal, .fad {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
}

.far {
    font-weight: 400;
}

.fab {
    font-weight: 400;
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
}

/* Fix for specific icons that might not display */
.fa-desktop::before { content: "\f390"; }
.fa-tools::before { content: "\f7d9"; }
.fa-laptop-code::before { content: "\f5fc"; }
.fa-code::before { content: "\f121"; }
.fa-cogs::before { content: "\f085"; }
.fa-microchip::before { content: "\f2db"; }
.fa-digital-tachograph::before { content: "\f566"; }
.fa-clock::before { content: "\f017"; }
.fa-shield-alt::before { content: "\f3ed"; }
.fa-users::before { content: "\f0c0"; }
.fa-dollar-sign::before { content: "\f155"; }
.fa-phone::before { content: "\f095"; }
.fa-envelope::before { content: "\f0e0"; }
.fa-map-marker-alt::before { content: "\f3c5"; }
.fa-comments::before { content: "\f086"; }
.fa-facebook-messenger::before { content: "\f39f"; }

/* Fallback for when Font Awesome completely fails */
.icon-fallback-active .fas::before,
.icon-fallback-active .far::before,
.icon-fallback-active .fab::before {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
    font-weight: normal !important;
}

/* Alternative text-based icons */
.text-icons .fa-desktop::before { content: "[PC]"; }
.text-icons .fa-tools::before { content: "[TOOL]"; }
.text-icons .fa-laptop-code::before { content: "[CODE]"; }
.text-icons .fa-phone::before { content: "[TEL]"; }
.text-icons .fa-envelope::before { content: "[EMAIL]"; }
.text-icons .fa-map-marker-alt::before { content: "[LOC]"; }

/* Ensure consistent blue color scheme */
.fas, .far, .fab {
    color: inherit;
}

/* Override any conflicting colors to maintain blue theme */
.service-icon i,
.contact-item i,
.feature i,
.footer-logo i,
.footer-section ul li i {
    color: #2563eb !important;
}

.service-icon i {
    color: #ffffff !important; /* White icons on blue background */
}

/* Hover states */
.contact-item:hover i,
.feature:hover i {
    color: #1d4ed8 !important;
}

/* Loading state for icons */
.icon-loading-state {
    position: relative;
}

.icon-loading-state::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: icon-shimmer 1.5s infinite;
    border-radius: 2px;
}

@keyframes icon-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide loading when icons are ready */
.icons-loaded .icon-loading-state::before {
    display: none;
}

/* Responsive icon sizes */
@media (max-width: 768px) {
    .service-card .fas,
    .service-card .far,
    .service-card .fab {
        font-size: 2rem !important;
    }
    
    .feature .fas,
    .feature .far,
    .feature .fab {
        font-size: 1.2rem !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .fas, .far, .fab {
        filter: contrast(2);
    }
}

/* Print styles */
@media print {
    .fas::before,
    .far::before,
    .fab::before {
        content: "[ICON]";
        font-family: serif;
    }
}