/* ==========================================================================
   Header & Core Navigation Styles
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 14, 24, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
    width: min(1200px, calc(100% - 40px));
    margin-inline: auto;
}

.header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ==========================================================================
   Animated SVG Logo (Stroke Draw & Soft Infinite Glow)
   ========================================================================== */
.brand-logo--svg {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    direction: ltr !important; /* جلوگیری از تغییر جهت در RTL */
}

.godo-logo-svg {
    display: block;
    overflow: visible;
}

.logo-svg-text-stroke {
    font-family: 'Montserrat', 'Inter', -apple-system, sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.05em;
}

/* رنگ پس‌زمینه برای خوانایی دور حروف */
.logo-svg-text-stroke-bg {
    fill: none;
    stroke: rgba(10, 14, 24, 0.9);
    stroke-width: 4px;
}

/* انیمیشن رسم خط دور نوشته */
.logo-svg-text-stroke-anim {
    fill: none;
    stroke: url(#logoGrad);
    stroke-width: 1.5px;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: strokeDraw 2.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* پر شدن متن پس از اتمام ترسیم خط دور */
.logo-svg-text-fill {
    font-family: 'Montserrat', 'Inter', -apple-system, sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.05em;
    fill: #ffffff;
    opacity: 0;
    animation: fillFadeIn 1.2s ease-out 1.6s forwards, glowCycle 4s ease-in-out 3s infinite alternate;
}

@keyframes strokeDraw {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes fillFadeIn {
    to {
        opacity: 1;
    }
}

/* پالس و درخشش نئونی نرم روی لوگو */
@keyframes glowCycle {
    0% {
        filter: drop-shadow(0 0 1px rgba(124, 92, 255, 0));
        fill: #ffffff;
    }
    100% {
        filter: drop-shadow(0 0 6px rgba(124, 92, 255, 0.8)) drop-shadow(0 0 12px rgba(0, 242, 254, 0.4));
        fill: #f5f3ff;
    }
}

/* ==========================================================================
   Desktop Navigation & Sliding Underline Hover Effect
   ========================================================================== */
.desktop-nav {
    display: flex;
    align-items: center;
    margin-inline-start: auto;
}

.desktop-nav__list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-nav__list li {
    position: relative;
}

.desktop-nav__list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    position: relative;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 600;
    font-size: 0.96rem;
    transition: color 0.3s ease;
}

/* ساخت خط زیرین تعاملی بدون تکیه بر جاوااسکریپت */
.desktop-nav__list a::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: linear-gradient(90deg, #7c5cff, #00f2fe);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.desktop-nav__list a:hover {
    color: #ffffff;
}

.desktop-nav__list a:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
}

.desktop-nav__list a.is-active {
    color: #ffffff;
}

.desktop-nav__list a.is-active::after {
    transform: scaleX(1);
    background: #7c5cff;
}

/* ==========================================================================
   Header Actions & CTA Button with Icon
   ========================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 44px;
    border-radius: 12px;
    text-decoration: none;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.lang-switch-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lang-code {
    font-size: 0.88rem;
    font-weight: 800;
}

/* CTA دکمه اوردر سرویس مدرن با آیکون */
.btn-cta-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.94rem;
    background: linear-gradient(135deg, #7c5cff 0%, #00f2fe 100%);
    box-shadow: 0 8px 20px rgba(124, 92, 255, 0.22);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.btn-cta-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00f2fe 0%, #7c5cff 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.btn-cta-header > * {
    position: relative;
    z-index: 2;
}

.cta-btn-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-cta-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(124, 92, 255, 0.35);
}

.btn-cta-header:hover::before {
    opacity: 1;
}

.btn-cta-header:hover .cta-btn-icon {
    transform: rotate(90deg) scale(1.15);
}

/* ==========================================================================
   Mobile Toggle Button
   ========================================================================== */
.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ==========================================================================
   Elastic / Soft Spring Mobile Menu Overlay & Panel
   ========================================================================== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(4, 6, 12, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                visibility 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(85vw, 360px);
    height: 100%;
    background: #070b13;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.45);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    
    /* افکت الاستیک (کشویی نرم) */
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
}

html[dir="rtl"] .mobile-menu-panel {
    right: auto;
    left: 0;
    border-left: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(-100%);
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* لیست ناوبری موبایل */
.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav li {
    margin-bottom: 12px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* انیمیشن پلکانی ورود لینک‌های منو موبایل هنگام باز شدن */
.mobile-menu-overlay.is-open .mobile-nav li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-overlay.is-open .mobile-nav li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-overlay.is-open .mobile-nav li:nth-child(2) { transition-delay: 0.16s; }
.mobile-menu-overlay.is-open .mobile-nav li:nth-child(3) { transition-delay: 0.22s; }
.mobile-menu-overlay.is-open .mobile-nav li:nth-child(4) { transition-delay: 0.28s; }
.mobile-menu-overlay.is-open .mobile-nav li:nth-child(5) { transition-delay: 0.34s; }
.mobile-menu-overlay.is-open .mobile-nav li:nth-child(6) { transition-delay: 0.4s; }

.mobile-nav-link {
    display: flex;
    align-items: center;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.25s ease;
}

.mobile-nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.mobile-nav-link--cta {
    background: linear-gradient(135deg, #7c5cff 0%, #00f2fe 100%);
    color: #ffffff;
    border: 0;
}

.lang-switch-mobile {
    border-color: rgba(124, 92, 255, 0.25);
    color: #7c5cff;
}

/* آیکون‌های اجتماعی پایین منوی موبایل */
.mobile-menu-socials {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.25s ease;
}

.mobile-menu-socials a:hover {
    color: #ffffff;
    background: rgba(124, 92, 255, 0.15);
    transform: translateY(-2px);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
    .desktop-nav,
    .btn-cta-header,
    .lang-switch-btn {
        display: none;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .header-inner {
        min-height: 76px;
    }
}

@media (max-width: 640px) {
    .header-container {
        width: min(100% - 24px, 1200px);
    }

    .header-inner {
        gap: 12px;
        min-height: 72px;
    }
}
