/* ============================================================
   NikApp — نقطه‌ی مرکزی استایل (بخش ۱۲ معماری)
   هیچ کد رنگی خارج از این فایل هاردکد نمی‌شود؛
   همه‌ی رنگ‌ها و مقادیر تکرارشونده به‌صورت CSS custom properties
   در :root همین فایل تعریف می‌شوند.
   ============================================================ */

/* ---------- فونت Vazirmatn v33.003 (لوکال) ---------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- متغیرهای مرکزی ---------- */
:root {
    /* رنگ‌ها */
    --nk-header-bg: #0B2A6B;      /* آبی نِیوی هدر (مطابق دیزاین) */
    --nk-header-fg: #ffffff;      /* رنگ آیکون‌ها/متن روی هدر */
    --nk-body-bg: #f6f7fb;        /* پس‌زمینه‌ی بدنه */
    --nk-nav-bg: #ffffff;         /* پس‌زمینه‌ی bottom nav */
    --nk-nav-fg: #6c757d;         /* رنگ تب غیرفعال */
    --nk-nav-active: #1a5cff;     /* رنگ تب فعال (آبی روشن دیزاین) */

    /* اندازه‌ها */
    --nk-header-height: 64px;
    --nk-nav-height: 64px;
    --nk-content-max-width: 480px; /* موبایل‌فرست: محدودیت عرض محتوا */
    --nk-avatar-size: 40px;
    --nk-radius: 1rem;

    /* سرعت افکت swipe بین صفحات */
    --nk-page-transition: 180ms;

    /* override متغیرهای Bootstrap */
    --bs-primary: var(--nk-nav-active);
    --bs-body-font-family: 'Vazirmatn', system-ui, sans-serif;
    --bs-body-bg: var(--nk-body-bg);
}

/* ---------- بدنه ---------- */
body {
    background-color: var(--nk-body-bg);
}

/* ---------- هدر ---------- */
.nk-header {
    height: var(--nk-header-height);
    background-color: var(--nk-header-bg);
    color: var(--nk-header-fg);
}

.nk-avatar {
    width: var(--nk-avatar-size);
    height: var(--nk-avatar-size);
    background-color: var(--nk-header-fg);
    color: var(--nk-header-bg);
    font-size: calc(var(--nk-avatar-size) * 0.55);
}

.nk-header-icon {
    font-size: 1.4rem;
}

/* ---------- محتوای اصلی ---------- */
.nk-page {
    max-width: var(--nk-content-max-width);
    padding: 1rem;
    /* جای bottom nav و safe-area پایین خالی بماند */
    padding-bottom: calc(var(--nk-nav-height) + 1rem + env(safe-area-inset-bottom));
}

/* ---------- افکت swipe بین صفحات (صرفاً بصری؛ routing سمت سرور است) ---------- */
.nk-page {
    transition: transform var(--nk-page-transition) ease,
                opacity var(--nk-page-transition) ease;
}
.nk-page-enter {
    opacity: 0;
    transform: translateX(-1.5rem);
}
.nk-page-leave {
    opacity: 0;
    transform: translateX(1.5rem);
}

/* ---------- Bottom Navigation ---------- */
.nk-bottomnav {
    max-width: var(--nk-content-max-width);
    height: calc(var(--nk-nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background-color: var(--nk-nav-bg);
    border-top: var(--bs-border-width) solid var(--bs-border-color);
}

.nk-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: var(--nk-nav-fg);
    text-decoration: none;
    font-size: 0.75rem;
}

.nk-nav-item i {
    font-size: 1.25rem;
}

.nk-nav-item.active {
    color: var(--nk-nav-active);
    box-shadow: inset 0 -3px 0 0 var(--nk-nav-active);
}
