/* ========== فونت‌های لوکال ========== */
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 500; font-display: swap;
    src: url('/fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 600; font-display: swap;
    src: url('/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('/fonts/inter-v20-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 800; font-display: swap;
    src: url('/fonts/inter-v20-latin-800.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal; font-weight: 900; font-display: swap;
    src: url('/fonts/inter-v20-latin-900.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('/fonts/jetbrains-mono-v24-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal; font-weight: 500; font-display: swap;
    src: url('/fonts/jetbrains-mono-v24-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('/fonts/jetbrains-mono-v24-latin-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Vazirmatn';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2');
}

/* ========== متغیرهای رنگی ========== */
:root {
    --bg-dark: #000000;
    --bg-card: #0a0a0a;
    --text-main: #ffffff;
    --text-muted: #888888;
    --border-color: #222222;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Vazirmatn', sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text-main); text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--text-muted); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 2vw; }

/* --- Navbar --- */
header {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.nav-wrapper {
    display: flex; justify-content: space-between; align-items: center;
    height: 70px; position: relative;
}
.nav-section { flex: 1; display: flex; gap: 20px; list-style: none; }
.nav-right { justify-content: flex-start; }
.nav-section a.active { border-bottom: 2px solid var(--text-main); padding-bottom: 4px; }

.logo {
    flex: 1; text-align: center; font-family: monospace;
    font-size: 1.5rem; font-weight: bold; letter-spacing: 2px; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap;
}
.logo-img { width: 38px; height: 38px; border-radius: 50%; object-fit: contain; }
.nav-actions { flex: 1; display: flex; justify-content: flex-end; gap: 16px; }
.btn-outline {
    padding: 7px 18px; border: 1px solid var(--text-main); font-weight: 600;
    background: transparent; color: var(--text-main); font-family: inherit; cursor: pointer;
    transition: 0.3s;
}
.btn-outline:hover { background: var(--text-main); color: #000; }

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; order: -1; }
.hamburger span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; transition: 0.3s; }
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 999; }

/* --- عنوان صفحه --- */
.page-hero { padding: 60px 0 30px; text-align: center; }
.page-hero h1 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.page-hero p { font-size: 1.05rem; color: var(--text-muted); }

/* --- دکمه‌های فیلتر --- */
.filter-buttons {
    display: flex; justify-content: center; gap: 12px;
    margin-bottom: 40px; flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 22px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.filter-btn:hover { border-color: var(--text-main); color: var(--text-main); }
.filter-btn.active {
    background: var(--text-main);
    color: #000;
    border-color: var(--text-main);
}

/* --- گرید دوره‌ها --- */
.courses-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
}

/* --- کارت دوره (اندازه ثابت) --- */
.course-card {
    width: 300px;                    /* عرض ثابت */
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;                 /* از کوچک شدن جلوگیری می‌کند */
}
.course-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-main);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.05);
}

.course-card-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #111;
}
.course-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.course-card:hover .course-card-img img { transform: scale(1.05); }

.course-card-body {
    padding: 20px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.course-type {
    display: inline-block;
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    width: fit-content;
}
.course-type--video {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: #ff3366;
}
.course-type--text {
    background: rgba(180, 77, 255, 0.1);
    border: 1px solid rgba(180, 77, 255, 0.3);
    color: #b44dff;
}

.course-card-body h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.course-card-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
    margin-bottom: 12px;
}

.course-meta {
    margin-top: auto;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- فوتر --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 50px 0;
    text-align: center;
}
.social-links {
    display: flex; justify-content: center; gap: 30px;
    margin-bottom: 20px; list-style: none; flex-wrap: wrap;
}
.social-links a { font-family: monospace; letter-spacing: 1px; text-transform: uppercase; }
.copyright { color: var(--text-muted); font-size: 0.85rem; font-family: monospace; }

/* ========== ریسپانسیو ========== */
@media (max-width: 768px) {
    .nav-right, .nav-actions { display: none; }
    .logo { position: static; text-align: center; flex: 1; }
    .hamburger { display: block; }
    .nav-wrapper { height: auto; padding: 15px 0; gap: 15px; flex-wrap: wrap; justify-content: center; }

    .mobile-open .nav-right {
        display: flex; flex-direction: column; position: fixed;
        top: 0; right: 0; width: 260px; height: 100vh;
        background: #000; border-left: 1px solid var(--border-color);
        padding: 80px 24px; gap: 20px; z-index: 1001;
    }
    .mobile-open .mobile-overlay { display: block; }

    .page-hero h1 { font-size: 1.7rem; }
    .course-card { width: 100%; max-width: 350px; }
}