/**
 * Zebra Printer Compatible Fonts
 * 
 * This file defines fonts that closely match Zebra printer output.
 * Zebra printers use CG Triumvirate (similar to Swiss 721/Helvetica).
 * 
 * Font Priority:
 * 1. Liberation Sans - Free alternative to Helvetica (GPL license)
 * 2. Helvetica Neue / Helvetica - macOS/system fonts
 * 3. Arial - Windows system font
 * 4. sans-serif - Browser fallback
 * 
 * To improve accuracy, download Liberation Sans fonts:
 * https://github.com/liberationfonts/liberation-fonts/releases
 */

/* Liberation Sans - Regular */
@font-face {
    font-family: 'Liberation Sans';
    src: url('../fonts/LiberationSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Liberation Sans - Bold */
@font-face {
    font-family: 'Liberation Sans';
    src: url('../fonts/LiberationSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* Liberation Sans - Italic */
@font-face {
    font-family: 'Liberation Sans';
    src: url('../fonts/LiberationSans-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

/* Liberation Sans - Bold Italic */
@font-face {
    font-family: 'Liberation Sans';
    src: url('../fonts/LiberationSans-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* Roboto Mono - For monospace labels (if needed)
   Commented out until files are available
@font-face {
    font-family: 'Roboto Mono';
    src: url('./fonts/RobotoMono-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto Mono';
    src: url('./fonts/RobotoMono-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}
*/

/* CSS Variables for easy font switching */
:root {
    /* Primary label font (matches Zebra CG Triumvirate) */
    --font-zebra-sans: 'Liberation Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    
    /* Monospace font (for special labels) */
    --font-zebra-mono: 'Roboto Mono', 'Courier New', monospace;
    
    /* Font sizes matching Zebra printer dots
       203 DPI = 8 dots/mm
       Conversion: (dots / 8mm) * 3.779527559 = CSS pixels */
    --font-size-20-dots: 9.45px;   /* ZPL: ^A0N,20,20 */
    --font-size-25-dots: 11.81px;  /* ZPL: ^A0N,25,25 */
    --font-size-30-dots: 14.17px;  /* ZPL: ^A0N,30,30 */
    --font-size-35-dots: 16.53px;  /* ZPL: ^A0N,35,35 */
    --font-size-40-dots: 18.90px;  /* ZPL: ^A0N,40,40 */
    --font-size-45-dots: 21.26px;  /* ZPL: ^A0N,45,45 */
    --font-size-50-dots: 23.62px;  /* ZPL: ^A0N,50,50 */
}

/* Utility classes for quick font application */
.zebra-font-sans,
.zebra-font-default {
    font-family: var(--font-zebra-sans);
}

.zebra-font-mono {
    font-family: 'Courier New', monospace;
}

.zebra-font-serif {
    font-family: 'Times New Roman', 'Georgia', serif;
}

.zebra-font-condensed {
    font-family: var(--font-zebra-sans);
    font-stretch: condensed;
    letter-spacing: -0.5px;
}

.zebra-font-small {
    font-family: var(--font-zebra-sans);
    font-size: 0.7em !important;
}

.zebra-font-medium {
    font-family: var(--font-zebra-sans);
    font-size: 0.9em !important;
}

.zebra-font-large {
    font-family: var(--font-zebra-sans);
    font-size: 1.2em !important;
}

/* Font size utilities matching ZPL sizes */
.zebra-font-20 { font-size: var(--font-size-20-dots); }
.zebra-font-25 { font-size: var(--font-size-25-dots); }
.zebra-font-30 { font-size: var(--font-size-30-dots); }
.zebra-font-35 { font-size: var(--font-size-35-dots); }
.zebra-font-40 { font-size: var(--font-size-40-dots); }
.zebra-font-45 { font-size: var(--font-size-45-dots); }
.zebra-font-50 { font-size: var(--font-size-50-dots); }

/* Label preview font matching based on data-font-family attribute */
.label-preview .zpl-field[data-font-family="sans-serif"],
.label-preview .zpl-field[data-font-family="default"] {
    font-family: var(--font-zebra-sans);
}

.label-preview .zpl-field[data-font-family="mono"] {
    font-family: 'Courier New', monospace;
}

.label-preview .zpl-field[data-font-family="serif"] {
    font-family: 'Times New Roman', Georgia, serif;
}

.label-preview .zpl-field[data-font-family="condensed"] {
    font-family: var(--font-zebra-sans);
    font-stretch: condensed;
    letter-spacing: -0.5px;
}

.label-preview .zpl-field[data-font-family="small"] {
    font-size: 0.7em;
}

.label-preview .zpl-field[data-font-family="medium"] {
    font-size: 0.9em;
}

.label-preview .zpl-field[data-font-family="large"] {
    font-size: 1.1em;
}

