/* === ساختار اصلی === */
.cf7-meta-box {
    padding: 1.5em;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 1.5em;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

/* === سوئیچ فعال‌سازی === */
.cf7-step-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #eee;
}

.cf7-step-toggle input[type="checkbox"] {
    margin: 0;
}

/* === تنظیمات مراحل === */
.step-settings {
    padding-top: 1.5em;
    animation: fadeIn 0.3s ease;
}

.cf7-section {
    margin: 1.5em 0;
    padding: 1.2em;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #2271b1;
}

/* === فیلدها و گروه‌ها === */
.cf7-field-group {
    margin: 1em 0;
    padding: 0.8em;
    background: #fff;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.cf7-field-group label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #1d2327;
}

.cf7-field-group input[type="text"],
.cf7-field-group input[type="number"],
.cf7-field-group select,
.cf7-field-group textarea {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #8c8f94;
}

.cf7-field-group textarea {
    min-height: 80px;
}

/* === بخش سوالات و تصاویر === */
.cf7-question-block,
.cf7-image-block {
    margin: 1.5em 0;
    padding: 1.2em;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.cf7-question-header,
.cf7-image-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    text-align: right;
    position: relative;
}

.cf7-question-header label,
.cf7-image-header label {
    order: 2;
    flex: 1;
}

.cf7-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #2271b1;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: help;
    transition: all 0.3s;
    position: relative;
    order: 1;
    margin-right: 4px;
}

.cf7-help-icon:hover {
    background: #135e96;
}

/* === دکمه‌ها === */
.button.add-question,
.button.add-image-field {
    margin-bottom: 1.5em;
}

.button-link-delete {
    color: #d63638;
}

.button-link-delete:hover {
    color: #ff0000;
}

/* === حالت‌های واکنش‌گرا === */
@media screen and (min-width: 783px) {
    .cf7-field-group {
        display: grid;
        grid-template-columns: 200px 1fr;
        gap: 1em;
        align-items: center;
    }
    
    .cf7-field-group label {
        margin-bottom: 0;
    }
}

/* === انیمیشن‌ها === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === توصیف‌ها === */
.description {
    font-size: 0.85em;
    color: #646970;
    margin-top: 0.5em;
    font-style: italic;
}

/*قسمت افزودن تصاویر محیط مدیریت

/* بخش جدید برای آپلود تصویر */
.cf7-image-uploader {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cf7-icon-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 3px;
    border: 1px dashed #ccc;
}

.cf7-icon-preview img {
    display: block;
    max-width: 100%;
    height: auto;
}

.upload-cf7-icon {
    align-self: flex-start;
}

.cf7-tooltip {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 100%;
    background: #34495e !important;
    color: #ffffff !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3) !important;
    z-index: 99999 !important;
    animation: tooltipFadeIn 0.3s !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    text-align: right !important;
    white-space: normal !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
}

.cf7-tooltip:before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    right: -7px !important;
    transform: translateY(-50%) !important;
    border-width: 7px !important;
    border-style: solid !important;
    border-color: transparent transparent transparent #34495e !important;
    filter: drop-shadow(3px 0 3px rgba(0,0,0,0.2)) !important;
}

.cf7-tooltip.left-side {
    left: auto !important;
    right: 0 !important;
}

.cf7-tooltip.left-side:before {
    right: auto !important;
    left: -7px !important;
    border-color: transparent #34495e transparent transparent !important;
}

@keyframes tooltipFadeIn {
    from { 
        opacity: 0 !important; 
        transform: translateY(-50%) translateX(-10px) !important;
        filter: blur(3px) !important;
    }
    to { 
        opacity: 1 !important; 
        transform: translateY(-50%) translateX(0) !important;
        filter: blur(0) !important;
    }
}

@media screen and (max-width: 480px) {
    .cf7-help-icon {
        position: relative;
    }

    .cf7-tooltip {
        position: absolute !important;
        width: 100% !important;
        right: 0 !important;
        left: auto !important;
        transform: translateY(-50%) !important;
    }

    .cf7-tooltip:before {
        right: 9px !important;
        left: auto !important;
    }

    .cf7-tooltip.left-side {
        left: auto !important;
        right: 0 !important;
        transform: translateY(-50%) !important;
    }

    .cf7-tooltip.left-side:before {
        right: auto !important;
        left: 9px !important;
    }
}