/* --- 1. Font Definition --- */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* --- 2. Base Reset (Neutral) --- */
* {
    font-family: 'Vazir', Tahoma, sans-serif !important;
}

/* --- 3. FORCED RTL (Persian) --- */
/* We target the direction when 'dir' is rtl or when the lang is 'fa' */
html[dir="rtl"], 
html[lang="fa"],
body { 
    direction: rtl !important;
    text-align: right !important;
}

/* Sidebar & Nav for RTL */
html[dir="rtl"] .pf-v5-c-page__sidebar,
html[lang="fa"] .pf-v5-c-page__sidebar {
    order: 1 !important;
}

html[dir="rtl"] .pf-v5-c-nav__link,
html[lang="fa"] .pf-v5-c-nav__link {
    text-align: right !important;
}

/* --- 4. FORCED LTR (English) --- */
/* This block will OVERRIDE everything above ONLY when the direction is LTR */
html[dir="ltr"], 
html[lang="en"] {
    direction: ltr !important;
    text-align: left !important;
}

html[dir="ltr"] body, 
html[lang="en"] body {
    direction: ltr !important;
    text-align: left !important;
    font-family: sans-serif !important;
}

html[dir="ltr"] *, 
html[lang="en"] * {
    font-family: sans-serif !important; /* Switch font to standard for English */
}

html[dir="ltr"] .pf-v5-c-page__sidebar,
html[lang="en"] .pf-v5-c-page__sidebar {
    order: 0 !important; /* Sidebar back to left */
}

html[dir="ltr"] .pf-v5-c-nav__link,
html[lang="en"] .pf-v5-c-nav__link {
    text-align: left !important;
}

html[dir="ltr"] .pf-v5-c-nav,
html[lang="en"] .pf-v5-c-nav {
    direction: ltr !important;
}

/* --- 5. Masthead & Logo (Universal) --- */
.pf-v5-c-masthead__brand {
    display: flex !important;
    align-items: center !important;
}

.pf-v5-c-masthead__brand img {
    filter: brightness(0) invert(1) !important;
    height: 40px !important;
    width: auto;
}

/* --- 6. Dynamic Text based on Direction --- */
.pf-v5-c-masthead__brand::after {
    display: flex;
    color: white !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    white-space: nowrap;
}

/* Persian Title */
html[dir="rtl"] .pf-v5-c-masthead__brand::after,
html[lang="fa"] .pf-v5-c-masthead__brand::after {
    content: "سامانه مدیریت حساب کاربری دانشگاه بوعلی سینا";
    margin-right: 15px !important;
}

/* English Title */
html[dir="ltr"] .pf-v5-c-masthead__brand::after,
html[lang="en"] .pf-v5-c-masthead__brand::after {
    content: "BASU Account Management";
    margin-left: 15px !important;
    margin-right: 0 !important;
}