/* =========================================
   1. Fonts & Variables (UI/UX Pro Max)
   ========================================= */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.0.0/Vazirmatn-font-face.css');

:root {
    /* Colors (Corporate Blue Theme) */
    --primary-blue: #0f172a;
    --accent-blue: #0284c7;
    --light-blue: #e0f2fe;
    --accent-cyan: #06b6d4;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #475569;
    --white: #ffffff;

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 50px;

    /* Shadows */
    --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 25px 50px rgba(2, 132, 199, 0.1);
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    /* overflow-x از بادی حذف شد تا باگ‌های تاچ موبایل رفع شود. به جای آن از کلاس wrapper استفاده کنید یا کانتینرها را کنترل کنید */
    background-color: var(--white);
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl; /* تنظیم اصولی برای پروژه فارسی */
}

/* کانتینر اصلی برای جلوگیری از اسکرول افقی ناشی از آبجکت‌های ابسترکت */
.main-wrapper {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px; /* افزایش جزئی برای حاشیه امن موبایل */
}

/* اصلاح پدینگ سراسری سکشن‌ها */
section {
    width: 100%;
    display: block;
    padding: 100px 0; /* کاهش از 160 به 100 برای جلوگیری از له شدن محتوا در لپ‌تاپ */
    position: relative;
    background: transparent !important;
    z-index: 1;
}

.section-title {
    margin-bottom: 64px; /* بهینه‌سازی وایت‌اسپیس */
}

/* =========================================
   3. Abstract Modern Objects
   ========================================= */
.abstract-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.35;
    animation: pulse-slow 10s infinite alternate;
    pointer-events: none; /* جلوگیری از اختلال در کلیک کاربر روی المان‌های زیرین */
}

.shape-dark-blue {
    width: clamp(250px, 30vw, 450px); /* عرض داینامیک برای جلوگیری از اورفلو در موبایل */
    aspect-ratio: 1;
    background: var(--primary-blue);
    top: -5%;
    right: -10%;
}

.shape-light-blue {
    width: clamp(200px, 25vw, 350px);
    aspect-ratio: 1;
    background: var(--accent-blue);
    bottom: 5%;
    left: -10%;
}

@keyframes pulse-slow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.1) translate(20px, -20px); }
}

/* =========================================
   4. Animations
   ========================================= */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

/* =========================================
   5. Header & Navigation
   ========================================= */
/* حالت پیش‌فرض (اسکرول صفر): کاملاً شفاف و یکپارچه با هیرو */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: transparent; /* کاملاً شفاف */
    backdrop-filter: none; /* بدون بلر در حالت صفر */
    -webkit-backdrop-filter: none;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid transparent; /* بدون خط مرزی */
}

/* حالت اسکرول شده: افکت شیشه‌ای (Glassmorphism) حرفه‌ای */
header.scrolled {
    background: rgba(255, 255, 255, 0.65); /* رنگ سفید نیمه‌شفاف */
    backdrop-filter: blur(20px) saturate(180%); /* بلر و اشباع رنگ برای شفافیت بهتر */
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08); /* سایه بسیار نرم */
    border-bottom: 1px solid rgba(255, 255, 255, 0.4); /* خط مرزی شیشه‌ای */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px; /* در حالت شفاف کمی بزرگتر برای حس راحتی بیشتر */
    transition: height 0.4s ease;
}

header.scrolled .nav-container {
    height: 70px; /* جمع شدن هدر هنگام اسکرول */
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-blue);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--accent-blue); }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.search-icon {
    color: var(--text-dark);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}
.search-icon:hover { color: var(--accent-blue); }

.login-btn {
    background: var(--primary-blue);
    color: var(--white);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

/* =========================================
   6. Hero Section (100vh Fixes)
   ========================================= */
.hero-modern {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center; /* قرارگیری در مرکز عمودی */
    background: transparent !important;
    overflow: hidden;
    padding-top: 180px; /* فاصله دوبرابر از هدر */
    padding-bottom: 60px;
    box-sizing: border-box;
}

/* گرید دو ستونه - در حالت RTL آیتم اول راست و دوم چپ می‌افتد */
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 4rem; /* افزایش فاصله برای تنفس بیشتر (Whitespace) */
    align-items: center;
    width: 100%;
    direction: rtl; /* اطمینان از ساختار راست‌چین */
}

/* محتوای متنی - راست‌چین */
.hero-text-content {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-text-content h1 {
    font-size: clamp(2.2rem, 4.5vw, 3.8rem); /* تایپوگرافی مدرن‌تر و بزرگ‌تر */
    color: var(--primary-blue, #0f172a);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    font-weight: 900;
    letter-spacing: -1px;
}

.hero-text-content p {
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    color: var(--text-muted, #64748b);
    margin-bottom: 3rem;
    max-width: 95%;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
}

/* دکمه‌های مدرن */
.btn-primary, .btn-secondary {
    padding: 0.9rem 2.2rem;
    border-radius: var(--radius-pill, 50px);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* انیمیشن نرم‌تر */
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: var(--primary-blue, #0284c7);
    color: #fff;
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(2, 132, 199, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-blue, #0f172a);
    border: 2px solid rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(10px); /* افکت گلس برای دکمه دوم */
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.05);
    transform: translateY(-4px);
    border-color: rgba(15, 23, 42, 0.2);
}

/* تصویر - چپ‌چین */
.hero-illustration-wrapper {
    position: relative;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
    display: flex;
    justify-content: flex-end; /* در ساختار RTL این باعث هل دادن به سمت چپ می‌شود */
    align-items: center;
}

.hero-illustration-wrapper img {
    width: 100%;
    max-width: 600px; /* کمی بزرگ‌تر برای تناسب با ارتفاع کامل */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 25px 40px rgba(6, 182, 212, 0.2));
}

/* انیمیشن شناور */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 991px) {
    .hero-modern {
        padding-top: 140px;
        min-height: auto; /* در موبایل بهتر است ارتفاع داینامیک باشد */
    }
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-text-content {
        text-align: center;
        align-items: center;
    }
    .hero-illustration-wrapper {
        justify-content: center;
        margin-top: 2rem;
    }
}


/* =========================================
   7. What We Do Section (100vh Fixes)
   ========================================= */
.wwd-section {
    position: relative;
    min-height: min(100vh, 900px); /* جلوگیری از کشیدگی بیش از حد در مانیتورهای بزرگ */
    display: flex;
    align-items: center;
    padding: 80px 0;
}

.wwd-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 4rem;
    align-items: center;
}

.wwd-image-box {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.wwd-image-box img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wwd-image-box:hover img {
    transform: scale(1.05);
}

.wwd-floating-card {
    position: absolute;
    bottom: -20px;
    right: -20px; /* در پروژه فارسی RTL بهتر است left: -20px باشد، اما طبق کد شما گذاشتم */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: float 5s ease-in-out infinite reverse;
    z-index: 10;
}

.wwd-floating-card i {
    font-size: 2rem;
    color: var(--accent-cyan);
}

.wwd-floating-card div h4 {
    font-size: 1rem;
    color: var(--primary-blue);
    margin: 0 0 4px 0;
}
.wwd-floating-card div p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.wwd-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.badge {
    background: var(--light-blue);
    color: var(--accent-blue);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.badge:hover {
    background: var(--accent-blue);
    color: var(--white);
}

/* =========================================
   8. Services (Asymmetric Grid)
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 30px; /* کمی کاهش گپ برای تعادل بهتر */
}

.service-card {
    border-radius: var(--radius-xl);
    padding: 40px; /* کاهش پدینگ برای جلوگیری از فشردگی */
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #f8fafc;
    border: 1px solid rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
}

.service-card.primary-card:hover {
    transform: translateY(-10px); /* حذف scale برای جلوگیری از پرش‌های زشت گرید */
}

.service-card.item-1 {
    grid-column: span 8;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-blue));
    color: white;
    animation: float-soft 8s ease-in-out infinite;
}
.service-card.item-1 * { color: white; }

.service-card.item-2 {
    grid-column: span 4;
    background: #eef2ff;
    animation: float-soft 7s ease-in-out infinite 1s;
}

.service-card.item-3 {
    grid-column: span 5;
    background: #f0fdfa;
    animation: float-soft 9s ease-in-out infinite 0.5s;
}

.service-card.item-4 {
    grid-column: span 7;
    background: #fffbeb;
    animation: float-soft 8.5s ease-in-out infinite 1.5s;
}

@keyframes float-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* =========================================
   9. Partners Marquee
   ========================================= */
.partners-section {
    padding: 3rem 0;
    width: 100%;
    position: relative;
    /* overflow: hidden از اینجا برداشته شد تا رپر داخلی آن را مدیریت کند */
}

/* رپر اختصاصی برای هندل کردن اسکرول داخلی بدون درگیری کل صفحه */
.marquee-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    /* مخفی کردن نوار اسکرول زشت، اما حفظ قابلیت اسکرول لمسی */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* مخفی کردن اسکرول‌بار در کروم و سافاری */
.marquee-wrapper::-webkit-scrollbar {
    display: none;
}

.marquee-container {
    display: flex;
    width: max-content;
    animation: marquee 30s linear infinite;
}

/* اگر کاربر با دست اسکرول کرد یا ماوس را روی آن برد، انیمیشن متوقف شود */
.marquee-wrapper:hover .marquee-container {
    animation-play-state: paused;
}

.marquee-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 0 2rem;
}

.marquee-content img {
    height: 35px;
    width: auto;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.3s ease;
    object-fit: contain;
}

.marquee-content img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}


/* =========================================
   10. Expanded Footer
   ========================================= */
.site-footer {
    padding: 80px 0 30px;
    background-color: var(--primary-blue);
    color: #e2e8f0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.15rem;
    margin: 0 0 20px 0;
    position: relative;
    padding-bottom: 12px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    right: 0; /* چون پروژه فارسی است right صحیح است */
    bottom: 0;
    width: 35px;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer-col ul li a:hover {
    color: var(--accent-cyan);
    transform: translateX(-5px); /* انیمیشن نرم در هاور (چون فارسی است به چپ حرکت کند) */
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #64748b;
}

/* =========================================
   11. Responsive Adjustments (The Fixes)
   ========================================= */
@media (max-width: 1024px) {
    .hero-text-content h1 {
        font-size: 2.4rem;
    }
    .service-card {
        padding: 30px; /* جلوگیری از فشردگی در تبلت */
    }
}

@media (max-width: 992px) {
    /* تغییر ساختار به یک ستونه */
    .hero-grid, .wwd-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-modern, .wwd-section {
        min-height: auto; /* در تبلت/موبایل 100vh فاجعه است و باید auto باشد */
        padding: 120px 0 80px;
    }

    .hero-text-content p {
        margin: 0 auto 2rem;
    }

    .hero-buttons, .wwd-badges {
        justify-content: center;
    }

    .hero-illustration-wrapper img {
        max-width: 80%;
    }

    /* اصلاح گرید کارت‌ها برای تبلت */
    .service-card.item-1, .service-card.item-4 {
        grid-column: span 12;
    }
    .service-card.item-2, .service-card.item-3 {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }

    .nav-container {
        height: 70px;
    }
    header.scrolled .nav-container {
        height: 60px;
    }

    section { padding: 60px 0; }

    .service-card.item-2, .service-card.item-3 {
        grid-column: span 12; /* تمام کارت‌ها در موبایل یک ستونه می‌شوند */
    }

    .wwd-floating-card {
        right: 50%;
        transform: translateX(50%);
        bottom: -30px;
        width: 90%;
        justify-content: center;
        animation: none; /* خاموش کردن انیمیشن در موبایل برای پرفورمنس */
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    .service-card {
        padding: 24px;
    }
}


/* ================= Video & Features Section ================= */
.video-features-section {
    position: relative;
    padding: 100px 0;
    /* بک‌گراند تیره برای تمایز با سایر سکشن‌ها */
    background: linear-gradient(135deg, #0b1120 0%, #172554 100%) !important;
    color: #ffffff;
    overflow: hidden;
}

.video-features-section .glow-bg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    transform: translateY(-50%);
    pointer-events: none;
}

.vf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 2;
    direction: rtl;
}

/* --- محتوای متنی --- */
.vf-content h2 {
    font-size: clamp(2rem, 3vw, 2.8rem);
    margin: 15px 0;
    font-weight: 800;
}

.vf-content > p {
    color: #cbd5e1; /* رنگ خاکستری روشن برای خوانایی */
    margin-bottom: 40px;
    line-height: 1.8;
}

.badge-light {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #60a5fa;
}

/* --- لیست ویژگی‌ها --- */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(-5px); /* حرکت ریز به سمت چپ در هاور (چون راست‌چینه) */
    border-color: rgba(96, 165, 250, 0.4);
}

.feature-icon {
    font-size: 1.8rem;
    background: rgba(59, 130, 246, 0.2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.feature-text h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #f8fafc;
}

.feature-text p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- قاب ویدیو شیشه‌ای --- */
.glass-video-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.local-video {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    object-fit: cover;
    pointer-events: none; /* جلوگیری از کلیک روی ویدیو */
}

/* --- ریسپانسیو --- */
@media (max-width: 992px) {
    .vf-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .vf-video-wrapper {
        order: -1; /* در موبایل ویدیو بره بالای متن */
    }

    .feature-item:hover {
        transform: none;
    }
}

