/* ============ ENGLISH (LTR) VERSION ============ */
:root {
    --primary: #3B7EC7;
    --primary-dark: #2A5F9E;
    --primary-light: #5B9FE0;
    --accent: #4A90D9;
    --telegram: #0088cc;
    --telegram-hover: #006da3;
    --bg-soft: #f4f8fc;
    --bg-white: #ffffff;
    --text-dark: #1a1a2e;
    --text-body: #3a3a4a;
    --text-muted: #6b7280;
    --border-soft: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.06);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;   /* English font stack */
    --max-width: 1140px;
    --header-height: 72px;
}

/* Remove Persian font – no @font-face needed for English */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg-white);
    color: var(--text-body);
    line-height: 1.75;
    direction: ltr;                      /* ← LTR */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image:
        radial-gradient(ellipse at 15% 5%, rgba(59, 126, 199, 0.03) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 90%, rgba(74, 144, 217, 0.03) 0%, transparent 55%),
        radial-gradient(ellipse at 50% 40%, rgba(59, 126, 199, 0.02) 0%, transparent 60%);
    background-attachment: fixed;
}

/* ============ SKIP LINK ============ */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;                         /* ← LTR: left instead of right */
    background: var(--primary);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 12px;
}

/* ============ HEADER ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-soft);
    height: var(--header-height);
    display: flex;
    align-items: center;
    transition: box-shadow var(--transition-smooth);
}
.site-header.scrolled {
    box-shadow: var(--shadow-md);
}
.header-inner {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 1.45rem;
    color: var(--text-dark);
    letter-spacing: -0.3px;
    transition: opacity var(--transition-fast);
}
.logo:hover {
    opacity: 0.8;
}
.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(59, 126, 199, 0.3);
}
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.logo-text .brand {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
}
.logo-text .tagline {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.main-nav a {
    text-decoration: none;
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 6px 0;
    transition: color var(--transition-fast);
    white-space: nowrap;
}
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;                            /* ← LTR: underline from left */
    width: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: width var(--transition-smooth);
}
.main-nav a:hover,
.main-nav a:focus {
    color: var(--primary);
}
.main-nav a:hover::after,
.main-nav a:focus::after {
    width: 100%;
}
.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--telegram);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all var(--transition-smooth);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 3px 14px rgba(0, 136, 204, 0.28);
}
.header-cta:hover {
    background: var(--telegram-hover);
    box-shadow: 0 6px 22px rgba(0, 136, 204, 0.38);
    transform: translateY(-2px);
}
.header-cta svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
/* Active navigation link */
.main-nav a.active,
.mobile-nav-panel a.active {
    color: var(--primary) !important;
    font-weight: 600;
}

/* ── Dropdown Container ── */
.dropdown-container {
    position: relative;
    list-style: none;
}
.dropdown-trigger {
    text-decoration: none;
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 10px 15px;
    display: block;
    white-space: nowrap;
    transition: color 0.2s;
    cursor: default;   /* desktop: it’s hover */
}
.dropdown-trigger:hover {
    color: var(--primary);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;                           /* ← LTR: align to left edge */
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-soft);
    list-style: none;
    padding: 8px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.2s ease;
    z-index: 500;
}
/* Desktop: show on hover */
.dropdown-container:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown items */
.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-body);
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.dropdown-menu li a:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

/* ── Mobile behaviour ── */
@media (max-width: 768px) {
    /* Remove any default list styling from the dropdown container (if it's an <li>) */
    .mobile-nav-panel .dropdown-container {
        list-style: none !important;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        display: none;            /* hidden by default, JS toggles via .open */
        padding: 0;
        min-width: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        /* remove any inherited list‑style bullets */
        list-style: none;
    }

    .dropdown-container.open .dropdown-menu {
        display: block;
    }

    /* Trigger with animated arrow */
    .dropdown-trigger {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        cursor: pointer;
    }

    .dropdown-trigger::after {
        content: "▼";
        font-size: 0.7rem;
        margin-left: auto;              /* ← LTR: push arrow to the far right */
        transition: transform 0.25s ease;
        opacity: 0.7;
    }

    .dropdown-container.open .dropdown-trigger::after {
        transform: rotate(180deg);
    }
}

.main-nav a.active,
.mobile-nav-panel a.active {
    color: var(--primary) !important;
    font-weight: 600;
}


    /* ── Language Pill ── */
.lang-pill {
    display: inline-flex;
    align-items: center;
    background: var(--bg-soft, #f4f8fc);
    border: 1px solid var(--border-soft, #e2e8f0);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.06));
    transition: all 0.3s ease;
    flex-shrink: 0;
    user-select: none;
}
.lang-pill:hover {
    border-color: var(--primary, #3B7EC7);
    box-shadow: 0 0 12px rgba(59, 126, 199, 0.15);
}

.lang-pill .lang-active,
.lang-pill .lang-inactive {
    padding: 7px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.lang-pill .lang-active {
    background: linear-gradient(135deg, var(--primary, #3B7EC7), var(--primary-light, #5B9FE0));
    color: #fff;
    border-radius: 50px;
    margin: 2px;
    box-shadow: 0 2px 8px rgba(59, 126, 199, 0.3);
}

.lang-pill .lang-inactive {
    color: var(--text-muted, #6b7280);
    background: transparent;
    border-radius: 50px;
    margin: 2px;
}
.lang-pill .lang-inactive:hover {
    color: var(--primary, #3B7EC7);
    background: rgba(59, 126, 199, 0.06);
}

/* ── Mobile version (slightly larger, for touch) ── */
.lang-pill-mobile .lang-active,
.lang-pill-mobile .lang-inactive {
    padding: 10px 20px;
    font-size: 0.95rem;
    margin:auto;
}

/* ── Responsive visibility ── */
.lang-pill-mobile {
    display: none;               /* hidden by default */
    margin: 12px auto 8px;
    width: fit-content;
}

@media (max-width: 768px) {
    .lang-pill:not(.lang-pill-mobile) {
        display: none;           /* hide desktop pill on mobile */
    }
    .lang-pill-mobile {
        display: inline-flex;    /* show mobile pill */
    }
}

/* Dark mode */
html.dark .lang-pill {
    background: var(--bg-soft, #1e1e30);
    border-color: var(--border-soft, #2d2f45);
}
html.dark .lang-pill .lang-inactive {
    color: var(--text-muted, #8b96ad);
}


html.dark .dropdown-menu { background: #1e1e30; border-color: #2d2f45; }

/* ========== DARK MODE VARIABLES (html.dark) ========== */
html.dark {
    --bg-white: #121220;
    --bg-soft: #1e1e30;
    --text-dark: #ecf0f5;
    --text-body: #cfd8e6;
    --text-muted: #8b96ad;
    --border-soft: #2d2f45;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);
    --primary: #61a3e0;
    --primary-dark: #4a88cc;
    --primary-light: #7ab8f0;
    --accent: #61a3e0;
    --telegram: #0088cc;
    --telegram-hover: #00a1e0;
}

/* ========== THEME TOGGLE BUTTON ========== */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--border-soft);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    color: var(--text-dark);
}

.theme-toggle:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(59, 126, 199, 0.25);
}

.theme-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* Initial state: show sun, hide moon */
.moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.4);
}
.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* When dark mode is active, flip icons */
html.dark .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.4);
}
html.dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Correct footer & header specific backgrounds in dark mode */
html.dark .site-header {
    background: rgba(18, 18, 32, 0.85);
    backdrop-filter: blur(16px);
}
html.dark .site-footer {
    background: #0e0e1c;
}
html.dark .faq-item,
html.dark .question-card {
    background: #1e1e30;
}
html.dark .option-btn {
    background: #1e1e30;
    color: #cfd8e6;
}
html.dark .option-btn:hover {
    background: #282840;
}
html.dark .hero-illustration {
    background: radial-gradient(circle at 40% 35%, rgba(30, 30, 50, 0.9) 0%, rgba(20, 20, 38, 0.7) 100%);
    box-shadow: var(--shadow-lg), 0 0 0 20px rgba(97, 163, 224, 0.05), 0 0 0 50px rgba(97, 163, 224, 0.02);
}
html.dark .chat-bubble {
    background: #2d2f45;
    color: #e2e8f0;
}
html.dark .chat-bubble:nth-child(1),
html.dark .chat-bubble:nth-child(3) {
    background: #3a4a68;
}
html.dark .seo-content .keyword-pill {
    background: #25253b;
    border-color: #3b4a68;
}
html.dark .seo-content .keyword-pill:hover {
    background: #2d2f50;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.hamburger:hover {
    background: var(--bg-soft);
}
.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all var(--transition-smooth);
    transform-origin: center;
}
.hamburger.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

@media (max-width: 768px) {
    .main-nav,
    .header-cta {
        display: none !important;
    }

    .hamburger {
        display: flex;
    }
    .mobile-nav-overlay {
        display: none;
    }
    .mobile-nav-overlay.active {
        display: block;
    }
    .mobile-nav-panel {
        transform: translateX(-100%);       /* ← LTR: hidden off‑screen to the left */
    }
    .mobile-nav-panel.active {
        transform: translateX(0);
    }
}

/* ============ MOBILE MENU OVERLAY ============ */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Nav Panel – accessible scrolling (LTR: from left) */
.mobile-nav-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;                              /* ← LTR: attach to left side */
    width: 80%;
    max-width: 320px;
    background: var(--bg-white);
    box-shadow: 5px 0 20px rgba(0,0,0,0.1);   /* ← LTR: shadow on the right side */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1.5rem 1.25rem 2rem;
    z-index: 1000;
    transform: translateX(-100%);         /* ← LTR: start hidden off‑left */
    transition: transform 0.3s ease;
}

/* When the panel is active (open) */
.mobile-nav-panel.active {
    transform: translateX(0);
}

/* Optional slim scrollbar */
.mobile-nav-panel::-webkit-scrollbar {
    width: 4px;
}
.mobile-nav-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 8px;
}

.mobile-nav-panel .mobile-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
}
.mobile-nav-panel a {
    text-decoration: none;
    color: var(--text-body);
    font-weight: 500;
    font-size: 1.05rem;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: block;
}
.mobile-nav-panel a:hover,
.mobile-nav-panel a:focus {
    background: var(--bg-soft);
    color: var(--primary);
}
.mobile-nav-panel .mobile-cta {
    margin-top: auto;
    background: var(--telegram);
    color: #fff;
    text-align: center;
    padding: 14px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
}