#mapid { 
    height: 500px; 
}

:root {
    --color-bg-primary: #1F1F1F;
    --color-bg-secondary: #2C2C2C;
    --color-text-primary: #E0E0E0;
    --color-text-secondary: #B0B0B0;
    --color-accent-gold: #D4AF37;
    --color-timeline-bg: #1A1A1A;
    --color-timeline-year: #888888;
    --color-timeline-marker: #D32F2F;
    --color-link-hover: #D4AF37;
    --font-main: 'Vazirmatn', sans-serif;
}

    /* General styles */
body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background-color: #3E2B13; /* The main background color */
    color: #f0e6d2; /* A light, warm color for text */
}

/* استایل پری‌لودر */
.preloader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2e2417; /* رنگ پس‌زمینه سایت شما */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.preloader-container.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.preloader-logo svg {
    animation: rotate 2s linear infinite;
    box-shadow: 0 0 20px rgba(255, 153, 0, 0.5);
    border-radius: 50%;
}

.preloader-logo .path {
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    animation: dash 1.5s ease-in-out infinite;
}

.preloader-text {
    margin-top: 15px;
    font-size: 1.2em;
    color: #f0e6d2;
    animation: fadePulse 1.5s infinite;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dashoffset: 283;
    }
    50% {
        stroke-dashoffset: 70.75; /* 25% از کل مسیر */
    }
    100% {
        stroke-dashoffset: 283;
    }
}

@keyframes fadePulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Container for the whole page content */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
}

/* Main content wrapper */
.main-content {
    background-color: #3E2B13; /* Same as body to keep the single color */
}

/* Intro section */
.intro {
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.intro h1 {
    font-size: 2.5em;
    font-weight: normal;
    margin-bottom: 10px;
}

.intro p {
    font-size: 1.1em;
    color: #c9b19e;
}

/* Two-column layout */
.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Adjust the ratio as needed */
    gap: 80px;
    padding-top: 50px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #f0e6d2;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #5a4b3f;
    background-color: #4b3d30;
    color: #f0e6d2;
    border-radius: 4px;
    box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a3958c;
}

.form-group textarea {
    resize: vertical;
}

.privacy-note {
    font-size: 0.9em;
    color: #a3958c;
    margin-top: 20px;
    margin-bottom: 20px;
}

.privacy-note a {
    color: #f0e6d2;
    text-decoration: none;
    border-bottom: 1px dashed #f0e6d2;
}

.privacy-note a:hover {
    border-bottom-style: solid;
}

button {
    background-color: #8c6d48;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #7a5f3e;
}

/* Info section (right column) */
.info-section {
    line-height: 1.6;
}

.info-section h3 {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #f0e6d2;
}

.info-section p,
.info-section a {
    color: #c9b19e;
    text-decoration: none;
    line-height: 1.8;
}

.info-section a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

.map-container {
    height: 455px; 
    width: 100%; 
    border-radius: 12px;
    overflow: hidden;
    filter: brightness(50%) grayscale(30%); /* تاریک */
    transition: filter 0.6s ease-in-out;
}
.map-container:hover {
    filter: brightness(100%) grayscale(0%); /* روشن وقتی موس میاد */
}

/* فوتر اصلی */
.site-footer {
    background-color: #442f15; /* رنگ پس‌زمینه فوتر */
    color: #fff;
    padding: 40px 80px 20px 80px; /* padding داخلی فوتر */
}

/* بخش بالایی فوتر */
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.footer-column {
    flex: 1;
    margin: 10px;
    min-width: 200px;
}

/* استایل لوگو */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.sun-icon {
    width: 100px; /* اندازه آیکون خورشید */
    height: 100px;
    border-radius: 50px;
}

.logo h1 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
}

.online-text {
    font-weight: 400;
}

/* استایل آیکون‌های شبکه‌های اجتماعی */
.social-icons a {
    color: #fff;
    font-size: 1.2em;
    margin-right: 15px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-icons a:hover {
    opacity: 1;
}

/* استایل عنوان ستون‌ها */
.footer-column h4 {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ff9900; /* رنگ نارنجی عنوان‌ها */
}

/* استایل لیست لینک‌ها */
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-column a:hover {
    opacity: 1;
}

/* خط جداکننده */
.footer-divider {
    border: 0;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 20px 0;
}

/* بخش پایینی فوتر */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9em;
}

.footer-bottom p, .footer-bottom a {
    margin-right: 20px;
    opacity: 0.7;
}

.footer-bottom a {
    text-decoration: none;
    color: #fff;
}

.language-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.language-selector select {
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 8px 30px 8px 10px;
    appearance: none; /* حذف ظاهر پیش‌فرض select */
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 3px;
    cursor: pointer;
}

.language-selector .fas {
    position: absolute;
    right: 10px;
    font-size: 0.8em;
    pointer-events: none; /* اجازه می‌دهد روی آیکون کلیک نشود */
    opacity: 0.7;
}

        .header {
            font-family: var(--font-main);
            display: flex;
            direction: rtl;
            text-align: right;
            justify-content: space-between;
            align-items: center;
            background-color: #473116;
            padding: 0 1rem;
            height: 80px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            z-index: 1000;
        }
        
        #header-left {
            display: flex;
            align-items: center;
        }

        #header-logo {
            font-weight: 700;
            color: var(--color-accent-gold);
            text-decoration: none;
            white-space: nowrap;
            padding-top: 10px;
        }
        
        #search-box {
            display: flex;
            align-items: center;
            background-color: #837A6E80;
            border-radius: 20px;
            padding: 0.5rem 1rem;
            width: 300px;
            margin: 0 1.5rem;
        }
        
        #search-box input {
            background: none;
            border: none;
            color: var(--color-text-primary);
            font-family: var(--font-main);
            width: 100%;
            outline: none;
            padding: 0;
            margin-right: 0.5rem;
        }
        
        #search-box input::placeholder {
            color: var(--color-text-secondary);
        }
        
        #header-nav {
            display: flex;
            align-items: center;
        }

        #header-nav a {
            color: #ffffff;
            text-decoration: none;
            padding: 0.5rem 1rem;
            font-weight: 400;
            transition: color 0.2s ease;
            white-space: nowrap;
        }
        
        #header-nav a:hover {
            color: var(--color-accent-gold);
        }

        #header-right {
            display: flex;
            align-items: center;
            position: relative;
            gap: 1rem;
        }
        /* --- Share Button --- */
        #share-button {
            background: none;
            border: none;
            color: var(--color-text-secondary);
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            cursor: pointer;
            border-radius: 50%;
            transition: background-color 0.2s ease;
        }

        #share-button:hover {
            background-color: #383838;
        }

        /* --- User Avatar and Dropdown --- */
        #user-avatar-container {
            position: relative;
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--color-text-primary);
            font-size: 1.2rem;
            cursor: pointer;
        }

        #user-dropdown {
            position: absolute;
            top: 100%;
            right: -250px;
            width: 250px;
            background-color: #473116c0;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.5);
            padding: 1rem;
            margin-top: 0.5rem;
            z-index: 999;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: opacity 0.2s ease, transform 0.2s ease;
        }
        
        #user-dropdown.open {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        
        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.7rem 1rem;
            text-decoration: none;
            color: var(--color-text-secondary);
            border-radius: 4px;
            transition: background-color 0.2s ease, color 0.2s ease;
        }
        
        .dropdown-item:hover {
            background-color: #383838;
            color: var(--color-text-primary);
        }
        
        .dropdown-item i {
            width: 20px;
            text-align: center;
            font-size: 1rem;
        }
        
        .dropdown-item span {
            font-size: 0.9rem;
        }

/* لوگو */
header {
    margin-bottom: 20vh;
    align-self: flex-start;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sun-icon {
    width: 130px;
    height: 130px;
    border-radius: 80px;
}

h1 {
    font-size: 4em;
    font-weight: 700;
    margin: 0;
}

.online-text {
    font-size: 30px;
    font-weight: 400;
}

 /* Main content container */
        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 50px 20px;
        }

        /* Individual blog post card */
        .blog-post {
            display: flex;
            align-items: center;
            border-radius: 10px;
            margin-bottom: 30px;
            padding: 20px;
        }

        .blog-post-image {
            flex-shrink: 0;
            margin-right: 30px;
        }

        .blog-post-image img {
            width: 250px;
            height: 150px;
            object-fit: cover;
            border-radius: 8px;
        }

        .blog-post-content {
            flex-grow: 1;
        }

        .blog-post-content h2 {
            font-size: 1.2em;
            font-weight: 700;
            margin: 0 0 10px;
        }

        .blog-post-content p.published-date {
            font-size: 0.9em;
            color: #c9b19e;
            margin: 0 0 15px;
        }

        .blog-post-content p.description {
            line-height: 1.3;
            color: #f0e6d2;
            margin: 0;
        }

        /* Footer styling (reusing from previous request) */
        .site-footer {
            background-color: #442f15;
            color: #fff;
            padding: 40px 80px 20px 80px;
            margin-top: 50px;
        }

        .footer-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
            padding-bottom: 20px;
        }

        .footer-column {
            flex: 1;
            margin: 10px;
            min-width: 200px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 15px;
        }

        .sun-icon {
            width: 100px;
            height: 100px;
        }

        .logo h1 {
            font-size: 1.5em;
            font-weight: 700;
            margin: 0;
        }

        .online-text {
            font-weight: 400;
        }

        .social-icons a {
            color: #fff;
            font-size: 1.2em;
            margin-right: 15px;
            opacity: 0.8;
            transition: opacity 0.3s ease;
        }

        .social-icons a:hover {
            opacity: 1;
        }

        .footer-column h4 {
            font-size: 1em;
            font-weight: 600;
            margin-bottom: 20px;
            color: var(--color-accent-gold);
        }

        .footer-column ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .footer-column li {
            margin-bottom: 10px;
        }

        .footer-column a {
            color: #fff;
            text-decoration: none;
            opacity: 0.8;
            transition: opacity 0.3s ease;
        }

        .footer-column a:hover {
            opacity: 1;
        }

        .footer-divider {
            border: 0;
            height: 1px;
            background-color: rgba(255, 255, 255, 0.3);
            margin: 20px 0;
        }

        .footer-bottom {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            font-size: 0.9em;
        }

        .footer-bottom p, .footer-bottom a {
            margin-right: 20px;
            opacity: 0.7;
        }

        .footer-bottom a {
            text-decoration: none;
            color: #fff;
        }

        .language-selector {
            position: relative;
            display: flex;
            align-items: center;
        }

        .language-selector select {
            background-color: transparent;
            color: #fff;
            border: 1px solid rgba(255, 255, 255, 0.5);
            padding: 8px 30px 8px 10px;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            border-radius: 3px;
            cursor: pointer;
        }

        .language-selector .fas {
            position: absolute;
            right: 10px;
            font-size: 0.8em;
            pointer-events: none;
            opacity: 0.7;
        }

        /* Responsive design */
        @media (max-width: 768px) {
            .blog-post {
                flex-direction: column;
                text-align: center;
            }

            .blog-post-image {
                margin: 0 0 20px;
            }

            .site-footer {
                padding: 40px 20px;
            }
        }

        /* استایل برای خط جداکننده بین بلاگ‌پست‌ها */
        .post-divider {
            border: 0;
            height: 1px;
            background-color: rgba(255, 255, 255, 0.1); /* یک خط سفید با شفافیت کم */
            margin: 50px 0; /* فاصله بالا و پایین خط */
            width: 100%; /* عرض خط را تنظیم می‌کند */
            border-radius: 50%; /* خط را گرد می‌کند */
            background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)); /* یک گرادیان برای محو شدن تدریجی */
        }



/* استایل‌های مربوط به دکمه تغییر زبان */
.language-switcher {
    position: relative;
    padding-right: 300px;
    /* این بخش را حذف کنید اگر قبلاً در `header-right` تعریف شده باشد. */
}

/* استایل دکمه تغییر زبان با متن */
.language-button {
    background-color: rgba(255, 255, 255, 0.08); /* پس‌زمینه کمی شفاف */
    border: 1px solid rgba(255, 255, 255, 0.15); /* حاشیه */
    color: var(--color-text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px; /* گوشه‌های گرد */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

.language-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--color-accent-gold); /* حاشیه طلایی پررنگ‌تر */
    transform: translateY(-2px);
}

/* آیکون داخل دکمه */
.language-button .icon {
    font-size: 1.2rem;
    color: var(--color-accent-gold);
}

/* متن داخل دکمه */
.language-button .text {
    font-family: var(--font-main);
    font-weight: 500;
}

/* استایل‌های مربوط به منوی کشویی زبان */
.language-dropdown {
    position: absolute;
    top: 100%;
    width: 170px;
    background-color: #837A6E80;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    padding: 1rem;
    margin-top: 0.5rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden; /* منو را پنهان می‌کند */
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    direction: rtl; 
}

/* این کلاس با جاوا اسکریپت اضافه می‌شود تا منو نمایش داده شود */
.language-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 768px) {
    /* تنظیمات عمومی برای بدنه و کانتینر اصلی */
    body, #app-container {
        overflow-x: hidden; /* جلوگیری از اسکرول افقی اضافی */
    }

    /* --- هدر (Header) بهینه شده برای موبایل --- */
    .header {
        height: 60px; /* ارتفاع کمتر برای هدر */
        padding: 0 1rem;
    }

    #header-logo {
        font-size: 1.2rem;
        padding-top: 0;
    }

    #header-nav {
        display: none; /* پنهان کردن منوی اصلی برای جلوگیری از شلوغی */
    }
    
    #search-box {
        display: none; /* پنهان کردن باکس جستجو در هدر موبایل */
    }
    
    #header-right {
        gap: 0.5rem;
    }

    .language-switcher {
        /* تنظیم موقعیت دکمه زبان */
        padding-right: 0;
    }
    
    /* نمایش دکمه‌های مهم در هدر */
    #header-right #share-button,
    #header-right .language-switcher {
        display: flex; /* مطمئن شوید که این دکمه‌ها نمایش داده می‌شوند */
    }

    /* --- تغییرات در سایدبارها و پنجره‌های شناور --- */
    
    /* سایدبار اطلاعات (اطلاعات دوره) به صورت تمام صفحه */
    .sidebar-info {
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 1px;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }
    
    .sidebar-header {
        padding: 15px;
        position: sticky;
        top: 0;
    }

    .info-details {
        padding: 15px;
    }
    
    /* سایدبار نقشه‌ها (سمت راست) به صورت تمام صفحه */
    #sidebar-right.open {
        top: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        min-width: 100%;
        transition: transform 0.3s ease;
        transform: translateX(0);
        overflow-y: auto;
    }

    /* --- مرکز کردن صحیح پنجره‌های شناور --- */
    #share-modal #share-popup {
        width: 90%;
    }
    
    /* --- چت‌باکس AI بهینه شده --- */
    #ai-chat-box {
        bottom: 150px; /* بالای تایم‌لاین */
        right: -2%;
        transform: translateX(50%);
        width: 102%;
        height: 70%;
        max-width: none;
    }

    .ai-orb-container {
        bottom: 110px; /* موقعیت بالاتر از تایم‌لاین */
        right: 15px; /* فاصله از لبه سمت راست */
        width: 45px;
        height: 45px;
        box-shadow: 0 4px 10px rgba(64, 26, 26, 0.3); /* سایه کوچک‌تر */
    }

    .ai-orb {
        width: 22px;
        height: 22px;
    }

    .ai-orb-container:hover {
        transform: scale(1.05); /* افکت هاور کوچک‌تر */
    }

    /* --- تایم‌لاین (Timeline) --- */
    #timeline-container {
        height: 100px;
        padding: 0 0.5rem;
    }
    
    #timeline-slider-wrapper {
        width: 95%;
    }
    
    #timeline-years {
        width: 95%;
        top: 10px;
        overflow-x: auto;
        white-space: nowrap;
        justify-content: flex-start;
        gap: 2rem;
    }

    .timeline-label {
        min-width: auto;
    }
    
    #current-year-display {
        font-size: 1.2rem;
        top: 5px;
    }
}

/* --- استایل‌های جدید برای منوی موبایل --- */
.mobile-menu-toggle {
    display: none; /* به صورت پیش‌فرض در دسکتاپ پنهان است */
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute; /* موقعیت‌یابی در هدر */
    top: 31px;
    transform: translateY(-50%);
    left: 126px; /* فاصله از لبه چپ */
    z-index: 100;
}

/* استایل‌دهی منوی موبایل (به صورت پیش‌فرض پنهان است) */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 87%;
    height: 100%;
    background-color: var(--color-bg-primary);
    transform: translateX(100%); /* منو را به خارج از صفحه منتقل می‌کند */
    transition: transform 0.4s ease-in-out;
    z-index: 2000;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.mobile-menu.open {
    transform: translateX(0); /* منو را به داخل صفحه می‌آورد */
}

.mobile-menu a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-bg-secondary);
}

.mobile-menu .menu-header {
    display: flex;
    justify-content: flex-end;
}

.menu-close-btn {
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.8rem;
    cursor: pointer;
}

/* --- Media Query برای حالت موبایل --- */
@media (max-width: 768px) {
    /* نمایش دکمه منوی موبایل */
    .mobile-menu-toggle {
        display: block;
    }

    /* پنهان کردن لینک‌های ناوبری دسکتاپ و تغییر زبان */
    #header-nav,
    .language-switcher {
        display: none;
    }
}