/**
 * Sarabun Thai Font - Google Fonts
 * For Thai Language Support in UBU Finance System
 * 
 * Usage: <link rel="stylesheet" href="/assets/vendor/fonts/sarabun.css">
 */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@100;300;400;500;600;700;800&display=swap');

/**
 * Sarabun Font Family Definition
 * Supports Thai + English characters
 */
html,
body {
    font-family: 'Sarabun', 'Tahoma', 'Arial', sans-serif;
}

/**
 * Typography Classes
 */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Sarabun', sans-serif;
    font-weight: 600;
    color: #1F2937;
    line-height: 1.4;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
}

h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

h5 {
    font-size: 1.25rem;
    font-weight: 600;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
}

/* Paragraph and Body Text */
p {
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #374151;
}

/* Links */
a {
    font-family: 'Sarabun', sans-serif;
    text-decoration: none;
    color: #0091D0;
    transition: color 0.3s ease;
}

a:hover {
    color: #006FA6;
}

/* Buttons */
button,
.btn,
input[type="button"],
input[type="submit"] {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Form Elements */
input,
textarea,
select,
.form-control {
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 400;
}

input::placeholder,
textarea::placeholder {
    font-family: 'Sarabun', sans-serif;
    opacity: 0.7;
}

/* Labels */
label {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
    color: #1F2937;
}

/* Code and Monospace */
code,
pre {
    font-family: 'Courier New', monospace;
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Table */
table,
th,
td {
    font-family: 'Sarabun', sans-serif;
    font-weight: 400;
}

th {
    font-weight: 600;
}

/* Navigation */
nav,
.navbar {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/* Footer */
footer {
    font-family: 'Sarabun', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    p {
        font-size: 0.95rem;
    }

    button,
    .btn {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1rem;
    }

    p {
        font-size: 0.9rem;
    }
}

/**
 * Special Classes for Thai Text
 */

/* Thai emphasis */
.thai-bold {
    font-family: 'Sarabun', sans-serif;
    font-weight: 700;
}

.thai-light {
    font-family: 'Sarabun', sans-serif;
    font-weight: 300;
}

.thai-medium {
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/* Thai text alignment */
.thai-text-center {
    text-align: center;
    font-family: 'Sarabun', sans-serif;
}

.thai-text-right {
    text-align: right;
    font-family: 'Sarabun', sans-serif;
}

/**
 * Line Height Adjustment for Thai
 * Thai text needs slightly more line-height for readability
 */
.thai-line-height {
    line-height: 1.8;
}

/**
 * Letter Spacing for Thai
 * Improve readability
 */
.thai-letter-spacing {
    letter-spacing: 0.5px;
}

/**
 * Thai Accent Color
 */
.thai-accent {
    color: #8B1A1A; /* UBU Maroon */
    font-weight: 600;
}

/**
 * Thai Success Message
 */
.thai-success {
    color: #198754;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/**
 * Thai Error Message
 */
.thai-error {
    color: #DC3545;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/**
 * Thai Warning Message
 */
.thai-warning {
    color: #FFC107;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/**
 * Thai Info Message
 */
.thai-info {
    color: #0D6EFD;
    font-family: 'Sarabun', sans-serif;
    font-weight: 500;
}

/**
 * Fallback Font Stack
 * If Sarabun fails to load
 */
.sans-serif-fallback {
    font-family: 'Sarabun', 'Tahoma', 'Arial Unicode MS', Arial, sans-serif;
}

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

/**
 * System Font Stack Alternative
 */
.system-fonts {
    font-family: -apple-system, BlinkMacSystemFont, 'Sarabun', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

/**
 * Print Styles
 */
@media print {
    body {
        font-family: 'Sarabun', 'Times New Roman', serif;
        line-height: 1.6;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    p {
        orphans: 3;
        widows: 3;
    }
}
