/* 
 * Local Font Fallbacks for VayVon.com
 * Replaces CDN fonts to fix CORS errors in preview environment
 * Uses system fonts with CSS icons for Font Awesome alternatives
 */

/* Font Family Definitions */
:root {
    --font-primary: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Arial', sans-serif;
    --font-secondary: 'Inter', var(--font-primary);
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Global font application */
body, html {
    font-family: var(--font-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* CSS-based Font Awesome Icon Replacements */
.fa, .fas, .far, .fal, .fab, [class^="fa-"], [class*=" fa-"] {
    font-family: var(--font-primary);
    font-style: normal;
    font-weight: normal;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    line-height: 1;
}

/* Common Font Awesome Icons - CSS Unicode Replacements */
.fa-user::before, .fas.fa-user::before { content: '👤'; }
.fa-email::before, .fa-envelope::before, .fas.fa-envelope::before { content: '✉️'; }
.fa-phone::before, .fas.fa-phone::before { content: '📞'; }
.fa-lock::before, .fas.fa-lock::before { content: '🔒'; }
.fa-eye::before, .fas.fa-eye::before { content: '👁️'; }
.fa-eye-slash::before, .fas.fa-eye-slash::before { content: '🙈'; }
.fa-check::before, .fas.fa-check::before { content: '✓'; }
.fa-times::before, .fa-close::before, .fas.fa-times::before { content: '✕'; }
.fa-plus::before, .fas.fa-plus::before { content: '+'; }
.fa-minus::before, .fas.fa-minus::before { content: '−'; }
.fa-home::before, .fas.fa-home::before { content: '🏠'; }
.fa-dashboard::before, .fa-tachometer::before, .fas.fa-tachometer::before { content: '📊'; }
.fa-cog::before, .fa-gear::before, .fas.fa-cog::before { content: '⚙️'; }
.fa-logout::before, .fa-sign-out::before, .fas.fa-sign-out-alt::before { content: '🚪'; }
.fa-money::before, .fa-dollar::before, .fas.fa-dollar-sign::before { content: '💰'; }
.fa-credit-card::before, .fas.fa-credit-card::before { content: '💳'; }
.fa-bank::before, .fa-university::before, .fas.fa-university::before { content: '🏦'; }
.fa-calendar::before, .fas.fa-calendar::before { content: '📅'; }
.fa-clock::before, .fas.fa-clock::before { content: '🕐'; }
.fa-file::before, .fas.fa-file::before { content: '📄'; }
.fa-upload::before, .fas.fa-upload::before { content: '⬆️'; }
.fa-download::before, .fas.fa-download::before { content: '⬇️'; }
.fa-search::before, .fas.fa-search::before { content: '🔍'; }
.fa-filter::before, .fas.fa-filter::before { content: '🔽'; }
.fa-edit::before, .fas.fa-edit::before { content: '✏️'; }
.fa-trash::before, .fas.fa-trash::before { content: '🗑️'; }
.fa-info::before, .fa-info-circle::before, .fas.fa-info-circle::before { content: 'ℹ️'; }
.fa-warning::before, .fa-exclamation-triangle::before, .fas.fa-exclamation-triangle::before { content: '⚠️'; }
.fa-error::before, .fa-times-circle::before, .fas.fa-times-circle::before { content: '❌'; }
.fa-success::before, .fa-check-circle::before, .fas.fa-check-circle::before { content: '✅'; }
.fa-loading::before, .fa-spinner::before, .fas.fa-spinner::before { content: '⏳'; }
.fa-heart::before, .fas.fa-heart::before { content: '❤️'; }
.fa-star::before, .fas.fa-star::before { content: '⭐'; }
.fa-arrow-up::before, .fas.fa-arrow-up::before { content: '↑'; }
.fa-arrow-down::before, .fas.fa-arrow-down::before { content: '↓'; }
.fa-arrow-left::before, .fas.fa-arrow-left::before { content: '←'; }
.fa-arrow-right::before, .fas.fa-arrow-right::before { content: '→'; }
.fa-chevron-up::before, .fas.fa-chevron-up::before { content: '⌃'; }
.fa-chevron-down::before, .fas.fa-chevron-down::before { content: '⌄'; }
.fa-chevron-left::before, .fas.fa-chevron-left::before { content: '‹'; }
.fa-chevron-right::before, .fas.fa-chevron-right::before { content: '›'; }
.fa-menu::before, .fa-bars::before, .fas.fa-bars::before { content: '☰'; }
.fa-close::before, .fa-times::before, .fas.fa-times::before { content: '×'; }

/* Business & Finance specific icons */
.fa-chart-line::before, .fas.fa-chart-line::before { content: '📈'; }
.fa-chart-bar::before, .fas.fa-chart-bar::before { content: '📊'; }
.fa-pie-chart::before, .fas.fa-chart-pie::before { content: '🥧'; }
.fa-wallet::before, .fas.fa-wallet::before { content: '👛'; }
.fa-coins::before, .fas.fa-coins::before { content: '🪙'; }
.fa-percent::before, .fas.fa-percent::before { content: '%'; }
.fa-calculator::before, .fas.fa-calculator::before { content: '🧮'; }
.fa-receipt::before, .fas.fa-receipt::before { content: '🧾'; }
.fa-handshake::before, .fas.fa-handshake::before { content: '🤝'; }
.fa-shield::before, .fas.fa-shield-alt::before { content: '🛡️'; }
.fa-scale::before, .fas.fa-balance-scale::before { content: '⚖️'; }

/* Animation for spinner */
.fa-spinner::before {
    animation: spin 1s linear infinite;
}

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

/* Sizing classes */
.fa-xs { font-size: 0.75em; }
.fa-sm { font-size: 0.875em; }
.fa-lg { font-size: 1.25em; }
.fa-xl { font-size: 1.5em; }
.fa-2x { font-size: 2em; }
.fa-3x { font-size: 3em; }

/* Utility classes */
.fa-fw { width: 1.25em; text-align: center; }
.fa-pull-left { float: left; margin-right: 0.3em; }
.fa-pull-right { float: right; margin-left: 0.3em; }

/* Font weight alternatives for different Font Awesome styles */
.far::before { font-weight: 300; }  /* Regular */
.fas::before { font-weight: 600; }  /* Solid */
.fab::before { font-weight: 400; }  /* Brands */

/* Inter font fallback using system fonts */
.inter-font, .font-inter {
    font-family: var(--font-secondary);
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
}

.btn, button, input, select, textarea {
    font-family: var(--font-primary);
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix for better icon alignment */
.fa, .fas, .far, .fal, .fab {
    vertical-align: middle;
    line-height: inherit;
}

/* Custom CSS icons for loan forms */
.loan-icon::before { content: '💰'; }
.business-icon::before { content: '🏢'; }
.personal-icon::before { content: '👤'; }
.student-icon::before { content: '🎓'; }
.working-capital-icon::before { content: '💼'; }
.receivable-icon::before { content: '📋'; }

/* Status indicators */
.status-pending::before { content: '⏳'; color: #f59e0b; }
.status-approved::before { content: '✅'; color: #10b981; }
.status-rejected::before { content: '❌'; color: #ef4444; }
.status-active::before { content: '🟢'; color: #10b981; }
.status-completed::before { content: '✅'; color: #6b7280; }

/* Loading states */
.loading-icon::before {
    content: '⏳';
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Vietnamese currency symbol */
.vnd-symbol::before { content: '₫'; }

/* Progress indicators */
.progress-icon::before { content: '📊'; }
.step-icon::before { content: '➤'; }

/* Form validation icons */
.valid-icon::before { content: '✓'; color: #10b981; }
.invalid-icon::before { content: '✕'; color: #ef4444; }
.required-icon::before { content: '*'; color: #ef4444; }