/* ==========================================================
   REHMAT-UL-LIL-ALAMEEN SCHOLARSHIP PORTAL - SHARED STYLES
   Ported from the department template (template/css/style.css):
   same colours, fonts, header, hero, cards, tables and footer.
   Uses logical properties (inline-start/end) so LTR (English)
   and RTL (Urdu) share one stylesheet.
========================================================== */

:root {
    --green: #075943;
    --green-dark: #034d3a;
    --green-light: #eef9f2;
    --green-btn: #168256;

    --blue: #1976c9;
    --blue-light: #eef6ff;

    --orange: #e58a0b;
    --orange-light: #fff6e7;

    --red: #d44b3f;
    --red-light: #fff3f1;

    --text: #102530;
    --muted: #52636b;
    --border: #dfe6e5;
    --white: #ffffff;
    --page-bg: #f4f8f6;

    --font-latin: Arial, "Segoe UI", sans-serif;
    --font-serif: Georgia, serif;
    --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
    --font-urdu-ui: Arial, "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", Tahoma, sans-serif;

    --radius: 12px;
    --shadow: 0 10px 28px rgba(3, 77, 58, .08);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-latin);
    color: var(--text);
    background: var(--white);
    line-height: 1.5;
}

img { max-width: 100%; }
a { color: var(--green); }
h1:focus { outline: none; }

[lang="ur"] { font-family: var(--font-urdu-ui); }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.small-text { font-size: 13px; }
.ltr-input, .ltr-text { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.req { color: var(--red); }
.big { font-size: 44px; line-height: 1.2; margin-bottom: 8px; }
.hide-sm { display: inline; }
.ur { font-family: var(--font-urdu); }

.spinner {
    width: 38px; height: 38px; border-radius: 50%;
    border: 4px solid #d6e6df; border-top-color: var(--green);
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot-loader {
    position: fixed; inset: 0; z-index: 900; background: #f4f8f6;
    display: flex; align-items: center; justify-content: center;
}
.boot-loader.inline { position: static; min-height: 240px; background: transparent; }

/* ---------- buttons ---------- */
.btn {
    border: 0; border-radius: 8px; padding: 11px 20px; font: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; min-height: 42px; line-height: 1.2; transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 5px 13px rgba(7, 89, 67, .18); }
.btn-primary:hover { background: #064a39; }
.btn-secondary { background: #fff; border: 1px solid #bdccca; color: #2d4b42; }
.btn-secondary:hover { background: #f1f6f4; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b93e33; }
.btn-warn { background: var(--orange); color: #fff; }
.btn-sm { padding: 7px 12px; min-height: 34px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.link-btn { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.link-btn.danger { color: var(--red); }

/* ---------- forms ---------- */
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; font-weight: 700; color: #2d3f3a; margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #cbd9d6; background: #fff; border-radius: 8px;
    font: 16px var(--font-latin); color: #1d2d28; outline: none; transition: border-color .15s, box-shadow .15s;
}
[lang="ur"] .field input, [lang="ur"] .field select, [lang="ur"] .field textarea { font-family: var(--font-urdu-ui); }
.field textarea { resize: vertical; min-height: 78px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #0b8b67; box-shadow: 0 0 0 3px rgba(11, 139, 103, .12); }
.field input[readonly] { background: #f0f5f3; color: #70817b; cursor: default; }
.field select:disabled { background: #f0f5f3; cursor: not-allowed; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .input-error {
    border-color: var(--red) !important; background: #fff7f6 !important; box-shadow: 0 0 0 3px rgba(212, 75, 63, .08) !important;
}
.field-error { color: #b93e33; font-size: 12.5px; margin-top: 5px; line-height: 1.5; }
.alert-error {
    margin: 0 0 14px; padding: 11px 14px; border: 1px solid #efb1aa; border-inline-start: 4px solid var(--red);
    background: var(--red-light); color: #a52f27; border-radius: 8px; font-size: 14px; font-weight: 700;
}
.alert-ok {
    margin: 0 0 14px; padding: 11px 14px; border: 1px solid #b6dfcb; border-inline-start: 4px solid #168256;
    background: var(--green-light); color: #0b5d47; border-radius: 8px; font-size: 14px; font-weight: 700;
}

/* ---------- chips / panels ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
    font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.chip-ok { background: #dff2e9; color: #087052; }
.chip-bad { background: #fde3e0; color: #b93e33; }
.chip-wait { background: #e7f1fb; color: #155f99; }
.chip-warn { background: #fff0d6; color: #8c5300; }
.chip-muted { background: #eef1f0; color: #62726c; }

.panel {
    margin-top: 20px; padding: 18px 20px; background: #fff; border: 1px solid #dbe8e3; border-radius: var(--radius);
}
.panel-title { margin: 0 0 12px; font-size: 17px; color: var(--green); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 700; word-break: break-word; }

/* ==========================================================
   TOP GOVERNMENT BAR
========================================================== */
.top-bar {
    min-height: 40px; padding: 4px 5.2%; background: var(--green); color: #fff;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px;
}
.gov-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.gov-mark {
    width: 20px; height: 20px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 10px;
}
.top-right { display: flex; align-items: center; gap: 20px; }
.lang-toggle {
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); color: #fff; border-radius: 99px;
    padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.lang-toggle:hover { background: rgba(255, 255, 255, .22); }
.lang-toggle .on { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.lang-toggle .sep { opacity: .6; }

/* ==========================================================
   COMMON HEADER (logo -> name -> menu). Always LTR like the template.
========================================================== */
.header, .common-site-header {
    direction: ltr; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 28px;
    min-height: 92px; padding: 8px 5.2%; background: #fff; border-bottom: 1px solid #e4ebe8;
}
.department { display: flex; align-items: center; gap: 16px; min-width: 0; }
.logo { width: 82px; height: 68px; object-fit: contain; flex: 0 0 82px; }
.department-text { text-align: left; min-width: 0; }
.department-text h2 { margin: 0; font-size: 21px; line-height: 1.2; color: #172923; font-weight: 800; }
.department-text p { margin: 4px 0 0; font-size: 13px; color: #64746f; }

.common-site-header nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.common-site-header nav a {
    display: inline-flex; align-items: center; justify-content: center; color: #30433e; text-decoration: none;
    font-size: 14px; font-weight: 500; padding: 10px 15px; border-radius: 8px; white-space: nowrap;
}
.common-site-header nav a:hover, .common-site-header nav a.active { background: var(--green); color: #fff; }
.common-site-header nav.nav-ur a { font-family: var(--font-urdu-ui); font-size: 15px; }

/* ==========================================================
   HERO
========================================================== */
.hero {
    min-height: 270px; display: flex; align-items: center; justify-content: center; text-align: center;
    position: relative; overflow: hidden;
    background:
        linear-gradient(rgba(255, 255, 255, .80), rgba(255, 255, 255, .90)),
        url("../img/mosque.jpg") left center / 35% 100% no-repeat,
        url("../img/books.jpg") right center / 30% 100% no-repeat;
    background-color: #edf6f5;
}
.hero.small, .hero.status-hero-small { min-height: 190px; }
.hero-content { padding: 20px; position: relative; z-index: 2; max-width: 980px; }
.urdu-title { font-family: var(--font-urdu); direction: rtl; font-size: 45px; font-weight: bold; color: #006047; line-height: normal; }
.hero h1 { margin: 0; font-family: var(--font-serif); font-size: 38px; line-height: 1.25; }
.subtitle { margin: 8px 0; font-family: var(--font-serif); font-size: 20px; color: #175d4c; }
.hero-line { width: 290px; max-width: 70%; height: 1px; background: #1d6554; margin: 14px auto; }
.window-chip {
    display: inline-block; margin-top: 4px; padding: 7px 18px; border-radius: 99px; font-size: 14px; font-weight: 700; border: 1px solid;
}
.window-chip.open { background: #e4f5ec; color: #0b5d47; border-color: #b6dfcb; }
.window-chip.closed { background: var(--orange-light); color: #8c5300; border-color: #f0d6a6; }

/* ==========================================================
   HOME - three cards, table, information strip
========================================================== */
.home-main { padding: 25px 4%; }

.cards { max-width: 1430px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
    min-height: 315px; padding: 28px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.card.green { background: var(--green-light); color: var(--green); }
.card.blue { background: var(--blue-light); color: #155f99; }
.card.orange { background: var(--orange-light); color: #8c5300; }

.icon {
    width: 95px; height: 95px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 43px; margin-bottom: 12px;
}
.green .icon { background: #168256; }
.blue .icon { background: var(--blue); }
.orange .icon { background: var(--orange); }

.card h2 { margin: 0; font-size: 29px; }
.urdu { font-family: var(--font-urdu); direction: rtl; font-size: 25px; font-weight: bold; margin: 4px 0 10px; line-height: 1.5; }
.card p { max-width: 430px; min-height: 52px; color: #283d45; font-size: 17px; line-height: 1.6; }

.button {
    display: inline-block; width: 310px; max-width: 100%; padding: 13px 20px; border-radius: 30px; color: #fff;
    text-decoration: none; font-size: 18px; font-weight: bold; text-align: center; cursor: pointer;
}
.green .button { background: var(--green-btn); }
.blue .button { background: var(--blue); }
.orange .button { background: var(--orange); }
.button:hover { opacity: .9; }
.button.disabled { opacity: .45; cursor: not-allowed; }
.button.primary { background: var(--green-btn); width: auto; }

.scholarship-table-section {
    max-width: 1430px; margin: 34px auto 0; padding: 30px 32px 34px;
    background: linear-gradient(135deg, #f8fcfa, #ffffff); border: 1px solid #dce9e5; border-radius: 18px; box-shadow: var(--shadow);
}
.section-heading { text-align: center; margin-bottom: 22px; }
.section-heading-urdu { font-family: var(--font-urdu); direction: rtl; color: var(--green-dark); font-size: 31px; font-weight: bold; line-height: 1.5; }
[lang="en"] .section-heading-urdu { font-family: var(--font-latin); direction: ltr; line-height: 1.3; }
.section-heading-line { width: 80px; height: 4px; margin: 8px auto 7px; border-radius: 10px; background: var(--green); }
.section-heading p { margin: 0; color: var(--muted); font-size: 15px; }

.scholarship-table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid #cfded9; box-shadow: 0 6px 18px rgba(3, 77, 58, .06); }
.scholarship-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.scholarship-table th {
    padding: 18px 20px; background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff;
    font-family: var(--font-urdu-ui); font-size: 18px; font-weight: bold; text-align: center;
    border-inline-start: 1px solid rgba(255, 255, 255, .25);
}
[lang="ur"] .scholarship-table th { font-family: var(--font-urdu); font-size: 20px; }
.scholarship-table th:first-child, .scholarship-table td:first-child { border-inline-start: none; }
.scholarship-table td { padding: 17px 20px; text-align: center; font-size: 19px; border-inline-start: 1px solid #e1e9e7; border-bottom: 1px solid #e1e9e7; }
.scholarship-table tbody tr:nth-child(odd) td { background: #f1f8f5; }
.scholarship-table tbody tr:nth-child(even) td { background: #fff; }
.scholarship-table tbody tr:hover td { background: #e7f4ee; }
.scholarship-table tbody tr:last-child td { border-bottom: none; }
.scholarship-table td.cls { font-family: var(--font-urdu); font-size: 22px; font-weight: bold; color: #173a32; }
[lang="en"] .scholarship-table td.cls { font-family: var(--font-latin); font-size: 19px; }
.scholarship-table td.num { font-weight: bold; color: var(--green-dark); font-size: 22px; }

.information {
    max-width: 1430px; margin: 18px auto 0; display: grid; grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.info { padding: 20px; display: flex; align-items: center; gap: 15px; border-inline-end: 1px solid #e2e7e7; }
.info:last-child { border-inline-end: none; }
.info-icon {
    width: 58px; height: 58px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: #eff7f5; color: var(--green); font-size: 25px;
}
.info strong { font-size: 15px; }
.info p { margin: 5px 0 0; font-size: 14px; line-height: 1.5; }

/* ==========================================================
   GENERIC CONTENT PAGES (advertisement, not-found)
========================================================== */
.simple-page { padding: 30px 4% 50px; background: var(--page-bg); }
.simple-page.wide { padding-top: 24px; }
.simple-card { max-width: 560px; margin: 40px auto; padding: 40px 30px; text-align: center; background: #fff; border: 1px solid #dbe8e3; border-radius: 16px; box-shadow: var(--shadow); }
.ad-grid { max-width: 1180px; margin: auto; display: grid; grid-template-columns: 1fr 1.3fr; gap: 0 20px; align-items: start; }
.ad-grid .span2 { grid-column: 1 / -1; }
.prose { line-height: 1.9; margin: 0; }
.flow { padding-inline-start: 22px; line-height: 1.9; margin: 0 0 14px; }
.doc-images img { width: 100%; border-radius: 10px; box-shadow: 0 3px 15px rgba(21, 62, 51, .06); }

/* ==========================================================
   FOOTER
========================================================== */
.site-footer {
    min-height: 120px; padding: 25px 4%; background: linear-gradient(90deg, var(--green), var(--green-dark)); color: #fff;
    display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; gap: 25px; font-size: 14px;
}
.site-footer p { margin: 7px 0 0; }
.social { text-align: center; }
.footer-right { text-align: right; }
.footer-link { color: #fff; text-decoration: none; }
.footer-link:hover { text-decoration: underline; }

/* ==========================================================
   RECONNECT MODAL (see js/reconnect.js)
========================================================== */
.reconnect-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .45); align-items: center; justify-content: center; padding: 16px; }
.reconnect-box { background: #fff; border-radius: 12px; padding: 32px 30px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 8px 32px rgba(0, 0, 0, .25); }
.reconnect-box h4 { margin: 14px 0 8px; color: #333; font-size: 18px; font-weight: 600; }
.reconnect-box p { margin: 0 0 12px; color: #666; font-size: 14px; }
.reconnect-timer { font-size: 28px; font-weight: 700; color: var(--orange); margin-bottom: 16px; }
.reconnect-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.reconnect-actions button { padding: 9px 20px; border: 0; border-radius: 6px; color: #fff; font-size: 14px; cursor: pointer; }
#reconnect-retry-btn { background: #28a745; }
#reconnect-reload-btn { background: #007bff; }

.access-denied { max-width: 480px; margin: 60px auto; text-align: center; padding: 30px; }
#blazor-error-ui { display: none; }

/* ==========================================================
   TABLET
========================================================== */
@media (max-width: 1000px) {
    .header, .common-site-header { padding: 8px 3%; gap: 18px; }
    .department-text h2 { font-size: 17px; }
    .common-site-header nav a { font-size: 13px; padding: 9px 11px; }
    .cards { grid-template-columns: 1fr; max-width: 650px; }
    .information { grid-template-columns: 1fr 1fr; }
    .info:nth-child(2) { border-inline-end: none; }
    .info:nth-child(-n+2) { border-bottom: 1px solid #e2e7e7; }
    .scholarship-table-section { padding: 24px 18px 28px; }
    .site-footer { grid-template-columns: 1fr; text-align: center; }
    .footer-right { text-align: center; }
    .ad-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   PHONE
========================================================== */
@media (max-width: 760px) {
    .top-bar { padding: 4px 12px; font-size: 12px; }
    .hide-sm { display: none; }
    .header, .common-site-header { min-height: auto; flex-wrap: wrap; gap: 8px 14px; padding: 9px 14px; }
    .department { flex: 1 1 100%; gap: 10px; }
    .logo { width: 62px; height: 54px; flex-basis: 62px; }
    .department-text h2 { font-size: 14px; }
    .department-text p { font-size: 11px; }
    .common-site-header nav { width: 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
    .common-site-header nav a { font-size: 13px; padding: 9px 13px; }

    .hero { min-height: 230px; }
    .hero.small, .hero.status-hero-small { min-height: 170px; }
    .urdu-title { font-size: 28px; }
    .hero h1 { font-size: 24px; }
    .subtitle { font-size: 15px; }

    .home-main { padding: 18px 12px; }
    .card { min-height: 0; padding: 22px 16px; }
    .card h2 { font-size: 24px; }
    .icon { width: 76px; height: 76px; font-size: 34px; }
    .information { grid-template-columns: 1fr; }
    .info { border-inline-end: none; border-bottom: 1px solid #e2e7e7; }
    .info:last-child { border-bottom: none; }
    .scholarship-table-section { padding: 20px 10px 24px; border-radius: 12px; }
    .section-heading-urdu { font-size: 25px; }
    .scholarship-table th { padding: 13px 10px; font-size: 15px; }
    .scholarship-table td { padding: 13px 10px; font-size: 16px; }
    .scholarship-table td.cls { font-size: 18px; }
    .scholarship-table td.num { font-size: 18px; }
    .button { width: 92%; font-size: 17px; }
    .simple-page { padding: 20px 12px 40px; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
}
