/* =====================================================
   TYPOGRAPHY ENHANCEMENTS FOR ALL PAGES
   Enhanced text display, readability, and visual hierarchy
   ===================================================== */

/* Global Typography Improvements */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Headings Global */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.3px;
    margin-bottom: 1rem;
    color: #1a202c !important;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 4vw, 3rem); font-weight: 800; }
h3 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 700; }
h4 { font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 700; }
h5 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); font-weight: 600; }
h6 { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 600; }

/* Ensure card body headings are always visible and dark */
.card-body h1,
.card-body h2,
.card-body h3,
.card-body h4,
.card-body h5,
.card-body h6 {
    color: #1a202c !important;
}

/* Paragraphs & Text */
p {
    line-height: 1.8;
    margin-bottom: 1.2rem;
    color: #4a5568;
    font-size: clamp(15px, 2vw, 16px);
}

/* Links */
a {
    color: #667eea;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #764ba2;
}

/* Lists */
ul, ol {
    line-height: 1.8;
    margin-bottom: 1.2rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

/* Strong & Bold */
strong, b {
    font-weight: 700;
    color: #1a202c;
}

/* Emphasis & Italic */
em, i {
    font-style: italic;
}

/* Small Text */
small {
    font-size: 0.875rem;
    color: #718096;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4a5568;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Code */
code {
    background: #f7fafc;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #e53e3e;
}

pre {
    background: #2d3748;
    color: #f7fafc;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Form Labels */
label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    display: block;
    font-size: clamp(14px, 1.5vw, 15px);
    letter-spacing: 0.2px;
}

/* Input & Textarea */
input, textarea, select {
    font-size: clamp(14px, 1.5vw, 15px);
    line-height: 1.6;
    color: #1a202c;
    letter-spacing: 0.2px;
}

input::placeholder,
textarea::placeholder {
    color: #a0aec0;
    opacity: 1;
}

/* Tables */
table {
    font-size: clamp(13px, 1.5vw, 14px);
}

table th {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: clamp(12px, 1.5vw, 13px);
}

table td {
    font-weight: 500;
    color: #2d3748;
}

/* Buttons */
.btn, button {
    font-weight: 600;
    letter-spacing: 0.3px;
    font-size: clamp(14px, 1.5vw, 15px);
}

/* Card Titles */
.card-title {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 700;
    color: #1a202c;
    letter-spacing: 0.3px;
}

/* Stat Cards */
.stat-value {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #1a202c;
}

.stat-label {
    font-size: clamp(13px, 1.5vw, 14px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #718096;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: clamp(13px, 1.5vw, 14px);
    font-weight: 500;
    letter-spacing: 0.2px;
    color: #718096;
}

/* Alerts & Messages */
.alert {
    font-size: clamp(14px, 1.5vw, 15px);
    line-height: 1.7;
}

/* Badge & Tags */
.badge {
    font-size: clamp(11px, 1.2vw, 12px);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Tooltips */
.tooltip {
    font-size: 13px;
    line-height: 1.5;
}

/* Page Titles */
.page-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #1a202c;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

/* Section Titles */
.section-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 800;
    color: #1a202c;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

/* Subsection Titles */
.subsection-title {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 0.3px;
    margin-bottom: 1rem;
}

/* Lead Text */
.lead {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    line-height: 1.8;
    color: #4a5568;
    font-weight: 400;
}

/* Text Utilities */
.text-muted {
    color: #718096 !important;
}

.text-primary {
    color: #667eea !important;
}

.text-secondary {
    color: #764ba2 !important;
}

.text-success {
    color: #48bb78 !important;
}

.text-danger {
    color: #f56565 !important;
}

.text-warning {
    color: #ed8936 !important;
}

.text-info {
    color: #4299e1 !important;
}

/* Font Weight Utilities */
.font-weight-light {
    font-weight: 300 !important;
}

.font-weight-normal {
    font-weight: 400 !important;
}

.font-weight-medium {
    font-weight: 500 !important;
}

.font-weight-semibold {
    font-weight: 600 !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.font-weight-extrabold {
    font-weight: 800 !important;
}

/* Responsive Typography Adjustments */
@media (max-width: 1200px) {
    body {
        font-size: 15px;
    }
}

@media (max-width: 992px) {
    body {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    p {
        margin-bottom: 1rem;
    }
    
    blockquote {
        padding-left: 1rem;
        margin: 1rem 0;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 0.75rem;
    }
    
    p {
        margin-bottom: 0.9rem;
    }
}

/* Print Styles */
@media print {
    body {
        font-size: 12pt;
        color: #000;
    }
    
    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
    h4 { font-size: 14pt; }
    h5 { font-size: 12pt; }
    h6 { font-size: 11pt; }
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: #667eea;
    color: white;
}

::-moz-selection {
    background: #667eea;
    color: white;
}
