/* =====================================================
 * This stylesheet intentionally does NOT redefine:
 *   .uqa-field label, .uqa-field input/textarea, .uqa-error,
 *   .uqa-char-count, .uqa-actions button, .uqa-message,
 *   .uqa-modal-header
 * Those are already styled in uqa-ask-question.css, which loads
 * alongside this file in the same modal (see footer.php — both
 * [uqa_ask_question] and [uqa_write_blog] render together).
 *
 * If uqa_write_blog is ever used standalone, WITHOUT the ask-question
 * shortcode also present on the page, uqa-ask-question.css won't load
 * and those base field styles disappear. Flagging that dependency
 * rather than hiding it — worth knowing before you reuse this shortcode
 * elsewhere.
 * ===================================================== */

.uqa-write-blog {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.uqa-required {
    color: #E63946;
}

/* =====================================================
 * BLOG CATEGORY — Select2 single select
 * ===================================================== */

.uqa-blog-category-select {
    width: 100%;
}

select.uqa-blog-category-select+.select2-container {
    width: 100%;
    font-size: 14px;
    line-height: 20px;
    color: #495057;
}

select.uqa-blog-category-select+.select2-container .select2-selection--single {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid #DEE2E6;
    background-color: #ffffff;
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

select.uqa-blog-category-select+.select2-container.select2-container--focus .select2-selection--single {
    border-color: #2745D7;
    outline: none;
}

select.uqa-blog-category-select+.select2-container.select2-container--open .select2-selection--single {
    border-radius: 8px 8px 0 0;
    border-color: #2745D7;
}

select.uqa-blog-category-select+.select2-container .select2-selection__rendered {
    padding: 0;
    line-height: 22px;
    color: #495057;
}

select.uqa-blog-category-select+.select2-container .select2-selection__placeholder {
    color: #ADB5BD;
}

select.uqa-blog-category-select+.select2-container .select2-selection__arrow {
    height: 40px;
    right: 10px;
}

select.uqa-blog-category-select+.select2-container.select2-container--open .select2-selection__arrow b {
    border-color: transparent transparent #2745D7 transparent;
    border-width: 0 4px 5px 4px;
}

.select2-results__option .uqa-select2-parent-cat {
    color: #F72585 !important;
    font-weight: 600 !important;
    font-size: 14px;
}

.select2-results__option .uqa-select2-sub-cat {
    color: #333333;
    font-size: 14px;
}

.select2-results__option--highlighted .uqa-select2-parent-cat,
.select2-results__option--highlighted .uqa-select2-sub-cat {
    color: #ffffff !important;
}

/* Select2 Search Field & Dropdown Pink Border */
.select2-container--open .select2-dropdown {
    /* border-color: #F72585 !important; */
    /* border-color: #2745D7 !important; */
    border-radius: 0 0 8px 8px;
}

.select2-container--open .select2-search--dropdown {
    padding: 8px 10px !important;
}

.select2-container--open .select2-search--dropdown .select2-search__field {
    border: 1px solid #2745D7 !important;
    border-radius: 6px !important;
    outline: none !important;
}

.select2-container--open .select2-search--dropdown .select2-search__field:focus {
    border-color: #2745D7 !important;
    box-shadow: 0 0 0 2px rgba(37, 69, 247, 0.15) !important;
}

/* =====================================================
 * IMAGE DROPZONE
 * ===================================================== */

.uqa-dropzone {
    position: relative;
    border: 1px dashed #DEE2E6;
    border-radius: 8px;
    background: #F8F9FA;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.uqa-dropzone:hover,
.uqa-dropzone.uqa-dragover {
    border-color: #2745D7;
    background: #f5f8ff;
}

.uqa-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    text-align: center;
}

.uqa-upload-icon {
    font-size: 20px;
    color: #ADB5BD;
    line-height: 1;
}

.uqa-dropzone-inner p {
    font-size: 14px;
    color: #495057;
    margin: 0;
}

.uqa-upload-link {
    color: #2745D7;
    font-weight: 600;
}

.uqa-upload-hint {
    font-size: 12px !important;
    color: #ADB5BD !important;
}

/* Selected-image preview state */
/* .uqa-image-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.uqa-image-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
} */

.uqa-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #495057;
    flex: 1;
}

.uqa-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.uqa-image-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    padding: 4px 8px;
}

.uqa-image-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(33, 37, 41, 0.65);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uqa-image-remove:hover {
    background: rgba(33, 37, 41, 0.85);
}

/* =====================================================
 * DESCRIPTION — TinyMCE (wp.editor.initialize) polish
 * WP's default editor chrome is heavier than the rest of this
 * form; this just brings the border/radius/font in line with
 * everything else without fully reskinning TinyMCE.
 * ===================================================== */

.uqa-field .wp-editor-wrap {
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.uqa-field .wp-editor-wrap:focus-within {
    border-color: #2745D7;
}

.uqa-field .wp-editor-container {
    border: none !important;
}

.uqa-field .mce-toolbar-grp {
    background: #fff !important;
    border-bottom: 1px solid #F1F3F5 !important;
    padding: 6px 12px !important;
}

.uqa-field .mce-top-part::before {
    display: none !important;
}

.uqa-field .mce-btn {
    background: transparent !important;
    border: none !important;
}

.uqa-field .mce-btn button {
    padding: 4px 8px !important;
}

.uqa-field .mce-ico {
    font-size: 16px !important;
    color: #495057 !important;
}

.uqa-field textarea#uqa_description {
    width: 100%;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    color: #495057;
    background: #fff;
}
.uqa-title-disabled {
    cursor: default;
    pointer-events: none;
    opacity: 0.85;
}

.uqa-toggle-btn {
    cursor: pointer;
}

.uqa-toggle-btn.uqa-expanded .uqa-toggle-arrow {
    transform: rotate(270deg);
    transition: transform 0.2s ease;
}

.uqa-full-content {
    margin-top: 10px;
}

/* Ensure WP Link modal dialog renders above front-end modal containers */
#wp-link-backdrop {
    z-index: 999990 !important;
}
#wp-link-wrap,
#wp-link,
.mce-wp-inline-toolbar {
    z-index: 999999 !important;
}

/* TinyMCE Editor Height & Responsiveness */
.mce-tinymce {
    width: 100% !important;
    box-sizing: border-box !important;
}
#uqa_description_ifr,
.mce-tinymce iframe {
    min-height: 280px !important;
    max-width: 100% !important;
}
@media (max-width: 768px) {
    #uqa_description_ifr,
    .mce-tinymce iframe {
        min-height: 220px !important;
    }
}