﻿/* --- ريسپانسيو (موبايل و تبلت) --- */
@media (max-width: 768px) {
    .timeline::before {
        /*left: 30px;*/ /* خط به سمت راست منتقل مي‌شود */
    }

    .timeline-item {
        width: 100%;
        float: none;
        padding-left: 0;
        /*padding-right: 75px;*/ /* فاصله از راست براي جاي آيکون */
        margin-bottom: 40px;
        transform: translateY(50px); /* انيميشن در موبايل فقط از پايين به بالا */
    }

        /* همه آيتم‌ها شبيه آيتم راست مي‌شوند */
        .timeline-item.left, .timeline-item.right {
            float: none;
            text-align: right;
        }

            .timeline-item.left .timeline-img,
            .timeline-item.right .timeline-img {
                left: auto;
                /*right: 0px;*/ /* آيکون سمت راست قرار مي‌گيرد */
            }

    /* حذف فلش در موبايل براي سادگي */
    .timeline-content::before {
        display: none;
    }

    .timeline-item.left .timeline-content {
        text-align: right;
    }

    .timeline-item.is-visible {
        transform: translateY(0);
    }
}
/* --- تنظيمات اوليه و متغيرها --- */
:root {
    --primary-color: #6C63FF; /* رنگ اصلي (بنفش) - قابل تغيير */
    --secondary-color: #3f3d56; /* رنگ متن تيره */
    --bg-light: #f4f7f6; /* رنگ پس زمينه */
    --text-muted: #777; /* رنگ متن کم‌رنگ */
    --timeline-line-color: #e0e0e0; /* رنگ خط وسط */
    --font-family: 'Tahoma', Arial, sans-serif; /* فونت پيشفرض */
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: var(--secondary-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.roadmap-section {
    padding: 50px 0;
}

h2.section-title {
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary-color);
    font-size: 2rem;
    position: relative;
}

/* --- استايل اصلي تايم‌لاين --- */
.timeline {
    position: relative;
    padding: 20px 0;
}

    /* خط عمودي وسط */
    .timeline::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%; /* در دسکتاپ وسط باشد */
        width: 4px;
        background: var(--timeline-line-color);
        margin-left: -2px;
        border-radius: 2px;
    }

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    width: 50%;
    clear: both;
    opacity: 0; /* براي انيميشن اوليه مخفي است */
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    ;
}

    /* آيتم‌هاي سمت راست و چپ */
    .timeline-item.left {
        float: left;
        padding-right: 40px;
        text-align: left; /* محتوا چپ‌چين براي فارسي */
        transform: translateX(-100px); /* براي انيميشن */
    }

        .timeline-item.left .timeline-content {
            text-align: right;
        }
    /* متن داخل باکس راست چين */


    .timeline-item.right {
        float: right;
        padding-left: 40px;
        transform: translateX(100px); /* براي انيميشن */
    }


/* دايره/آيکون روي خط */
.timeline-img {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    position: absolute;
    top: 0;
    text-align: center;
    line-height: 60px;
    font-weight: bold;
    font-size: 1.4rem;
    box-shadow: 0 0 0 5px var(--bg-light), inset 0 2px 0 rgba(0,0,0,0.08), 0 3px 0 4px rgba(0,0,0,0.05);
    z-index: 2;
}

.timeline-item.left .timeline-img {
    right: -30px; /* موقعيت نسبت به خط وسط */
}

.timeline-item.right .timeline-img {
    left: -30px; /* موقعيت نسبت به خط وسط */
}


/* باکس محتوا */
.timeline-content {
    background: white;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(50,50,93,0.1), 0 5px 15px rgba(0,0,0,0.07);
    position: relative;
    border-right: 5px solid var(--primary-color); /* نوار رنگي کنار باکس */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    /* فلش کوچک کنار باکس */
    .timeline-content::before {
        content: '';
        position: absolute;
        top: 20px;
        width: 0;
        height: 0;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        z-index: 1;
    }

.timeline-item.left .timeline-content::before {
    right: -10px;
    border-left: 10px solid var(--primary-color);
}

.timeline-item.right .timeline-content::before {
    left: -10px;
    border-right: 10px solid var(--primary-color);
}


.timeline-content:hover {
    transform: translateY(-7px); /* حرکت کوچک هنگام هاور */
    box-shadow: 0 18px 38px rgba(50,50,93,0.15), 0 8px 18px rgba(0,0,0,0.1);
}

.timeline-content h3 {
    margin: 0 0 15px;
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.timeline-content .date {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: inline-block;
    background: rgba(108, 99, 255, 0.12);
    padding: 6px 15px;
    border-radius: 30px;
}

.timeline-content p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 1rem;
}

/* دکمه لينک */
.btn-link {
    text-decoration: none;
    background: var(--primary-color);
    color: white !important;
    padding: 2px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(108, 99, 255, 0.2);
}

    .btn-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 10px rgba(108, 99, 255, 0.3);
        background-color: #5a52d5;
    }

/* --- انيميشن هنگام اسکرول --- */
.timeline-item.is-visible {
    opacity: 1;
    transform: translateX(0);
}


/* حل مشکل Clearfix براي المان‌هاي شناور */
.timeline::after {
    content: "";
    display: table;
    clear: both;
}

.fade-in-box {
    opacity: 0;
    animation: fadeIn 3.2s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}