/* استایل‌های ویجت سوالات متداول PYM */

/* رپپر اصلی */
.pym-faq-wrapper {
    max-width: 100%;
    margin: 0 auto;
    direction: rtl;
    padding: 20px;
}

/* عنوان اصلی */
.pym-faq-main-title {
    text-align: right;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.pym-faq-title-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 10px;
    order: -1;
}

/* آیتم FAQ */
.pym-faq-item {
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
}

.pym-faq-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pym-faq-item.open {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* سوال */
.pym-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    background: #ffffff;
    border: none;
    transition: background-color 0.3s ease;
    user-select: none;
    position: relative;
    outline: none !important;
}

.pym-faq-question:hover {
    background: #f8f9fa;
}

.pym-faq-item.open .pym-faq-question {
    background: #ffffff;
}

.pym-faq-question-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
    margin-left: 15px;
    text-align: right;
}

/* آیکون */
.pym-faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #666;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
    flex-shrink: 0;
    transform: rotate(0deg);
    will-change: transform;
}

.pym-faq-item.open .pym-faq-icon {
    color: #2c5aa0;
}

.pym-faq-icon svg {
    width: 16px;
    height: 16px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* پاسخ */
.pym-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: #ffffff;
    padding: 0 20px;
}

.pym-faq-item.open .pym-faq-answer {
    max-height: 1000px;
    padding: 0 20px 20px 20px;
}

.pym-faq-answer-content {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    padding-top: 15px;
}

.pym-faq-answer-content p {
    margin-bottom: 15px;
}

.pym-faq-answer-content p:last-child {
    margin-bottom: 0;
}

/* خط جداکننده */
.pym-faq-separator {
    height: 1px;
    background-color: #EDEDED;
    margin: 0 20px;
    width: calc(100% - 40px);
}

/* دکمه */
.pym-faq-button {
    display: inline-block;
    background: #2c5aa0;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    float: left;
    clear: both;
}

.pym-faq-button:hover {
    background: #1e3f6b;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 90, 160, 0.3);
}

.pym-faq-button:active {
    transform: translateY(0);
}

/* انیمیشن‌های اضافی */
.pym-faq-item {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive برای تبلت */
@media (max-width: 768px) {
    .pym-faq-wrapper {
        padding: 15px;
    }
    
    .pym-faq-main-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .pym-faq-question {
        padding: 15px;
    }
    
    .pym-faq-question-text {
        font-size: 15px;
    }
    
    .pym-faq-item.open .pym-faq-answer {
        padding: 0 15px 15px 15px;
    }
    
    .pym-faq-answer-content {
        font-size: 13px;
        padding-top: 12px;
    }
    
    .pym-faq-separator {
        margin: 0 15px;
        width: calc(100% - 30px);
    }
    
    .pym-faq-button {
        padding: 10px 20px;
        font-size: 13px;
        margin-top: 15px;
    }
}

/* Responsive برای موبایل */
@media (max-width: 480px) {
    .pym-faq-wrapper {
        padding: 10px;
    }
    
    .pym-faq-main-title {
        font-size: 18px;
        margin-bottom: 15px;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .pym-faq-title-icon {
        margin-right: 0;
        order: -1;
    }
    
    .pym-faq-question {
        padding: 12px;
    }
    
    .pym-faq-question-text {
        font-size: 14px;
        margin-left: 10px;
    }
    
    .pym-faq-icon {
        width: 20px;
        height: 20px;
    }
    
    .pym-faq-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .pym-faq-item.open .pym-faq-answer {
        padding: 0 12px 12px 12px;
    }
    
    .pym-faq-answer-content {
        font-size: 12px;
        padding-top: 10px;
    }
    
    .pym-faq-separator {
        margin: 0 12px;
        width: calc(100% - 24px);
    }
    
    .pym-faq-button {
        padding: 8px 16px;
        font-size: 12px;
        margin-top: 12px;
    }
}

/* حالت تاریک (اختیاری) */
@media (prefers-color-scheme: dark) {
    .pym-faq-item {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .pym-faq-question {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .pym-faq-question:hover {
        background: #4a5568;
    }
    
    .pym-faq-item.open .pym-faq-question {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }
    
    .pym-faq-question-text {
        color: #e2e8f0;
    }
    
    .pym-faq-answer {
        background: #2d3748;
    }
    
    .pym-faq-answer-content {
        color: #cbd5e0;
    }
    
    .pym-faq-icon {
        color: #a0aec0;
    }
    
    .pym-faq-item.open .pym-faq-icon {
        color: #63b3ed;
    }
    
    .pym-faq-separator {
        background-color: #4a5568;
    }
}

/* بهبود دسترسی */
.pym-faq-question:focus {
    outline: none !important;
}

.pym-faq-button:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* کاهش حرکت برای کاربرانی که ترجیح می‌دهند */
@media (prefers-reduced-motion: reduce) {
    .pym-faq-item,
    .pym-faq-question,
    .pym-faq-answer,
    .pym-faq-icon,
    .pym-faq-button {
        transition: none;
    }
    
    .pym-faq-item {
        animation: none;
    }
}

/* بهبود عملکرد انیمیشن */
.pym-faq-answer {
    will-change: max-height, padding;
}

.pym-faq-icon {
    will-change: transform;
}

/* استایل برای حالت loading */
.pym-faq-item.loading .pym-faq-question {
    pointer-events: none;
    opacity: 0.7;
}

.pym-faq-item.loading .pym-faq-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
} 