body {
    font-family: 'B Nazanin', sans-serif;
    margin: 0;
    padding: 0;
    background-color: transparent; /* پس‌زمینه body شفاف می‌شود تا ذرات دیده شوند */
    color: #333;
    line-height: 1.7;
    direction: rtl;
    text-align: right;
    overflow-x: hidden; /* جلوگیری از اسکرول افقی اضافی */
    min-height: 100vh; /* حداقل ارتفاع بدنه تا محتوا کامل دیده شود */
    position: relative; /* برای Z-index فوتر */
}

/* استایل‌دهی برای کانتینر Particles.js */
#particles-js {
    position: fixed; /* ثابت در پس‌زمینه */
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 205); /* همان رنگ آبی تیره قبلی برای پس‌زمینه ذرات */
    background-image: url(''); /* اگر بخواهی تصویری پشت ذرات باشد */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% 50%;
    z-index: -1; /* قرار گرفتن در پشت محتوای اصلی */
}

header {
    background: linear-gradient(-45deg, #333, #009407, #333, #009407); /* Dark grey to green gradient */
    background-size: 400% 400%; /* Make background larger for animation */
    animation: gradientBG 15s ease infinite; /* Apply gradient animation */
    color: #fff;
    padding: 1em 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* Slightly stronger shadow for the dynamic background */
    position: relative; /* برای position: absolute لوگو ضروری است */
    z-index: 10;
}

/* Keyframes for the gradient background animation */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* استایل‌های جدید برای header-top */
.header-top {
    display: flex; /* استفاده از فلکس باکس برای چیدمان لوگو و h1 */
    justify-content: center; /* h1 را وسط‌چین می‌کند */
    align-items: center; /* تراز عمودی آیتم‌ها */
    padding: 0 20px;
    position: relative; /* برای position: absolute لوگو و ساعت */
}

/* استایل برای ساعت زنده */
#live-clock {
    position: absolute; /* برای قرار گرفتن در سمت راست */
    right: 20px; /* 20px از سمت راست فاصله */
    top: 50%; /* وسط‌چین عمودی */
    transform: translateY(-50%); /* تنظیم دقیق وسط‌چین عمودی */
    font-size: 1.1em; /* فونت کمی درشت‌تر شد */
    color: #fff;
    white-space: nowrap; /* جلوگیری از شکستن خط */
    direction: ltr; /* برای نمایش صحیح اعداد و فرمت تاریخ/ساعت میلادی */
    z-index: 12; /* اطمینان از قرار گرفتن روی دیگر عناصر */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* سایه متن برای خوانایی بهتر */
    background-color: rgba(0, 0, 0, 0.4); /* بکگراند مشکی نیمه‌شفاف */
    padding: 5px 10px; /* پدینگ برای بکگراند */
    border-radius: 5px; /* گوشه‌های گرد برای بکگراند */
}

.logo {
    position: absolute; /* لوگو را از جریان عادی سند خارج می‌کند */
    left: 20px; /* 20 پیکسل از سمت چپ هدر فاصله می‌گیرد (در RTL سمت چپ بصری) */
    top: 90%; /* به صورت عمودی در وسط قرار می‌گیرد */
    transform: translateY(-50%); /* برای وسط‌چین شدن دقیق عمودی */
    z-index: 11; /* اطمینان از قرار گرفتن لوگو روی دیگر عناصر در صورت لزوم */
}

.logo img {
    height: 150px; /* ارتفاع لوگو به 150px تغییر کرد */
    width: auto; /* حفظ نسبت ابعاد */
    display: block; /* حذف فضای اضافی زیر تصویر */
}

header h1 {
    margin: 0; /* حذف مارجین پیش‌فرض */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 2.5em;
    text-align: center; /* اطمینان از وسط‌چین بودن h1 */
    padding-left: 70px; /* اضافه کردن پدینگ برای جلوگیری از همپوشانی با لوگو در سمت چپ */
    padding-right: 70px; /* اضافه کردن پدینگ برای جلوگیری از همپوشانی با ساعت در سمت راست */
    flex-grow: 1; /* اجازه می‌دهد h1 فضای موجود را پر کند */
}

nav ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    display: flex; /* آیتم‌های ناوبری را فلکس می‌کند */
    justify-content: center; /* وسط‌چین کردن آیتم‌های ناوبری */
    flex-wrap: wrap; /* اجازه می‌دهد آیتم‌ها به خط بعدی بروند */
}

nav ul li {
    display: inline-block;
    margin: 0 18px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    position: relative;
    padding-bottom: 5px;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #00bcd4;
    bottom: 0;
    right: 0;
    transition: width 0.3s ease-out;
}

nav ul li a:hover::after {
    width: 100%;
    left: 0;
}

main {
    padding: 20px;
    max-width: 960px;
    margin: 20px auto;
    background-color: #009407; /* محتوای اصلی همچنان سفید است تا خوانا باشد */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    color: #222;
    position: relative; /* برای Z-index */
    z-index: 5; /* مطمئن می‌شویم محتوای اصلی روی ذرات باشد */
}

/* --- استایل‌های اسلایدشو اصلی --- */
.slider-section {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.slider-section h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 1.8em;
    letter-spacing: 0.5px;
}

.slider-container {
    max-width: 800px;
    position: relative;
    margin: auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    height: 450px; /* یک ارتفاع ثابت برای کانتینر اسلایدشو تعیین می‌کنیم */
}

.mySlides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* برای پر کردن کل فضای کانتینر */
    opacity: 0; /* به صورت پیش‌فرض پنهان هستند */
    transition: opacity 1s ease-in-out; /* انیمیشن نرم برای تغییر شفافیت */
}

.mySlides img {
    width: 100%;
    height: 100%; /* تصویر کل فضای div اسلاید را پر کند */
    object-fit: cover; /* تصویر را بدون بهم ریختن نسبت ابعاد، طوری قرار می‌دهد که کل فضای موجود را بپوشاند */
    vertical-align: middle;
    border-radius: 12px;
}

/* کلاس جدید برای اسلاید فعال */
.mySlides.active-slide {
    opacity: 1; /* اسلاید فعال کاملاً مشخص می‌شود */
}

/* متن روی اسلاید */
.text {
    color: #f2f2f2;
    font-size: 16px;
    padding: 10px 15px;
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 18px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 5px 5px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.next {
    right: 0;
    border-radius: 5px 0 0 5px;
}

.prev {
    left: 0;
    border-radius: 0 5px 5px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.dot {
    cursor: pointer;
    height: 14px;
    width: 14px;
    margin: 0 3px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease, transform 0.2s ease;
}

.active-dot, .dot:hover {
    background-color: #555;
    transform: scale(1.1);
}

/* --- استایل‌های جدید برای اسلایدرهای کوچک (Mini-Sliders) --- */
.mini-slider-container {
    max-width: 500px; /* حداکثر عرض کوچکتر برای اسلایدرهای مقاله */
    height: 280px; /* ارتفاع متناسب با عرض (برای نسبت 16:9) */
    position: relative;
    margin: 20px auto; /* وسط‌چین کردن و اضافه کردن مارجین */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.miniSlides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out; /* انیمیشن محو شدن */
}

.miniSlides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.miniSlides.active-slide {
    opacity: 1;
}

/* دکمه‌های ناوبری (فلش‌ها) برای اسلایدرهای کوچک */
.mini-prev, .mini-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 10px 12px; /* پدینگ کوچکتر */
    color: white;
    font-weight: bold;
    font-size: 18px; /* اندازه فونت کوچکتر */
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2; /* مطمئن شوید فلش‌ها روی اسلایدها قرار بگیرند */
}

.mini-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.mini-prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.mini-prev:hover, .mini-next:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

/* نقطه‌های ناوبری برای اسلایدرهای کوچک */
.mini-dot {
    cursor: pointer;
    height: 10px; /* نقطه‌های کوچکتر */
    width: 10px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease, transform 0.2s ease;
}

.mini-dot.active-dot, .mini-dot:hover {
    background-color: #555;
    transform: scale(1.1);
}


/* --- استایل‌های مقالات --- */
.article-section {
    margin-bottom: 40px;
    padding: 25px;
    border-bottom: 1px solid #eee;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
    background-color: #fcfcfc;
}

.article-section:last-of-type {
    border-bottom: none;
}

.article-section:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
    background-color: #fff;
}

.article-section h2 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: #333;
    letter-spacing: 0.3px;
}

.article-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-section p {
    font-size: 0.95em;
    line-height: 1.8;
    margin-bottom: 10px;
}

/* --- استایل‌های جدید برای دکمه‌های فراخوان (CTA Buttons) --- */
.cta-button {
    display: inline-block; /* برای اینکه پدینگ و مارجین به درستی اعمال شوند */
    background-color: #00bcd4; /* رنگ آبی فیروزه‌ای برای برجسته‌سازی */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none; /* حذف زیرخط از لینک‌ها */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-out; /* انیمیشن نرم برای همه تغییرات */
    text-align: center;
    margin-top: 15px; /* برای فاصله از محتوای بالا */
}

.cta-button:hover {
    background-color: #00a4bd; /* رنگ کمی تیره‌تر در هاور */
    transform: translateY(-3px); /* دکمه کمی به بالا حرکت می‌کند */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35), 0 0 15px rgba(0, 200, 220, 0.5); /* سایه قوی‌تر و یک افکت نورانی */
}

.cta-button:active {
    transform: translateY(0); /* دکمه به حالت اولیه برمی‌گردد (فرو می‌رود) */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* سایه کمتر برای حس فشرده شدن */
}


/* --- استایل های فوتر --- */
footer {
    text-align: center;
    padding: 20px 0;
    background-color: #333;
    color: #fff;
    margin-top: 30px;
    box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.2);
    position: relative; /* برای Z-index */
    z-index: 10; /* مطمئن می‌شویم فوتر روی ذرات باشد */
}

.footer-columns {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 20px;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin: 10px 15px;
    padding: 15px;
    border-radius: 8px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease; /* Added transform for lift effect */
    text-align: right;
}

.footer-column:hover {
    background-color: rgba(255, 255, 255, 0.12); /* Slightly more prominent background change */
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); /* Stronger glow/shadow */
    transform: translateY(-5px); /* Lift effect */
}

.left-column {
    text-align: left;
}

.footer-column h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
    letter-spacing: 0.2px;
}

.footer-column p, .footer-column ul {
    font-size: 0.85em;
    color: #eee;
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.6;
}

.footer-column ul li {
    margin-bottom: 5px;
    padding: 3px 0;
    transition: background-color 0.3s ease;
}

.footer-column ul li:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.footer-column ul li a {
    color: #eee;
    text-decoration: none;
}

.footer-column ul li a:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 20px;
    padding-bottom: 10px;
}

/* --- استایل‌های جدید برای لیست تماس (آیکون‌ها و متن زیر هم) --- */
.contact-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    text-align: right; /* متن‌ها از راست تراز شوند */
}

.contact-list li a {
    color: #eee;
    text-decoration: none;
    display: flex;
    align-items: center; /* تراز عمودی آیکون و متن */
    transition: color 0.3s ease; /* برای افکت هاور */
    direction: rtl; /* برای چیدمان RTL */
    text-align: right; /* برای تراز بندی متن داخل لینک */
}

.contact-list li a i {
    font-size: 1.5em; /* اندازه آیکون‌ها */
    width: 30px; /* برای حفظ فضا و تراز بندی بهتر */
    text-align: center; /* وسط‌چین کردن آیکون در فضای اختصاص داده شده */
    transition: transform 0.3s ease-in-out, color 0.3s ease; /* Added color transition for hover */
    margin-left: 10px; /* فاصله از متن در RTL */
}

/* برای ایجاد فاصله بین آیکون و اسم */
.contact-list li a span {
    white-space: nowrap; /* جلوگیری از شکستن خط در اسم‌ها */
}


.contact-list li a:hover {
    color: #00bcd4; /* Main link color change on hover */
}

.contact-list li a:hover i {
    transform: scale(1.2) rotate(5deg); /* Updated: Added rotation */
    color: #00bcd4; /* Ensure icon also gets the vibrant color */
}

/* --- New: Styles for the personal website button in footer --- */
.footer-bottom-right {
    position: absolute; /* Position it absolutely within the footer */
    bottom: 10px; /* 10px from the bottom */
    right: 20px; /* 20px from the right */
    z-index: 11; /* Ensure it's above other footer content if needed */
}

.my-website-button {
    display: inline-block;
    background-color: #00bcd4; /* Your accent color */
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text from wrapping */
}

.my-website-button:hover {
    background-color: #00a4bd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* --- Media Queries برای ریسپانسیو بودن --- */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column; /* لوگو و h1 به صورت عمودی روی هم قرار بگیرند */
        align-items: center; /* وسط‌چین کردن آیتم‌ها در حالت عمودی */
        padding: 0 10px;
    }

    #live-clock {
        position: static; /* موقعیت مطلق را حذف می‌کند و به جریان عادی سند برمی‌گردد */
        transform: none; /* ترنسفورم قبلی را حذف می‌کند */
        margin-top: 10px; /* اضافه کردن فاصله */
        margin-bottom: 10px;
        text-align: center; /* وسط‌چین کردن متن */
    }

    .logo {
        position: static; /* موقعیت مطلق را حذف می‌کند و لوگو به جریان عادی سند برمی‌گردد */
        transform: none; /* ترنسفورم قبلی را حذف می‌کند */
        top: auto;
        left: auto; /* سمت چپ را به auto برمی‌گرداند */
        margin: 0 auto 10px auto; /* لوگو را افقی وسط‌چین و مارجین پایین اضافه می‌کند */
    }

    header h1 {
        padding-left: 0; /* پدینگ‌ها را حذف می‌کند */
        padding-right: 0; /* پدینگ‌ها را حذف می‌کند */
        font-size: 2em;
        margin-bottom: 10px; /* اضافه کردن فاصله زیر h1 در حالت عمودی */
    }

    nav ul {
        flex-direction: column; /* آیتم‌های ناوبری به صورت عمودی روی هم قرار بگیرند */
        align-items: center; /* وسط‌چین کردن آیتم‌ها */
    }

    nav ul li {
        margin: 5px 0; /* کاهش مارجین و تنظیم عمودی */
    }

    .footer-columns {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .left-column {
        text-align: center;
    }

    .contact-list {
        text-align: center; /* در حالت موبایل، لیست تماس وسط‌چین شود */
    }

    .contact-list li a {
        justify-content: center; /* وسط‌چین کردن کل آیتم در موبایل */
        margin-left: 0; /* حذف مارجین سمت چپ برای تراز */
    }

    /* برای ایجاد فاصله در موبایل */
    .contact-list li a i {
        margin-left: 8px; /* فاصله از متن در RTL در موبایل */
    }

    .footer-column {
        margin: 15px 0;
        width: 90%;
        padding: 20px;
    }

    .prev, .next {
        font-size: 16px;
        padding: 10px;
    }
    .text {
        font-size: 12px;
        padding: 5px;
    }

    header h1 {
        font-size: 2em;
    }
    /* nav ul li { margin: 0 10px; } این خط به دلیل flex-direction: column بالا غیر ضروری است */
    nav ul li a {
        font-size: 1em;
    }
    /* Media queries for mini-sliders */
    .mini-slider-container {
        max-width: 100%; /* در موبایل تمام عرض را بگیرد */
        border-radius: 0;
        height: 200px; /* کاهش ارتفاع اسلایدرهای کوچک در موبایل */
    }
    .miniSlides img {
        border-radius: 0;
    }

    .slider-container {
        height: 300px; /* کاهش ارتفاع اسلایدر اصلی در موبایل */
    }

    /* Adjust button position for smaller screens */
    .footer-bottom-right {
        position: static; /* Remove absolute positioning */
        text-align: center; /* Center the button */
        margin-top: 15px; /* Add some space above it */
        margin-bottom: 10px; /* Add some space below it */
    }
}

@media (max-width: 600px) {
    main {
        padding: 15px;
        margin: 15px auto;
    }
    .slider-container {
        max-width: 100%;
        border-radius: 0;
        height: 250px; /* باز هم کاهش ارتفاع برای موبایل‌های کوچکتر */
    }
    .mySlides img {
        border-radius: 0;
    }
    .text {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    .article-section {
        padding: 20px;
    }
    .article-section h2 {
        font-size: 1.4em;
    }
    .article-section p {
        font-size: 0.9em;
    }

    .mini-slider-container {
        height: 180px; /* کاهش بیشتر ارتفاع اسلایدرهای کوچک */
    }
}