@CHARSET "ISO-8859-1";

/* ----- FAQ Magic Logo ----- */
.faqm-logo-wrap {
    text-align: center;
    margin: 12px 0 18px;
}

.faqm-logo {
    width: 48px;
    height: auto;
    opacity: 0.9;
    transition: transform 0.2s ease-in-out, opacity 0.2s;
}

.faqm-logo:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* ----- FAQ Magic Meta Box Layout ----- */
#faqm-meta-box {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Left column */
#faqm-json-create {
    flex: 0 1 700px;
    max-width: 700px;
    width: 100%;
    min-width: 0;
}

/* Right column */
#faqm-return {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease-in-out;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#faqm-return:hover {
    box-shadow: 0 4px 12px rgba(31,149,222,0.15);
}

/* Mobile / Responsive stack columns on narrow screens */
@media (max-width: 782px) {
    #faqm-meta-box {
        flex-direction: column;
    }

    #faqm-json-create,
    #faqm-return {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
    }

    #faqm-return {
        padding: 16px;
    }
}

.faqm-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ------- Make schema preview scrollable if too long ------- */
.faqm_json_ld pre {
    max-height: 500px;
    overflow-x: auto;
    overflow-y: auto;
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    white-space: pre; /* ensures horizontal scroll instead of wrapping */
    font-family: monospace;
    text-align: left;
}

/* Tabs navigation */
.faqm-tabs-nav {
    display: flex;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccd0d4;
    gap: 5px;
}

.faqm-tab-btn {
    background: #f6f7f7;
    border: 1px solid #ccd0d4;
    border-bottom: none;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #50575e;
    border-radius: 4px 4px 0 0;
    outline: none;
    transition: background 0.2s;
}

.faqm-tab-btn:not(.active):hover {
    background: #f0f0f1;
    color: #1d2327;
}

.faqm-tab-btn.active {
    background: #fff;
    color: #2271b1; /* WordPress blue */
    font-weight: 600;
    border-bottom: 1px solid #fff; /* seamless with content */
}

/* Tab content */
.faqm-tab-content {
    display: none;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 0 4px 4px 4px;
    padding: 12px;
}

.faqm-tab-content.active {
    display: block;
}

/* AI Suggest button */
.faqm-ai-btn.faqm_ai_suggest,
.faqm-ai-btn.faqm_ai_qanda {
    background: linear-gradient(180deg, #ffcd38 0%, #f9b233 100%);
    border: 1px solid #c48f00;
    color: #222 !important;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.faqm-ai-btn.faqm_ai_suggest:hover,
.faqm-ai-btn.faqm_ai_qanda:hover {
    background: linear-gradient(180deg, #ffd95c 0%, #f5a623 100%);
    border-color: #a87500;
    color: #111 !important;
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 7px rgba(0, 0, 0, 0.25);
}

.faqm-ai-btn.faqm_ai_suggest:active,
.faqm-ai-btn.faqm_ai_qanda:active {
    background: linear-gradient(180deg, #f5b400 0%, #e59d00 100%);
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.faqm-ai-btn#faqm_ai_suggest:disabled,
.faqm-ai-btn.faqm_ai_qanda:disabled {
    background: #ccc !important;
    border-color: #999 !important;
    color: #666 !important;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.faqm-ai-btn::before {
    content: "🤖 ";
}

.faqm-returned {
    /*background: #fff9c4 !important; */
    background: #ededed !important;
    transition: background 0.8s ease;
}

/* ----- Options / Settings Table Format ----- */

#faqm-main-form{
    display: block;
}

#faqm-main-form td,  #faqm-main-form th {
    padding: 14px !important;
}

tr.faqm-input-hdr {
    background: #dedede;
}

.faqm_schema_text {
    background: #f5f5f5;     /* light grey background */
    border: 1px solid #ddd;  /* subtle border */
    padding: 10px;
    max-height: 500px;       /* restrict vertical size */
    overflow: auto;          /* scrollbars if needed */
    white-space: pre-wrap;   /* wrap long lines instead of horizontal overflow */
    word-wrap: break-word;   /* break long words */
    font-family: monospace;  /* code-like font */
    font-size: 13px;
}

/* --------------- AI Security Code Refresh Icon --------------- */
#faqm_refresh_code {
    color: #46b450;               /* WP "success" green */
    text-decoration: none;
    vertical-align: middle;
    margin-left: 6px;
}

#faqm_refresh_code:hover {
    color: #2f8a32;
}

/* Remove the focus square / outline on click */
#faqm_refresh_code:focus {
    outline: none;
    box-shadow: none;
}

/* Spinning state while refreshing */
#faqm_refresh_code.faqm-refresh-loading {
    animation: faqm-spin 1s linear infinite;
    pointer-events: none;         /* prevent double-clicks while loading */
    opacity: 0.9;
}

/* Keyframes for spin */
@keyframes faqm-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* --------------- FAQ Styling --------------- */
.faqm_faq_item {
    position: relative;
    margin: 5px 0;
    padding: 6px 6px 6px 30px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s ease;
}

.faqm_faq_item:hover {
    background-color: #f5faff;
}

/* ----- Delete link inside FAQ item ----- */
.faqm_faq_item .faqm_delete_faq,
.faqm_wpg_item #faqm_delete_wpg {
    position: absolute;
    right: 8px;
    top: 8px;
    color: #ff4041;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
}

.faqm_faq_item .faqm_delete_faq:hover,
.faqm_wpg_item #faqm_delete_wpg:hover  {
    color: #b32d2e; /* brighter red */
    text-decoration: none;
}

/* ----- Drag Handle for Reordering ----- */
.faqm_drag_handle {
    position: absolute;      /* 🔹 NEW (was inline-block previously) */
    left: 6px;               /* 🔹 NEW - fixes left alignment */
    top: 10px;               /* 🔹 NEW - vertically aligns handle */
    cursor: move;
    cursor: grab;
    font-size: 16px;
    line-height: 1;
    color: #999;
    user-select: none;
    padding: 0 6px;          /* keep slight spacing */
    margin-right: 6px;       /* safe to keep, no harm */
}

.faqm_drag_handle:hover {
    color: #555;
}

/* When dragging an item */
.ui-sortable-helper {
    opacity: 0.8;
    background: #eef6ff !important;
    border-color: #9cc4ff !important;
}

/* ----- Sortable placeholder (visual gap while dragging) ----- */
.faqm_sort_placeholder {
    border: 2px dashed #8cb4ff;
    background: #eef5ff;
    height: 40px;         /* approximate height of an FAQ item */
    margin: 5px 0;
    opacity: 0.7;
}

/* ----- Wrap Q/A lines so they align under each other, not under the handle ----- */
.faqm_qa_block {
    display: block;
    margin-left: 0px;
    padding-right: 4.5em; /* responsive to font size; usually enough for [9999] + × */
}

/* Ensure Q/A labels line up cleanly */
.faqm_qa_block div {
    margin-bottom: 3px;
}

/* ----- Block for displaying the WebPage schema values ----- */
#faqm_wpg_block {
    display: block;
    margin-left: 0px;
    padding-right: 4.5em; /* responsive to font size; usually enough for [9999] + × */
    margin-bottom: 3px;
}

.faqm_wpg_item {
    position: relative;
    margin: 5px 0;
    padding: 6px 6px 6px 30px;
    background: #f9f9f9;
    border: 1px solid #ddd;
}

/* ----- Item being dragged - subtle lifted card effect while dragging ----- */
.ui-sortable-helper {
    opacity: 0.9 !important;
    background: #fffceb !important; /* pale yellow */
    border-color: #ffd86b !important;
    cursor: grabbing !important;
}


/* ----- Option Page Toggle Switch ----- */
.faqm_switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.faqm_switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.faqm_slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 30px;
    -webkit-transition: .4s;
    transition: .4s;
}

.faqm_slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked + .faqm_slider {
    background-color: #2196F3;
}

input:focus + .faqm_slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .faqm_slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* ----- Tone Preset (segmented toggle) ----- */
.faqm_tone_group{
    display:inline-flex;
    border:1px solid #ccc;
    border-radius:30px;
    overflow:hidden;
    background:#fff;
}

.faqm_tone_group input{
    position:absolute;
    opacity:0;
    width:0;
    height:0;
    pointer-events:none;
}

.faqm_tone_group label{
    padding:6px 14px;
    cursor:pointer;
    user-select:none;
    line-height:1.6;
    background:#f3f3f3;
    border-right:1px solid #ddd;
    transition: background-color .2s ease, color .2s ease;
}

.faqm_tone_group label:last-child{
    border-right:none;
}

.faqm_tone_group input:checked + label{
    background:#2196F3;
    color:#fff;
}

.faqm_tone_group input:focus + label{
    box-shadow:0 0 0 2px rgba(33,150,243,.25) inset;
}

.faqm_tone_group input[disabled] + label,
#faqm-main-form input[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ----- FAQ Status messages ----- */
.faqm_status {
    margin-bottom: 12px;
    font-size: 16px;
    min-height: 50px; /* keeps space so layout doesn't jump */
}

.faqm_status .faqm-status-success,
.faqm_status .faqm-status-error,
.faqm_status .faqm-status-warning,
.faqm_status .faqm-status-info,
.faqm_status .faqm-status-ai {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.faqm-status-success { color: green; }
.faqm-status-warning { color: #dec501; }
.faqm-status-error { color: red; }
.faqm-status-info { color: darkgrey; }
.faqm-status-ai { color: #115682; }

/* ----- AI Suggestions formatted ----- */
.faqm_ai_suggestions h5 {
    margin-top: 12px;
    color: #1F95DE;
}

.faqm_ai_suggestions ul {
    list-style: none;
    padding: 0;
}

.faqm_ai_suggestions li {
    background: #ffffff;
    border: 1px solid #d8e7f8;
    border-radius: 6px;
    padding: 10px;
    margin: 8px 0;
}

/* ----- AI Suggestions Item ----- */
/* Container styling */
.faqm_ai_item {
    position: relative;
    background: #fff;
    border: 1px solid #d8e7f8;
    border-radius: 6px;
    padding: 12px 14px 14px 14px;
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.5;
    transition: box-shadow 0.15s ease-in-out;
}

.faqm_ai_item:hover {
    box-shadow: 0 2px 6px rgba(31, 149, 222, 0.15);
}

/* Text area */
.faqm_ai_text {
    margin-right: 120px; /* leaves space for button */
}

/* ----- “Move to Review” button ----- */
.faqm_ai_item .faqm_use_faq {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    background-color: #f0f4ff;
    color: #1F95DE;
    border: 1px solid #cdddf5;
    border-radius: 5px;
    padding: 4px 10px; /* reduced height */
    font-size: 13px;   /* slightly smaller text */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    line-height: 1.3;
}

.faqm_ai_item .faqm_use_faq:hover {
    background-color: #1F95DE;
    color: #fff;
    border-color: #1F95DE;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(31, 149, 222, 0.25);
}

.faqm_ai_item .faqm_use_faq:active {
    transform: translateY(0);
    box-shadow: none;
}

/* ---------- Shared button base ---------- */
#faqm-meta-box .button {
    border-radius: 8px;
    margin: 5px 3px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
}

/* ---------- Primary action buttons ---------- */
#faqm_generate_btn,
#faqm_add_faq {
    background-color: #1f95de;
    color: #fff;
    border: none;
}
#faqm_generate_btn:hover,
#faqm_add_faq:hover {
    background-color: #177cc0;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(31, 149, 222, 0.3);
}

/* ---------- AI buttons (Suggest + Q&A) ---------- */
.faqm_ai_suggest,
.faqm_ai_qanda {
    background-color: #e8f2ff;
    color: #1f95de;
    border: 1px solid #c7e1ff;
    position: relative;
    box-shadow: 0 0 6px rgba(31, 149, 222, 0.25);
}

/* --- Hover: soft glow --- */
.faqm_ai_suggest:hover,
.faqm_ai_qanda:hover {
    background-color: #1f95de;
    color: #fff;
    border-color: #1f95de;
    box-shadow: 0 0 10px rgba(31, 149, 222, 0.45);
    transform: translateY(-1px);
}

/* --- Subtle pulsing glow on page load --- */
@keyframes faqmPulse {
    0%   { box-shadow: 0 0 0 rgba(31,149,222,0.0); }
    50%  { box-shadow: 0 0 10px rgba(31,149,222,0.4); }
    100% { box-shadow: 0 0 0 rgba(31,149,222,0.0); }
}

.faqm_ai_suggest,
.faqm_ai_qanda {
    animation: faqmPulse 2.5s ease-in-out 2;
}

/* ---------- Premium Join button ---------- */
#faqm-return .button {
    background: #2271b1;
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(31,149,222,0.25);
}

#faqm-return .faqm_cta_large {
    display: block;
    width: 90%;
    max-width: 100%;
    margin: 10px auto;
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
    box-sizing: border-box;
}

@media (max-width: 782px) {
    #faqm-return button.faqm_cta_large {
        width: 100%;
        padding: 12px 16px !important;
        font-size: 15px !important;
    }
}

#faqm-return button.faqm_cta_large:hover,
#faqm-return button.faqm_cta_large:focus {
    box-shadow: 0 3px 8px rgba(31,149,222,0.35);
    transform: scale(1.03);
}

#faqm-return button.button:hover {
    background: #187cc2 !important;
    transform: translateY(-1px);
}

.faqm_info_block > img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Advice for FAQs ---------- */
.faqm_advice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-style: italic;
    font-size: 13px;
    color: #1F95DE; /* main blue */
    background: none; /* remove background highlight */
    border: none;     /* remove border */
    margin: 10px 5px 0 0;
    padding: 0;
}

.faqm_advice::before {
    content: "i";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-style: normal;
    font-size: 12px;
    color: #1F95DE;
    border: 1px solid #1F95DE;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
}

/* ---------- FAQ Magic – Premium Upsell Styling ---------- */

#faqm-upsell {
    text-align: center;
}

#faqm-return .faqm_qandas h3, .faqm_json_ld h3 {
    color: #333;
    font-size: 22px;
    margin-bottom: 8px;
}

#faqm-return .faqm_qandas h4, .faqm_json_ld h4 {
    color: #1F95DE;
    font-size: 18px;
    margin-bottom: 8px;
}

#faqm-return .faqm_qandas p {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

#faqm-return .faqm_qandas ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#faqm-return .faqm_qandas ul li {
    font-size: 14px;
    margin: 4px 0;
}


.faqm_qandas {
    background: #fff;
    margin: 10px;
    padding: 16px 20px 30px 20px;
    border: 1px dashed #b0c8e8;
    border-radius: 8px;
}

.faqm_qandas.faqm_upsell {
    padding: 22px 24px;
    margin: 20px 0;
    border: 1px solid #efefef;
    border-radius: 11px;
}

.faqm-list {
    margin: 14px 0 18px;
    padding-left: 0;
}

ul.faqm-list {
    text-align: left;
    display: inline-block;
    margin-bottom: 18px !important;
}

.faqm-list li {
    list-style: none;
    margin-bottom: 8px;
    line-height: 1.5;
}

.faqm_qandas .button-primary {
    line-height: 2.15 !important;
    transition:
            background-color 0.3s ease,
            transform 0.3s ease,
            box-shadow 0.3s ease;
    filter: brightness(1.08); /* slightly lighter by default */
}

.faqm_qandas .button-primary:hover,
.faqm_qandas .button-primary:focus {
    filter: brightness(1); /* back to native WP colour */
    transform: scale(1.07);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

#faqm-return button.faqm_cta_large {
    font-size: 16px !important;        /* increase text size */
    padding: 12px 38px !important;     /* bigger button */
    font-weight: 600;       /* stronger emphasis */
    border-radius: 8px;     /* optional: slightly larger rounding */
}

#faqm-return button.faqm_cta_large:hover,
#faqm-return button.faqm_cta_large:focus {
    box-shadow: 0 3px 8px rgba(31,149,222,0.35);
    transform: scale(1.03);
}

.faqm_faq_count {
    position: absolute;
    right: 28px;
    top: 8px;
    font-weight: 600;
    opacity: .8;
    white-space: nowrap;
}

.faqm-meta-footnote {
    margin-top:12px;
    color:#aaa !important;
    font-size:10px !important;
    font-style: italic
}

/* ---------- FAQ Magic – Premium upsell counter ---------- */
.faqm-credit-banner p {
    text-align: center;
    color: #2271b1 !important;
    font-size: 16px !important;
    font-weight: 600;
    margin-bottom: 10px;
}

.faqm-credit-sub {
    font-size: 16px;
    font-weight: 400;
    font-style: italic;
    margin-top: 5px;
}

/* Zero credits state (conversion highlight) */
.faqm-credit-banner.faqm-credit-empty {
    background: #f0f6fc;
    border: 1px solid #2271b1;
    border-radius: 6px;
    padding: 12px;
}

/* Stronger message */
.faqm-credit-banner.faqm-credit-empty .faqm-credit-main {
    color: #b32d2e; /* subtle WP red */
    font-size: 16px;
    font-weight: 700;
}

/* Sub message */
.faqm-credit-banner.faqm-credit-empty .faqm-credit-sub {
    color: #2271b1;
    font-size: 13px;
    margin-top: 4px;
}