/* =========================================================
   رادیک وب - استایل نوار ویژگی‌ها
   فایل: assets/css/features.css
   پیشوند: ft-
   نسخه: 3.0  (چینش وسط‌چین کارت‌ها + هدر کاملاً وسط‌چین)
   ========================================================= */

/* ═══════════════════════════════════════════════════════════
   ۱. بخش اصلی
   ═══════════════════════════════════════════════════════════ */
.ft-section {
    position: relative;
    padding: 70px 20px 60px;
    background: var(--rw-body-bg, #F8FAFC);
    direction: rtl;
    overflow: hidden;
}

.ft-section::before {
    content: "";
    position: absolute;
    top: 0;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle,
        rgba(37, 99, 235, 0.05) 0%,
        transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ft-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -100px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle,
        rgba(37, 99, 235, 0.03) 0%,
        transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.ft-container {
    position: relative;
    z-index: 2;
    max-width: 1300px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════
   ۲. هدر بخش (کاملاً وسط‌چین)
   ═══════════════════════════════════════════════════════════ */
.ft-header {
    display: flex;
    flex-direction: column;
    align-items: center;      /* وسط‌چین افقی همه فرزندان */
    justify-content: center;
    text-align: center;
    margin-bottom: 50px;
}

.ft-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg,
        rgba(37, 99, 235, 0.1),
        rgba(30, 58, 138, 0.08));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 30px;
    font-family: 'Shabnam-Bold-P', Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--rw-primary, #2563EB);
    margin: 0 auto 20px;      /* وسط‌چین + فاصله پایین */
    text-align: center;
    animation: ftFadeIn 0.7s ease 0.1s both;
}

.ft-badge i {
    font-size: 14px;
    color: var(--rw-primary, #2563EB);
    animation: ftSpin 3s linear infinite;
}

@keyframes ftSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ft-title {
    font-family: 'Lalezar-ExtraBold', sans-serif;
    font-size: 40px;
    font-weight: 800;
    color: var(--rw-heading, #1E3A8A);
    margin: 0 auto 15px;      /* وسط‌چین + فاصله پایین */
    line-height: 1.3;
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
    animation: ftFadeIn 0.7s ease 0.2s both;
}

.ft-subtitle {
    font-family: 'Shabnam-Bold-P', Tahoma, sans-serif;
    font-size: 15px;
    color: var(--rw-muted, #6B7280);
    margin: 0 auto;           /* وسط‌چین افقی */
    padding: 0;
    max-width: 640px;         /* جلوگیری از پهن شدن بیش از حد */
    width: 100%;
    line-height: 1.8;
    text-align: center;       /* صریح: وسط‌چین */
    animation: ftFadeIn 0.7s ease 0.3s both;
}

@keyframes ftFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════
   ۳. گرید کارت‌ها (وسط‌چین)
   ───────────────────────────────────────────────────────────
   از Flexbox استفاده شده تا وقتی تعداد کارت‌ها کمتر از
   ظرفیت هر ردیف باشد، مجموعه به‌صورت خودکار وسط‌چین شود
   (مثلاً ۳ کارت در حالت ۴ ستونه).
   ═══════════════════════════════════════════════════════════ */
.ft-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;   /* وسط‌چین کردن ردیف‌ها */
    align-items: stretch;      /* هم‌ارتفاع بودن کارت‌های یک ردیف */
    gap: 22px;
}

/* عرض پایه کارت‌ها: ۴ ستون با فاصله ۲۲ پیکسل */
.ft-grid > .ft-card {
    flex: 0 0 calc(25% - 16.5px);
    max-width: calc(25% - 16.5px);
}

/* پیام «هیچ ویژگی‌ای ثبت نشده» تمام عرض را بگیرد */
.ft-grid > .ft-empty {
    flex: 1 1 100%;
    max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   ۴. کارت ویژگی
   ═══════════════════════════════════════════════════════════ */
.ft-card {
    position: relative;
    padding: 32px 22px;
    background: var(--rw-card-bg, #FFFFFF);
    border-radius: 20px;
    text-align: center;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 1px 2px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    --ft-color: var(--rw-primary, #2563EB);
    animation: ftCardIn 0.6s ease both;
    box-sizing: border-box;
}

.ft-card[data-index="0"] { animation-delay: 0.1s; }
.ft-card[data-index="1"] { animation-delay: 0.2s; }
.ft-card[data-index="2"] { animation-delay: 0.3s; }
.ft-card[data-index="3"] { animation-delay: 0.4s; }
.ft-card[data-index="4"] { animation-delay: 0.5s; }
.ft-card[data-index="5"] { animation-delay: 0.6s; }
.ft-card[data-index="6"] { animation-delay: 0.7s; }
.ft-card[data-index="7"] { animation-delay: 0.8s; }

@keyframes ftCardIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ft-card:hover {
    transform: translateY(-8px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--ft-color);
}

.ft-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle,
        var(--ft-color) 0%,
        transparent 70%);
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
    transition: all 0.5s ease;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(40px);
    z-index: 0;
}

.ft-card:hover .ft-glow {
    opacity: 0.1;
    transform: translateX(-50%) scale(1);
}

/* ═══════════════════════════════════════════════════════════
   ۵. آیکون
   ═══════════════════════════════════════════════════════════ */
.ft-icon {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 22px;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 22px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ft-icon::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: var(--ft-color);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ft-icon i {
    position: relative;
    z-index: 2;
    font-size: 36px;
    color: var(--ft-color);
    transition: all 0.4s ease;
    line-height: 1;
}

.ft-card:hover .ft-icon {
    transform: rotate(-6deg) scale(1.08);
}

.ft-card:hover .ft-icon::before {
    opacity: 1;
}

.ft-card:hover .ft-icon i {
    color: #fff;
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════
   ۶. متن‌ها
   ═══════════════════════════════════════════════════════════ */
.ft-card-title {
    position: relative;
    z-index: 2;
    font-family: 'Lalezar-ExtraBold', sans-serif;
    font-size: 19px;
    font-weight: 800;
    color: var(--rw-heading, #1E3A8A);
    margin: 0 0 10px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.ft-card:hover .ft-card-title {
    color: var(--ft-color);
}

.ft-desc {
    position: relative;
    z-index: 2;
    font-family: 'Shabnam-Bold-P', Tahoma, sans-serif;
    font-size: 13px;
    line-height: 1.9;
    color: var(--rw-muted, #6B7280);
    margin: 0;
}

.ft-empty {
    text-align: center;
    padding: 40px;
    color: var(--rw-muted, #6B7280);
    font-family: 'Shabnam-Bold-P', Tahoma, sans-serif;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════
   ۷. ریسپانسیو
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
    .ft-section { padding: 60px 18px 50px; }
    .ft-title { font-size: 34px; }
    .ft-grid { gap: 18px; }

    /* ۴ ستون با فاصله ۱۸ پیکسل */
    .ft-grid > .ft-card {
        flex: 0 0 calc(25% - 13.5px);
        max-width: calc(25% - 13.5px);
    }

    .ft-card { padding: 26px 18px; }
    .ft-icon { width: 70px; height: 70px; margin-bottom: 18px; }
    .ft-icon i { font-size: 30px; }
    .ft-card-title { font-size: 17px; }
}

@media (max-width: 900px) {
    .ft-grid { gap: 16px; }

    /* ۲ ستون با فاصله ۱۶ پیکسل */
    .ft-grid > .ft-card {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
}

@media (max-width: 600px) {
    .ft-section { padding: 45px 14px 40px; }
    .ft-header { margin-bottom: 35px; }
    .ft-title { font-size: 26px; }
    .ft-subtitle { font-size: 13px; max-width: 100%; }
    .ft-badge { font-size: 12px; padding: 6px 16px; }

    .ft-grid { gap: 12px; }

    /* ۲ ستون با فاصله ۱۲ پیکسل */
    .ft-grid > .ft-card {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }

    .ft-card { padding: 22px 14px; border-radius: 16px; }
    .ft-icon { width: 60px; height: 60px; margin-bottom: 14px; border-radius: 16px; }
    .ft-icon::before { border-radius: 16px; }
    .ft-icon i { font-size: 26px; }
    .ft-card-title { font-size: 15px; margin-bottom: 6px; }
    .ft-desc { font-size: 11px; line-height: 1.7; }
}

@media (max-width: 380px) {
    .ft-section { padding: 35px 10px 30px; }
    .ft-title { font-size: 22px; }

    .ft-grid { gap: 10px; }

    /* ۲ ستون با فاصله ۱۰ پیکسل */
    .ft-grid > .ft-card {
        flex: 0 0 calc(50% - 5px);
        max-width: calc(50% - 5px);
    }

    .ft-card { padding: 18px 10px; }
    .ft-icon { width: 52px; height: 52px; margin-bottom: 12px; }
    .ft-icon i { font-size: 22px; }
    .ft-card-title { font-size: 14px; }
    .ft-desc { font-size: 10px; }
}