/* Cross-Browser Font Compatibility */

/* WebKit (Safari, Chrome) specific fixes */
@supports (-webkit-appearance: none) {
    @font-face {
        font-family: 'IRANSans';
        src: url('../fonts/IRANSansWeb(FaNum)_Bold.woff') format('woff');
        font-weight: 700;
        font-style: normal;
        font-display: swap;
        -webkit-font-smoothing: antialiased;
    }
}

/* Firefox specific fixes */
@supports (-moz-appearance: none) {
    @font-face {
        font-family: 'IRANSans';
        src: url('../fonts/IRANSansWeb(FaNum)_Bold.woff') format('woff');
        font-weight: 700;
        font-style: normal;
        font-display: swap;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Edge specific fixes */
@supports (-ms-ime-align: auto) {
    @font-face {
        font-family: 'IRANSans';
        src: url('../fonts/IRANSansWeb(FaNum)_Bold.eot');
        font-weight: 700;
        font-style: normal;
        font-display: swap;
    }
}

/* Mobile Safari specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    @supports (-webkit-touch-callout: none) {
        body, input, select, textarea, p, div, span, li, h1, h2, h3, h4, h5, h6 {
            font-family: 'IRANSans', 'IRANSansWeb(FaNum)', Tahoma, Arial, sans-serif !important;
            -webkit-font-smoothing: antialiased !important;
            text-rendering: optimizeLegibility !important;
        }
    }
}

/* Android WebView fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    @supports not (-webkit-touch-callout: none) {
        body, input, select, textarea, p, div, span, li, h1, h2, h3, h4, h5, h6 {
            font-family: 'IRANSans', 'IRANSansWeb(FaNum)', Tahoma, Arial, sans-serif !important;
            -webkit-font-smoothing: antialiased !important;
            text-rendering: optimizeLegibility !important;
        }
    }
}

/* High DPI display fixes */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body, input, select, textarea, p, div, span, li, h1, h2, h3, h4, h5, h6 {
        font-family: 'IRANSans', 'IRANSansWeb(FaNum)', Tahoma, Arial, sans-serif !important;
        text-rendering: optimizeLegibility !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
}

/* Print media fixes */
@media print {
    @font-face {
        font-family: 'IRANSans';
        src: url('../fonts/IRANSansWeb(FaNum)_Bold.ttf') format('truetype');
        font-weight: 700;
        font-style: normal;
    }
    
    body, input, select, textarea, p, div, span, li, h1, h2, h3, h4, h5, h6 {
        font-family: 'IRANSans', 'IRANSansWeb(FaNum)', Tahoma, Arial, sans-serif !important;
    }
}

/* Fallback for older browsers */
@supports not (font-display: swap) {
    @font-face {
        font-family: 'IRANSans';
        src: url('../fonts/IRANSansWeb(FaNum)_Bold.eot');
        font-weight: 700;
        font-style: normal;
    }
}

/* Ensure proper font loading order */
.font-loading {
    font-family: Tahoma, Arial, sans-serif;
}

.font-loaded {
    font-family: 'IRANSans', 'IRANSansWeb(FaNum)', Tahoma, Arial, sans-serif;
}
