/* ============================================
   Enhanced Typography System with Inter Font
   ============================================ */

/* Google Fonts - Inter (supports Cyrillic and Latin) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Typography Scale - Clear Hierarchy */
:root {
    /* Font Family */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'Courier New', 'Consolas', 'Monaco', monospace;
    
    /* Font Sizes - Modular Scale (1.25 ratio) */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* Line Heights - Optimized for readability */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* Letter Spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;
    
    /* Text Colors */
    --text-color-primary: #1a1a1a;
    --text-color-secondary: #4a5568;
    --text-color-tertiary: #718096;
    --text-color-inverse: #ffffff;
}

/* Base Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-normal);
    color: var(--text-color-primary);
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings - Clear Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-base);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text-color-primary);
    margin-bottom: 0.5em;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tighter);
    margin-bottom: 0.75em;
}

h2 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: 0.75em;
}

h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: 0.5em;
}

h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    margin-bottom: 0.5em;
}

h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    margin-bottom: 0.5em;
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
    margin-bottom: 0.5em;
}

/* Paragraphs */
p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    letter-spacing: var(--letter-spacing-normal);
    margin-bottom: 1em;
    color: var(--text-color-primary);
}

/* Links */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: var(--letter-spacing-normal);
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Lists */
ul, ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
    line-height: var(--line-height-relaxed);
}

li {
    margin-bottom: 0.5em;
    line-height: var(--line-height-relaxed);
}

/* Text Utilities */
.text-xs {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
}

.text-sm {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.text-base {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

.text-lg {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

.text-xl {
    font-size: var(--font-size-xl);
    line-height: var(--line-height-relaxed);
}

.text-2xl {
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-snug);
}

.text-3xl {
    font-size: var(--font-size-3xl);
    line-height: var(--line-height-snug);
}

/* Font Weights */
.font-light {
    font-weight: var(--font-weight-light);
}

.font-normal {
    font-weight: var(--font-weight-normal);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

.font-extrabold {
    font-weight: var(--font-weight-extrabold);
}

/* Text Colors */
.text-primary {
    color: var(--text-color-primary);
}

.text-secondary {
    color: var(--text-color-secondary);
}

.text-tertiary {
    color: var(--text-color-tertiary);
}

.text-inverse {
    color: var(--text-color-inverse);
}

/* Monospace (for phone numbers, codes, etc.) */
code, pre, .mono, .phone-number {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-medium);
}

/* Tables - Improved Typography */
table {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

table th {
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    font-size: var(--font-size-sm);
}

table td {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
}

/* Forms - Better Typography */
label {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-normal);
    margin-bottom: 0.5rem;
    display: block;
}

input, select, textarea {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-color-tertiary);
    font-weight: var(--font-weight-normal);
}

/* Buttons - Typography */
.btn {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-wide);
    line-height: var(--line-height-normal);
}

.btn-sm {
    font-size: var(--font-size-sm);
    letter-spacing: var(--letter-spacing-normal);
}

.btn-lg {
    font-size: var(--font-size-lg);
    letter-spacing: var(--letter-spacing-wide);
}

/* Navigation - Typography */
.navbar-brand {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-tight);
}

.navbar-user a {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-normal);
}

/* Alerts - Typography */
.alert {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    font-weight: var(--font-weight-normal);
}

.alert strong {
    font-weight: var(--font-weight-semibold);
}

/* Cards - Typography */
.stat-card h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

.stat-card p {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    color: var(--text-color-secondary);
}

/* Responsive Typography */
@media (max-width: 768px) {
    :root {
        --font-size-5xl: 2.25rem;  /* 36px */
        --font-size-4xl: 1.875rem; /* 30px */
        --font-size-3xl: 1.5rem;    /* 24px */
        --font-size-2xl: 1.25rem;   /* 20px */
    }
    
    h1 {
        font-size: var(--font-size-3xl);
    }
    
    h2 {
        font-size: var(--font-size-2xl);
    }
    
    h3 {
        font-size: var(--font-size-xl);
    }
    
    body {
        font-size: var(--font-size-base);
    }
    
    .navbar-brand {
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-4xl: 1.5rem;   /* 24px */
        --font-size-3xl: 1.25rem;   /* 20px */
        --font-size-2xl: 1.125rem;  /* 18px */
    }
    
    h1 {
        font-size: var(--font-size-2xl);
    }
    
    h2 {
        font-size: var(--font-size-xl);
    }
    
    body {
        font-size: var(--font-size-sm);
    }
}

