/* ========== فونت‌های لوکال ========== */
@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;
    --red: #ff3366;
    --purple: #b44dff;
}

* { 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; }

/* پس‌زمینه نقطه‌ای با رنگ قرمز */
.labs-grid-bg {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background-image: radial-gradient(circle, rgba(255, 51, 102, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
}

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

.nav-wrapper {
    display: flex; align-items: center; justify-content: space-between;
    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(--red); 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 40px;
    text-align: center;
    position: relative;
    z-index: 1;
}
.page-hero h1 {
    font-size: 2rem; font-weight: 900; margin-bottom: 10px;
    text-shadow: 0 0 12px rgba(255, 51, 102, 0.4);
}
.page-hero p { font-size: 1.05rem; color: var(--text-muted); }

/* --- گرید --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

/* --- کارت ترمینال --- */
.lab-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.lab-card:hover {
    transform: translateY(-5px);
    border-color: var(--red);
    box-shadow: 0 5px 20px rgba(255, 51, 102, 0.15);
}

/* هدر ترمینال */
.lab-card-header {
    background: #111;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    direction: ltr;
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span {
    width: 10px; height: 10px; border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }
.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: #888;
    margin-left: 6px;
}

/* تصویر */
.lab-card-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #111;
}
.lab-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.lab-card:hover .lab-card-img img { transform: scale(1.05); }

/* بدنه */
.lab-card-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.lab-card-body h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-weight: 600;
}

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

/* تگ‌ها */
.lab-card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.lab-card-tags span {
    font-size: 0.7rem;
    padding: 2px 10px;
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: var(--red);
    font-family: 'JetBrains Mono', monospace;
}

/* نوار سختی */
.difficulty-bar {
    display: flex;
    gap: 4px;
    margin-top: auto;
}
.difficulty-bar .bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    transition: background 0.2s;
}
.lab-card[data-difficulty="1"] .bar:nth-child(1) { background: #00cc66; }
.lab-card[data-difficulty="2"] .bar:nth-child(1),
.lab-card[data-difficulty="2"] .bar:nth-child(2) { background: #ffaa00; }
.lab-card[data-difficulty="3"] .bar:nth-child(1),
.lab-card[data-difficulty="3"] .bar:nth-child(2),
.lab-card[data-difficulty="3"] .bar:nth-child(3) { background: #ff3366; }

/* --- فوتر --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 50px 0;
    text-align: center;
    position: relative;
    z-index: 1;
}
.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; }
    .grid-container { grid-template-columns: 1fr; gap: 18px; }
}