/* Arabic Font - GESS Two */

@font-face {
    font-family: 'GESS Two';
    src: url('../fonts/ar/GESSTwoLight.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GESS Two';
    src: url('../fonts/ar/GESSTwoMedium.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'GESS Two';
    src: url('../fonts/ar/GESSTwoBold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* English Font - Source Sans Pro */

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/en/SourceSansPro-Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/en/SourceSansPro-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Source Sans Pro';
    src: url('../fonts/en/SourceSansPro-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Default font - English (Source Sans Pro) */
body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Apply GESS Two font to Arabic content */
[lang="ar"],
[lang="ar"] *,
[dir="rtl"],
[dir="rtl"] * {
    font-family: 'GESS Two', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Exclude icon fonts from custom font application */
.fa, .fas, .far, .fal, .fab,
[class^="fa-"], [class*=" fa-"],
.glyphicon,
.material-icons,
.mdi,
i[class^="icon-"], i[class*=" icon-"],
span[class^="icon-"], span[class*=" icon-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome", "Glyphicons Halflings", "Material Icons" !important;
}

/* English content styling */
body,
.modal,
.card,
.btn,
.form-control,
.form-select,
.alert,
.navbar,
.dropdown-menu,
input,
textarea,
select,
label,
h1, h2, h3, h4, h5, h6,
p, span, div, a, li, td, th {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Exclude Font Awesome and other icon fonts */
.fa, .fas, .far, .fal, .fab,
[class^="fa-"], [class*=" fa-"],
.glyphicon,
.material-icons,
i.fa, i.fas, i.far, i.fal, i.fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Arabic content styling - Override with GESS Two */
[lang="ar"] body,
[lang="ar"] .modal,
[lang="ar"] .card,
[lang="ar"] .btn,
[lang="ar"] .form-control,
[lang="ar"] .form-select,
[lang="ar"] .alert,
[lang="ar"] .navbar,
[lang="ar"] .dropdown-menu,
[lang="ar"] input,
[lang="ar"] textarea,
[lang="ar"] select,
[lang="ar"] label,
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3,
[lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6,
[lang="ar"] p, [lang="ar"] span, [lang="ar"] div,
[lang="ar"] a, [lang="ar"] li, [lang="ar"] td, [lang="ar"] th {
    font-family: 'GESS Two', sans-serif;
}

/* Ensure icons work in Arabic mode too */
[lang="ar"] .fa, [lang="ar"] .fas, [lang="ar"] .far, [lang="ar"] .fal, [lang="ar"] .fab,
[lang="ar"] [class^="fa-"], [lang="ar"] [class*=" fa-"],
[lang="ar"] i.fa, [lang="ar"] i.fas, [lang="ar"] i.far, [lang="ar"] i.fal, [lang="ar"] i.fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
}

/* Survey modal - English by default */
#surveyModal,
.survey-question,
.survey-question-text,
.checkbox-option label,
.free-text-input,
.modal-title,
.modal-body,
.alert {
    font-family: 'Source Sans Pro', sans-serif;
}

/* Survey modal - Arabic override */
[lang="ar"] #surveyModal,
[lang="ar"] .survey-question,
[lang="ar"] .survey-question-text,
[lang="ar"] .checkbox-option label,
[lang="ar"] .free-text-input,
[lang="ar"] .modal-title,
[lang="ar"] .modal-body,
[lang="ar"] .alert {
    font-family: 'GESS Two', sans-serif;
}

/* Protect icons in survey modals */
#surveyModal .fa, #surveyModal .fas, #surveyModal .far, #surveyModal .fal, #surveyModal .fab,
#surveyModal i.fa, #surveyModal i.fas, #surveyModal i.far {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome" !important;
}

/* Improve readability */
body {
    line-height: 1.7;
    letter-spacing: 0.01em;
}

/* Improve readability for Arabic text specifically */
[lang="ar"] {
    line-height: 1.8;
    letter-spacing: 0.02em;
}

.modal-title {
    font-weight: 700;
}

.survey-question-text {
    font-weight: 600;
}

/* Admin panel styling - English by default */
.admin,
.admin * {
    font-family: 'Source Sans Pro', sans-serif;
}

/* Admin panel - Arabic override */
[lang="ar"] .admin,
[lang="ar"] .admin * {
    font-family: 'GESS Two', sans-serif;
}

/* Protect icons in admin panel */
.admin .fa, .admin .fas, .admin .far, .admin .fal, .admin .fab,
.admin i[class^="fa"], .admin i[class*=" fa"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "FontAwesome" !important;
}

/* Bootstrap overrides */
.btn {
    font-weight: 500;
}

.navbar-brand,
.nav-link {
    font-weight: 500;
}

