/* ======================= ریست و پایه ======================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ========== اسکرول‌بار سفارشی (همه مرورگرها) ========== */
html {
    direction: rtl;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #5E3EEB #F4F1FF;
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100vw !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #F4F1FF;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5E3EEB, #8B5CF6);
    border-radius: 10px;
    border: 2px solid #F4F1FF;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4a2cc4, #7C3AED);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #fff;
    color: #1A1A1A;
    line-height: 1.6;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    direction: rtl;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

:root {
    --primary: #5E3EEB;
    --primary-dark: #4A2CC4;
    --primary-light: #F4F1FF;
    --text-dark: #1A1A1A;
    --text-gray: #6B7280;
    --border-light: #E5E7EB;
    --white: #ffffff;
    --bg-light: #F9FAFB;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

/* ======================= لودینگ اسکرین هوش مصنوعی (نسخه حرفه‌ای) ======================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}
#preloader.fade-out { opacity: 0; visibility: hidden; }

.ai-loader-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* هسته مرکزی - با درخشش پس‌زمینه */
.ai-core-center {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 0 50px rgba(94, 62, 235, 0.25);
    animation: corePulse 1.8s ease-in-out infinite;
}
.core-glow-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(94, 62, 235, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}
.ai-core-logo {
    width: 85px;
    height: auto;
    display: block;
    border-radius: 4px; /* جلوگیری از تیزی گوشه‌های لوگو */
}
.ai-core-icon {
    font-size: 60px;
    color: var(--primary);
}

/* حلقه‌های گردان - با سرعت بالاتر و درخشش بیشتر */
.ai-orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 3px dashed transparent;
}
.ring-1 { 
    width: 100%; height: 100%; 
    border-top: 4px solid var(--primary);
    border-right: 2px solid rgba(94, 62, 235, 0.3);
    border-left: 2px solid rgba(94, 62, 235, 0.3);
    box-shadow: 0 0 25px rgba(94, 62, 235, 0.3);
    animation: orbitRotate 3s cubic-bezier(0.4, 0, 0.2, 1) infinite; 
}
.ring-2 { 
    width: 75%; height: 75%; 
    border-bottom: 4px solid rgba(94, 62, 235, 0.8);
    border-left: 4px solid rgba(94, 62, 235, 0.4);
    box-shadow: 0 0 25px rgba(94, 62, 235, 0.2);
    animation: orbitRotate 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite reverse; 
}

/* ذرات نورانی - با مسیر حرکت نرم‌تر */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 15px var(--primary), 0 0 25px var(--primary);
    animation: floatParticle 4s ease-in-out infinite;
}
.p-1 { top: 15%; left: 15%; animation-delay: 0s; }
.p-2 { top: 60%; right: 10%; animation-delay: 1.2s; }
.p-3 { bottom: 15%; left: 45%; animation-delay: 2.4s; }

.ai-loader-text {
    position: absolute;
    bottom: -55px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-gray);
    letter-spacing: 3px;
    animation: textFade 2s ease-in-out infinite;
}

@keyframes orbitRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes corePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 50px rgba(94, 62, 235, 0.2); }
    50% { transform: scale(1.04); box-shadow: 0 0 80px rgba(94, 62, 235, 0.4); }
}
@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.8; }
    50% { transform: translate(20px, -30px) scale(1.3); opacity: 1; }
}
@keyframes textFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ======================= Pre-header ======================= */
.pre-header {
    background: #0F172A;
    color: #CBD5E1;
    font-size: 13px;
    padding: 8px 0;
}
.pre-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pre-header-left,
.pre-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.pre-header-link {
    color: #CBD5E1;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    padding: 4px 0;
    position: relative;
}
.pre-header-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width 0.3s ease;
}
.pre-header-link:hover {
    color: var(--white);
    transform: translateY(-1px);
}
.pre-header-link:hover::after { width: 100%; }
.social-icons-mini {
    display: flex;
    gap: 12px;
    font-size: 15px;
}
.social-icons-mini a { color: #CBD5E1; transition: color var(--transition); }
.social-icons-mini a:hover { color: var(--primary); }

/* ======================= هدر اصلی ======================= */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid rgba(94,62,235,0.08);
    box-shadow: 0 4px 30px rgba(94,62,235,0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* لوگو (فقط تصویر اگر موجود باشد) */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; transition: transform 0.3s ease; }
.logo:hover { transform: scale(1.02); }
.logo-img { height: 70px; width: auto; display: block; filter: drop-shadow(0 2px 8px rgba(94,62,235,0.15)); }
.logo-icon { color: var(--primary); font-size: 34px; }
.logo-text { font-size: 26px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.5px; }

/* منوی اصلی (سمت راست) */
.main-nav { margin-left: auto; margin-right: 40px; }
@media (max-width: 1024px) {
    .main-nav { margin-left: 0; margin-right: 0; }
} /* در rtl این باعث می‌شه منو بره سمت راست */
.nav-list { display: flex; align-items: center; gap: 5px; }
.nav-link {
    color: var(--text-gray);
    font-weight: 500;
    font-size: 15px;
    padding: 10px 18px;
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light), rgba(94,62,235,0.1));
    border-radius: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-link:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(94,62,235,0.1);
}
.nav-link:hover::before { opacity: 1; }

/* مگا منو */
.dropdown { position: relative; }
.dropdown-toggle i { font-size: 12px; transition: transform 0.3s ease; }
.dropdown:hover .dropdown-toggle i { transform: rotate(180deg); }

.mega-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 50%;
    transform: translateX(50%) translateY(10px);
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    padding: 30px;
    width: max-content;
    max-width: 800px; /* عرض مناسب برای جلوگیری از شلوغی */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    min-width: 300px;
}
.dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(50%) translateY(0);
}
.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px 40px;
}
.mega-menu-col h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
    white-space: nowrap;
}
.mega-menu-col h4 i { 
    color: var(--primary); 
    width: 24px; 
    text-align: center; 
    font-size: 18px;
}

/* === تغییر اصلی اینجاست: لیست‌ها به صورت شبکه‌ای دو ستونی === */
.mega-menu-col ul {
    display: grid;
    grid-template-columns: 1fr 1fr; /* دو ستون مساوی */
    gap: 6px 15px; /* فاصله مرتب بین آیتم‌ها */
    list-style: none;
    margin: 0;
    padding: 0;
}
.mega-menu-col ul li {
    margin: 0;
}
.mega-menu-col ul li a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.2s ease;
    line-height: 1.6;
    /* کلید اصلی برای جلوگیری از به‌هم‌ریختگی کلمات بلند در شبکه: */
    word-break: break-word; 
    /* حتماً nowrap رو حذف کردیم تا کلمات بلند بشکنن */
}
.mega-menu-col ul li a:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(-5px); /* حرکت زیبا به سمت چپ در هاور */
    padding-right: 15px;
}

/* دکمه‌ها */
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn {
    padding: 11px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border-color: var(--border-light);
    backdrop-filter: blur(5px);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(94,62,235,0.12);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    box-shadow: 0 4px 15px rgba(94,62,235,0.25);
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(94,62,235,0.4);
}
.btn-primary:hover::before { left: 100%; }

/* همبرگر */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ======================= فوتر ======================= */
.site-footer {
    background: #0F172A;
    color: #CBD5E1;
    padding: 60px 0 0 0;
    margin-top: 60px;
    font-size: 14px;
}
.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #1E293B;
}
.footer-logo { display: inline-block; margin-bottom: 15px; }
.footer-brand-text {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #A78BFA, #C4B5FD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}
.footer-links li a i {
    width: 18px;
    text-align: center;
    margin-left: 6px;
    font-size: 11px;
    color: #A78BFA;
    opacity: 0.8;
}
.footer-links li a:hover i {
    opacity: 1;
}
.footer-desc {
    color: #94A3B8;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 13px;
    max-width: 320px;
}
.footer-social {
    display: flex;
    gap: 15px;
    font-size: 18px;
}
.footer-social a {
    color: #94A3B8;
    transition: all 0.3s ease;
}
.footer-social a:hover { 
    color: var(--primary); 
    transform: translateY(-3px); /* هاور آیکون‌های اجتماعی با حرکت بالا */
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 10px;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
}

.footer-links li { margin-bottom: 10px; }
.footer-links li a {
    color: #94A3B8;
    transition: all 0.2s ease;
    display: inline-block;
}
.footer-links li a:hover { 
    color: #fff; 
    transform: translateX(-5px); /* حرکت به چپ در هاور */
}

.footer-contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #94A3B8;
}
.footer-contact-list li i { color: var(--primary); width: 20px; text-align: center; font-size: 16px;}
.footer-contact-list li a { color: #94A3B8; transition: all 0.2s ease; display: inline-block; }
.footer-contact-list li a:hover { color: #fff; transform: translateX(-5px); }

.footer-trust {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.trust-badge {
    background: #1E293B;
    color: #CBD5E1;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.trust-badge i { color: var(--primary); }
.trust-badge:hover { border-color: var(--primary); background: #1E293B; }

.footer-bottom {
    padding: 20px 0;
}
.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-copy { color: #64748B; font-size: 13px; }
.footer-legal a {
    color: #64748B;
    font-size: 13px;
    transition: color 0.2s;
}
.footer-legal a:hover { color: #fff; }
.divider { color: #334155; margin: 0 8px; }

/* ===== رسپانسیو فوتر ===== */
@media (max-width: 1024px) {
    .footer-content { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}
@media (max-width: 768px) {
    .footer-content { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .footer-desc { max-width: 100%; font-size: 12px; }
    .footer-col { min-width: 0; }
    .footer-title { font-size: 14px; }
    .footer-links li a { font-size: 12px; }
    .footer-contact-list li { font-size: 12px; }
}
@media (max-width: 480px) {
    .footer-content { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px 16px; 
        font-size: 13px;
    }
    .footer-brand { grid-column: 1 / -1; text-align: center; }
    .footer-desc { max-width: 100%; margin: 0 auto 16px auto; }
    .footer-social { justify-content: center; }
    .footer-title { font-size: 13px; margin-bottom: 14px; padding-bottom: 8px; }
    .footer-title::after { right: 0; width: 24px; height: 2px; }
    .footer-links li { margin-bottom: 5px; }
    .footer-links li a { font-size: 11px; }
    .footer-links li a i { font-size: 10px; width: 14px; margin-left: 4px; }
    .footer-contact-list li { font-size: 11px; margin-bottom: 8px; }
    .footer-contact-list li i { font-size: 13px; width: 16px; }
    .trust-badge { font-size: 10px; padding: 4px 10px; }
    .footer-bottom-content { flex-direction: column; text-align: center; gap: 8px; }
    .footer-copy, .footer-legal a { font-size: 11px; }
    .footer-brand-text { font-size: 28px; }
}

/* ===== رسپانسیو کلی ===== */
@media (max-width: 1024px) {
    .pre-header { display: none; }
    .hamburger { display: flex; }
    
    .main-nav {
        display: block;
        position: fixed;
        top: 72px;
        right: 0;
        width: 300px;
        max-width: 85vw;
        height: calc(100vh - 72px);
        background: #fff;
        box-shadow: -10px 0 40px rgba(0,0,0,0.15);
        padding: 16px 12px 100px 12px;
        overflow-y: auto;
        z-index: 999;
        margin: 0 !important;
        display: none;
        transform: translateX(0);
        transition: none;
    }
    .main-nav.open {
        display: block;
        transform: translateX(0);
    }
    
    .main-nav .nav-list {
        flex-direction: column;
        gap: 2px;
    }
    
    .main-nav .nav-link {
        padding: 13px 14px;
        border-radius: 10px;
        justify-content: flex-start;
        font-size: 14px;
        font-weight: 600;
    }
    .main-nav .nav-link i:first-child {
        width: 22px;
        text-align: center;
        margin-left: 4px;
    }
    
    .main-nav .dropdown-toggle {
        justify-content: space-between;
    }
    .main-nav .dropdown-toggle i.fa-chevron-down {
        font-size: 10px;
        transition: transform 0.3s;
    }
    .main-nav .dropdown.open > .dropdown-toggle i.fa-chevron-down {
        transform: rotate(180deg);
    }
    
    .main-nav .mega-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding: 0;
        max-width: 100%;
        background: #F8FAFC;
        margin: 2px 8px 8px 8px;
        border-radius: 12px;
        display: none;
        opacity: 0;
        transform: translateY(-4px);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }
    .main-nav .dropdown.open .mega-menu {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }
    
    .main-nav .mega-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 0;
        padding: 12px 8px;
    }
    
    .main-nav .mega-menu-col {
        margin-bottom: 4px;
    }
    .main-nav .mega-menu-col h4 {
        font-size: 11px;
        padding: 8px 12px 6px;
        margin-bottom: 0;
        border-bottom: 1px solid #E5E7EB;
        white-space: normal;
    }
    .main-nav .mega-menu-col ul {
        grid-template-columns: 1fr;
        gap: 1px;
        padding: 4px 0;
    }
    .main-nav .mega-menu-col ul li a {
        font-size: 12px;
        padding: 8px 14px;
        border-radius: 6px;
        word-break: normal;
    }
    
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    .nav-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}
@media (max-width: 768px) {
    .header-container { height: 62px; }
    .logo-img { height: 45px; }
    .header-actions .btn-outline { display: none; }
    .main-nav { top: 62px; height: calc(100vh - 62px); }
}
@media (max-width: 480px) {
    .header-actions .btn-primary { padding: 8px 16px; font-size: 13px; }
    .main-nav { width: 300px; max-width: 100%; }
}
/* جلوگیری از آفست صفحه توسط ویجت چت */
.tikha-chat-widget,
.tikha-chat-trigger,
.tikha-chat-container {
    right: 20px !important;
    left: auto !important;
}

@media (max-width: 480px) {
    .tikha-chat-trigger {
        bottom: 18px !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
    }
    
    .tikha-chat-container {
        right: 12px !important;
        left: auto !important;
        width: calc(100vw - 24px) !important;
        max-width: 400px !important;
        bottom: 80px !important;
    }
}

/* مهم: وقتی چت باز است، body جابه‌جا نشود */
body.tikha-chat-open {
    overflow: hidden !important;
    padding-right: 0 !important; /* این خط خیلی مهم است */
}
