/* ========================================================================== 
   بخش ویژگی‌ها
   ========================================================================== */

   .features-section {
    padding: 80px 0;
    background-color: var(--background);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1; /* اطمینان از اینکه بخش اصلی بالاتر از عناصر دیگر است */
}

.features-section::before {
    content: "";
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 50%;
    z-index: 0;
    animation: float 6s ease-in-out infinite;
    pointer-events: none; /* جلوگیری از مسدود کردن کلیک */
}

.features-section::after {
    content: "";
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: rgba(0, 123, 255, 0.2);
    border-radius: 50%;
    z-index: 0;
    animation: float-reverse 8s ease-in-out infinite;
    pointer-events: none; /* جلوگیری از مسدود کردن کلیک */
}

.features-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.feature-item {
    flex: 1 1 300px;
    max-width: 300px;
    min-height: 280px;
    background: var(--text-light);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    z-index: 2; /* اطمینان از اینکه محتوای اصلی بالاتر از همه است */
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.feature-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(0, 123, 255, 0.1));
    z-index: -1;
    transition: opacity 0.4s ease;
    opacity: 0;
    pointer-events: none; /* جلوگیری از مسدود کردن کلیک */
}

.feature-item:hover::before {
    opacity: 1;
}

.feature-item i {
    font-size: 50px;
    color: var(--secondary);
    margin-bottom: 20px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.feature-item:hover i {
    transform: scale(1.2);
    color: var(--primary);
}

.feature-item h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--text-dark);
    font-weight: bold;
}

.feature-item p {
    font-size: 16px;
    color: var(--text-muted);
    margin-top: auto;
}

.feature-item .feature-icon {
    display: block;
    margin: 0 auto 20px;
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(0, 123, 255, 0.1);
    padding: 10px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    background: rgba(255, 193, 7, 0.2);
}

/* انیمیشن‌های شناور */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes float-reverse {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(20px);
    }
}

/* ریسپانسیو برای دستگاه‌های کوچک */
@media (max-width: 768px) {
    .features-container {
        justify-content: center; /* باکس‌ها را در مرکز افقی قرار می‌دهد */
        align-items: center; /* باکس‌ها را در مرکز عمودی قرار می‌دهد */
        flex-direction: column; /* باکس‌ها را به صورت ستونی نمایش می‌دهد */
    }

    .feature-item {
        max-width: 90%; /* عرض باکس‌ها را محدود می‌کند تا در صفحه کوچک‌تر بهتر نمایش داده شوند */
    }
}