/* =========================================
   1. تنظیمات پایه و فونت (Local First)
   ========================================= */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #2563eb;       /* آبی اصلی */
    --primary-hover: #1d4ed8;
    --bg-body: #f1f5f9;       /* پس‌زمینه کلی */
    --bg-card: #ffffff;       /* پس‌زمینه کارت */
    --text-main: #0f172a;     /* رنگ متن اصلی */
    --text-muted: #64748b;    /* رنگ متن فرعی */
    --star-color: #f59e0b;    /* رنگ ستاره امتیاز */
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* =========================================
   2. لی‌اوت و کانتینر
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   3. هدر و ناوبری
   ========================================= */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover { background: var(--primary-hover); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

/* =========================================
   4. سیستم گرید و کارت‌ها (نسخه بهبودیافته)
   ========================================= */
.page-title {
    margin: 40px 0 20px;
    font-size: 1.8rem;
    font-weight: 700;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}

/* ریسپانسیو برای تبلت و موبایل */
@media (max-width: 1024px) {
    .grid-container { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .grid-container { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .nav-links { display: none; }
}
@media (max-width: 480px) {
    .grid-container { grid-template-columns: 1fr; }
}

/* ✅ استایل کارت بهبودیافته */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

/* ✅ کانتینر عکس با نسبت بهتر */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 180px; /* ارتفاع مناسب در دسکتاپ */
    overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

/* کاهش ارتفاع در تبلت */
@media (max-width: 768px) {
    .card-image-wrapper {
        height: 140px; /* ارتفاع کمتر در تبلت */
    }
}

/* کاهش بیشتر در موبایل */
@media (max-width: 480px) {
    .card-image-wrapper {
        height: 160px; /* ارتفاع متعادل در موبایل */
    }
}

/* ✅ استایل عکس با افکت zoom */
.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-image {
    transform: scale(1.05); /* افکت zoom ملایم هنگام hover */
}

/* ✅ Gradient overlay در پایین عکس برای زیبایی بیشتر */
.card-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    pointer-events: none;
}

/* نشانگر امتیاز (بالا سمت چپ) */
.rating-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 2;
}

.rating-badge svg {
    width: 14px;
    height: 14px;
    fill: var(--star-color);
}

/* ✅ بدنه کارت با padding بهتر */
.card-body {
    padding: 15px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* =========================================
   5. مودال (پنجره پاپ‌آپ جزئیات)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* پیش‌فرض مخفی */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    border-radius: var(--border-radius);
    padding: 25px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 15px;
    left: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* =========================================
   6. فوتر
   ========================================= */
.site-footer {
    background: var(--text-main);
    color: #cbd5e1;
    text-align: center;
    padding: 30px 0;
    margin-top: 50px;
    font-size: 0.9rem;
}
/* =========================================
7. منوی همبرگری و ریسپانسیو موبایل
========================================= */
.hamburger-menu {
    display: none; /* در دسکتاپ مخفی است */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* انیمیشن تبدیل همبرگر به ضربدر (X) هنگام باز شدن منو */
.hamburger-menu.active span:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* استایل‌های موبایل (زیر 768 پیکسل) */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex; /* نمایش دکمه همبرگر در موبایل */
    }

    #mainNav {
        position: fixed;
        top: 65px; /* ارتفاع هدر */
        right: -100%; /* در ابتدا مخفی است (به سمت بیرون) */
        width: 75%;
        height: 100vh;
        background: var(--bg-card);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 150;
        padding: 20px;
    }

    /* وقتی منو باز می‌شود */
    #mainNav.active {
        right: 0; /* منو به داخل صفحه کشیده می‌شود */
    }

    .nav-links {
        display: flex !important; /* لغو کردن display:none قبلی */
        flex-direction: column;
        gap: 0;
    }

    .nav-links li {
        border-bottom: 1px solid #e2e8f0;
    }

    .nav-links a {
        display: block;
        padding: 15px 10px;
        font-size: 1.1rem;
    }

    /* دکمه ورود در موبایل کمی کوچکتر شود */
    .auth-buttons .btn {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
}
/* =========================================
8. استایل‌های Hero Section جدید
========================================= */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
    opacity: 0.3;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem !important;
    }
    .hero-section p {
        font-size: 1rem !important;
    }
}

/* انیمیشن برای کارت‌ها */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease;
}

/* استایل دکمه‌های گرد */
.btn {
    border-radius: 12px;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}