@font-face {
    font-family: 'OfflineSans';
    src: url('../fonts/Sahel-FD.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'OfflineSans';
    src: url('../fonts/Sahel-Bold-FD.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef2f7;
    --text: #18212f;
    --muted: #64748b;
    --line: #d7deea;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --danger: #b42318;
    --warning: #b45309;
    --success: #166534;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'OfflineSans', Tahoma, Arial, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #eef4f8 100%);
    color: var(--text);
    line-height: 1.65;
    direction: rtl;
    text-align: right;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-strong);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container,
.container-fluid {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.row,
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.row > *,
.form-row > * {
    flex: 1 1 240px;
    min-width: 0;
}

.col-6,
.col-md-3,
.col-md-4,
.col-md-6,
.col-lg-4 {
    flex: 1 1 280px;
}

@media (min-width: 768px) {
    .col-6 { flex-basis: calc(50% - 1rem); }
    .col-md-3 { flex-basis: calc(25% - 1rem); }
    .col-md-4 { flex-basis: calc(33.333% - 1rem); }
    .col-md-6 { flex-basis: calc(50% - 1rem); }
    .col-lg-4 { flex-basis: calc(33.333% - 1rem); }
}

.card,
.modal-content,
.dropdown-content,
.alert,
.list-group-item,
.table-responsive,
.sidebar-widget,
.service-card,
.stat-card,
.category-news-item,
.news-item,
.exercise-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card,
.service-card,
.stat-card,
.exercise-card,
.news-item,
.category-news-item,
.sidebar-widget {
    padding: 1rem;
}

.card-header,
.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-body,
.modal-body,
.modal-footer {
    padding: 1rem 1.25rem;
}

.btn,
button,
input[type='submit'],
input[type='button'] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #dfe7ef;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
button:hover,
input[type='submit']:hover,
input[type='button']:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-sm {
    min-height: 36px;
    padding: 0.45rem 0.8rem;
    font-size: 0.92rem;
}

.btn-lg {
    min-height: 48px;
    padding: 0.85rem 1.35rem;
}

.btn-block,
.w-100 {
    width: 100%;
}

.btn-primary,
.btn-success,
.btn-info,
.btn-custom,
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.btn-light:hover {
    background: var(--primary);
    color: #fff;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline,
.btn-light {
    background: #fff;
    border-color: var(--line);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.text-primary {
    color: var(--primary) !important;
}

.alert {
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}

.alert-danger {
    background: #fff1f1;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #edfdf3;
    border-color: #bbf7d0;
    color: #166534;
}

.form-control,
.custom-file-label,
select,
textarea,
input[type='text'],
input[type='number'],
input[type='email'],
input[type='password'],
input[type='date'],
input[type='tel'] {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
}

.form-group,
.mb-2,
.mb-3,
.mb-4,
.mb-5,
.mt-3,
.mt-4,
.mt-5,
.my-2,
.py-3,
.p-4 {
    margin-bottom: 1rem;
}

.mt-3,
.mt-4,
.mt-5 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.25rem; }
.mb-5 { margin-bottom: 1.75rem; }
.mx-1 { margin-inline: 0.25rem; }
.ms-2 { margin-inline-start: 0.5rem; }
.ms-3 { margin-inline-start: 0.75rem; }
.px-5 { padding-inline: 1.25rem; }
.py-3 { padding-block: 0.9rem; }
.p-4 { padding: 1rem; }
.rounded-pill { border-radius: 999px; }
.h-100 { height: 100%; }
.d-flex { display: flex; }
.d-block { display: block; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.text-center { text-align: center; }
.float-right { float: inline-end; }

.navbar,
.header-container,
.nav-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin: 1rem auto;
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-toggler {
    display: none;
}

.collapse {
    display: block;
}

@media (max-width: 768px) {
    .navbar-toggler {
        display: inline-flex;
    }

    .collapse:not(.show) {
        display: none;
    }

    .navbar-collapse,
    .navbar-nav,
    .nav-menu {
        width: 100%;
    }
}

.table-responsive {
    overflow: auto;
    padding: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 0.8rem;
    border: 1px solid var(--line);
    vertical-align: top;
}

thead,
.thead-dark {
    background: #dce7ef;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f8fbfd;
}

.pagination,
.list-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.page-link,
.list-group-item {
    padding: 0.65rem 0.9rem;
}

.page-item.active .page-link,
.page-link.active {
    background: var(--primary);
    color: #fff;
    border-radius: 999px;
}

.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    padding: 2rem 1rem;
    overflow: auto;
}

.modal.show {
    display: block;
}

.modal-dialog {
    width: min(760px, 100%);
    margin: 0 auto;
}

.close,
.btn-close,
.modal-close {
    cursor: pointer;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 1.5rem;
    min-height: auto;
    padding: 0.2rem 0.4rem;
}

.dropdown:hover .dropdown-content,
.dropdown-content.show {
    display: block;
}

.dropdown-content {
    display: none;
    min-width: 220px;
    padding: 0.5rem;
}

.footer-link,
.nav-link,
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.badge,
.date-badge,
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: #e2f3f1;
    color: var(--primary-strong);
    font-size: 0.9rem;
}

pre,
code {
    direction: ltr;
    text-align: left;
}

iframe,
video {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: #000;
}
