/* ==========================================================================
   GAP Product Updates & FAQ - Full Stylesheet
   ========================================================================== */

/* کانتینر اصلی بخش‌ها */
.gap-puf-section {
    margin: 28px 0;
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.gap-puf-section-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2937;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 12px;
}

.gap-puf-section-title .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #4f46e5;
}

/* --------------------------------------------------------------------------
   ساختار آکاردئون مشترک (سوالات + آپدیت‌ها)
   -------------------------------------------------------------------------- */
.gap-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gap-accordion-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.gap-accordion-item:hover {
    border-color: #cbd5e1;
}

.gap-accordion-item[open] {
    background: #ffffff;
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.05);
}

.gap-accordion-header {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    user-select: none;
}

.gap-accordion-header::-webkit-details-marker {
    display: none;
}

.gap-accordion-question {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: #1f2937;
    line-height: 1.6;
}

/* آیکون باز/بسته شدن آکاردئون */
.gap-accordion-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    position: relative;
    border-radius: 50%;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.gap-accordion-icon::before,
.gap-accordion-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #4f46e5;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
}

.gap-accordion-icon::before {
    width: 10px;
    height: 2px;
}

.gap-accordion-icon::after {
    width: 2px;
    height: 10px;
}

.gap-accordion-item[open] .gap-accordion-icon {
    background: #4f46e5;
    border-color: #4f46e5;
}

.gap-accordion-item[open] .gap-accordion-icon::before {
    background: #ffffff;
}

.gap-accordion-item[open] .gap-accordion-icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

.gap-accordion-content {
    padding: 14px 18px 18px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.85;
    border-top: 1px dashed #e5e7eb;
    background: #ffffff;
}

.gap-accordion-content p:first-child { margin-top: 0; }
.gap-accordion-content p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   استایل اختصاصی آکاردئون آپدیت‌ها
   -------------------------------------------------------------------------- */
.gap-update-header {
    padding: 12px 16px;
}

.gap-update-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    flex: 1;
}

.gap-update-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* نشان‌ها (Badges) */
.gap-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.gap-badge-latest {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.gap-badge-version {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    direction: ltr;
    unicode-bidi: embed;
}

.gap-badge-date {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    font-weight: 500;
}

.gap-badge-date .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    color: #6b7280;
}

.gap-update-content {
    background: #fafafa;
}

/* --------------------------------------------------------------------------
   بخش سوالات متداول (FAQ Blocks)
   -------------------------------------------------------------------------- */
.gap-faq-block {
    margin-top: 20px;
}

.gap-faq-block-title {
    font-size: 15px;
    margin: 0 0 12px;
    color: #374151;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   استایل پنل مدیریت (Metabox Repeaters)
   -------------------------------------------------------------------------- */
.gap-repeater-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    background: #f9fafb;
}

.field-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.field-row input,
.field-row textarea,
#gap_faq_products {
    width: 100%;
    box-sizing: border-box;
    border-radius: 6px;
}

.field-row input {
    flex: 1;
    min-width: 160px;
}

.remove-row-btn {
    margin-top: 10px !important;
    background: #fee2e2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
    border-radius: 6px !important;
    cursor: pointer;
}

.remove-row-btn:hover {
    background: #fca5a5 !important;
}

.add-update-btn,
.add-faq-btn {
    margin-top: 8px !important;
    border-radius: 6px !important;
}

/* --------------------------------------------------------------------------
   واکنش‌گرایی (Responsive Design)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .gap-puf-section {
        padding: 16px;
        border-radius: 12px;
    }

    .gap-update-meta {
        gap: 6px;
    }

    .gap-update-title {
        width: 100%;
        margin-top: 4px;
    }

    .gap-accordion-header {
        padding: 12px 14px;
    }

    .gap-accordion-content {
        padding: 12px 14px 14px;
    }
}
