/* ==========================================================================
   1. DASHBOARD / SETTINGS PAGE STYLES
   ========================================================================== */
.webheads-module-intro.ai-faq-intro {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ai-faq-intro h1 {
    margin: 0 0 10px 0;
    font-size: 22px;
}

.ai-badge {
    background: linear-gradient(45deg, var(--webheads-element-background-color), var(--webheads-color-primary));
    color: white !important;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 10px;
    display: inline-block;
}

.ai-faq-intro p {
    font-size: 15px;
    color: #50575e;
    line-height: 1.5;
}

.ai-faq-intro strong {
    color: var(--webheads-color-primary);
}

.intro-badges {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.intro-badges .badge {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: #2c3338;
    background: #f0f0f1;
    padding: 4px 10px;
    border-radius: 15px;
}

.intro-badges .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: var(--webheads-color-primary);
}

.post-type-selection-intro { margin-bottom: 20px; }

.post-type-selection-intro h3 {
    margin: 0 0 8px 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    color: white;
}

.post-type-selection-intro h3 .dashicons {
    font-size: 24px;
    height: 24px;
    margin-right: 10px;
    color: var(--webheads-color-primary);
}

.post-type-selection-intro p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: white;
}

.post-type-selection-intro strong {
    color: var(--webheads-color-primary);
}

.post-type-selection fieldset { width: fit-content; }

.faq-selection label { color: white; cursor: pointer; }
.ai-faq-settings h1 { padding: 0; margin-bottom: 20px; font-weight: bold; }
.faq-selection h2 { color: var(--webheads-color-primary); margin-top: 0; }

.faq-selection input[type=checkbox]:checked::before, .ai-faq-meta-switch-container input[type=checkbox]:checked::before {
    content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23d63638%27%2F%3E%3C%2Fsvg%3E");
}

.faq-selection input:focus, .faq-selection textarea:focus, .ai-faq-meta-switch-container input:focus {
    border-color: #d63638;
    box-shadow: 0 0 0 1px #d63638;
}

.post-types { display: block; margin-bottom: 5px; }
.post-type-selection { background: var(--webheads-background-color); padding: 20px; border-radius: 8px; }

input[type=checkbox]:checked { background: white !important; border-color: white !important; }

/* ==========================================================================
   2. META BOX UI (Post Editor)
   ========================================================================== */
#ai-faq-panel { margin-top: 10px; }
#ai-faq-panel h3 { margin: 20px 0 10px 0; font-size: 1.1em; }

/* Meta Box Toggle Container */
.ai-faq-meta-switch-container {
    background: #f6f7f7;
    padding: 12px;
    border-left: 4px solid #2271b1;
    margin-bottom: 15px;
    border-radius: 0 4px 4px 0;
}

.ai-faq-meta-switch-container label {
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #2c3338;
}

.ai-faq-meta-switch-container input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 0;
}

/* Combined Textarea & Input Styles */
#ai-faq-panel input[type="text"], 
#ai-faq-panel textarea { 
    width: 100%; 
    font-family: monospace; 
    margin: 0 0 10px 0;
    padding: 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    display: block;
    box-sizing: border-box; /* Crucial for width calculation */
}

/* Button Grouping */
.ai-faq-button-group {
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#ai-faq-remove-button { background-color: #d63638; border-color: #c92c2e; color: #fff; }
#ai-faq-remove-button:hover { background-color: #b32d2e; border-color: #b32d2e; color: #fff; }

#ai-faq-loading-indicator { display: none; align-items: center; color: #646970; margin-left: 10px; }
#ai-faq-loading-indicator .spinner { float: none; margin: 0 5px 0 0; visibility: visible; }
#ai-faq-status-icon { display: none; margin-left: 10px; font-size: 1.5em; vertical-align: middle; }

.ai-faq-button-group .button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* ==========================================================================
   3. SKELETON LOADER ANIMATION (Fixed-Box Version)
   ========================================================================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

#ai-faq-content-wrapper {
    position: relative;
    width: 100%;
    min-height: 185px;
    overflow: hidden; /* Strict containment */
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background-color: #f6f7f8; /* Base color to prevent flashing */
}

.skeleton-box {
    display: none;
    width: 100%;
    height: 185px;
    border: none; /* Border is now handled by the wrapper */
    
    /* The Fix: Gradient is twice the width, centered vertically */
    background: linear-gradient(
        90deg, 
        rgba(246, 247, 248, 0) 0%, 
        rgba(237, 238, 241, 1) 50%, 
        rgba(246, 247, 248, 0) 100%
    );
    background-color: #f6f7f8;
    background-repeat: no-repeat;
    background-size: 200% 100%; 
    animation: shimmer 1.5s infinite linear;
}

/* Logic for "is-loading" state */
.is-loading #ai-faq-content-wrapper textarea { 
    display: none; 
}

.is-loading #ai-faq-content-wrapper .skeleton-box { 
    display: block; 
}

/* ==========================================================================
   4. TABLES
   ========================================================================== */
.wp-list-table.widefat.fixed.striped {
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    overflow: hidden;
}

.wp-list-table thead {
    background: var(--webheads-element-background-color) !important;
}

.wp-list-table thead th {
    color: white !important;
    font-weight: 600 !important;
    padding: 12px 10px !important;
}

.wp-list-table td {
    vertical-align: middle !important;
    padding: 10px !important;
}

/* Post Type Badge inside Archive Table */
.post-type-badge {
    background: #e5e5e5;
    color: #2c3338;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    text-transform: capitalize;
}

/* Archive Inline Checkbox & Status Indicator Labels */
.status-text {
    font-size: 11px;
    margin-left: 5px;
    font-weight: 600;
}

.status-text.is-live {
    color: #46b450;
}

.status-text.is-hidden {
    color: #999999;
}

/* Status Badges for Bulk Table */
.faq-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}

.faq-status-badge.processing {
    background: #f0f0f1;
    color: #646970;
    border-color: #dcdcde;
}

.faq-status-badge.success {
    background: #f0f6f0;
    color: #2e7d32;
    border-color: #2e7d32;
}

.faq-status-badge.error {
    background: #fcf0f1;
    color: #d63638;
    border-color: #d63638;
}

.webheads-button { background: var(--webheads-color-primary) !important; color: white !important; border: none !important; border-radius: 4px !important; line-height: 3.1 !important; }
.webheads-button:hover { background: #d63638de !important; }
.webheads-button span { padding-top: 3px; vertical-align: sub !important; }
.button-link-delete { border-color: var(--webheads-color-primary) !important; color: var(--webheads-color-primary); border-radius: 4px; }
.button-link-delete:hover { background: #ff000408 !important; }

#webheads-faq-archive-tbody .button { border: 1px solid #c3c4c7; background: white; color: #2c3338; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);  }
#webheads-faq-archive-tbody .button:hover { box-shadow: 0 2px 4px rgb(0 0 0 / 15%); }

/* ==========================================================================
   5. BULK PROGRESS BAR (Broken Link Checker Style)
   ========================================================================== */
#bulk-faq-progress-container {
    margin: 25px 0;
    padding: 15px;
    background: #f6f7f8;
    border-radius: 8px;
    border: 1px solid #dcdcde;
}

.progress-bar-bg {
    background: #e2e4e7 !important;
    height: 12px !important; /* Slightly slimmer, more modern */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

#bulk-faq-progress-fill {
    /* The Red Webheads Gradient */
    background: linear-gradient(90deg, #d63638 0%, #ff4d4d 100%) !important;
    height: 100%;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 0 10px rgba(214, 54, 56, 0.4);
}

/* Optional: Add the animated stripes used in high-performance scanners */
#bulk-faq-progress-fill::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background-image: linear-gradient(
        -45deg, 
        rgba(255, 255, 255, .2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, .2) 50%, 
        rgba(255, 255, 255, .2) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 40px 40px;
    z-index: 1;
    animation: move-stripes 2s linear infinite;
}

@keyframes move-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}

#bulk-faq-status {
    font-weight: 600;
    color: #2c3338;
    font-size: 13px;
    display: flex;
    gap: 15px;
    align-items: center;
}

#bulk-faq-status span {
    font-family: monospace;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ==========================================================================
   6. FRONT-END ACCORDION STYLES
   ========================================================================== */
.webheads-faq-accordion-wrapper {
    margin-block: 60px;
}

.webheads-faq-accordion-title {
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 25px;
}

.webheads-faq-item {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 1. Summary styling & Browser-markers uitschakelen */
.webheads-faq-question {
    color: #333;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    padding: 15px 20px;
    list-style: none !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    box-sizing: border-box;
}

.webheads-faq-question::-webkit-details-marker,
.webheads-faq-question::marker {
    display: none !important;
    content: "" !important;
}

/* 2. Het icoon-frame binnen de balk verankeren */
.webheads-faq-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 15px;
    flex-shrink: 0;
}

/* 3. Het enkele CSS-pijltje (volgt de tekstkleur) */
.webheads-faq-icon::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
}

/* 4. Vloeiende rotatie bij openen (enkel op de ::after gedefinieerd) */
.webheads-faq-item.is-open .webheads-faq-icon::after,
.webheads-faq-item[open] .webheads-faq-icon::after {
    transform: rotate(225deg);
}

/* 5. Wrapper voor vloeiende hoogte-animatie met Grid */
.webheads-faq-answer-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.webheads-faq-item.is-open .webheads-faq-answer-wrapper {
    grid-template-rows: 1fr;
}

.webheads-faq-answer-inner {
    overflow: hidden;
}

.webheads-faq-answer {
    padding: 0 20px 15px 20px;
    border-top: 1px solid #eee;
    margin-top: 5px;
    padding-top: 15px;
}

.webheads-faq-answer p {
    margin: 0;
}

/* ==========================================================================
   7. WEBHEADS PREMIUM TOGGLE SWITCH STYLES (PIXEL PERFECT)
   ========================================================================== */

/* Uitlijning van kolommen/cellen in het archief */
.webheads-th-center,
.webheads-td-center {
    text-align: start;
    width: 15%;
}

/* Flexibele container voor switch + status tekst */
.webheads-toggle-container {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    user-select: none;
}

/* De basisgrootte van de switch component */
.webheads-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Volledig resetten en onzichtbaar maken van de native checkbox (voorkomt browser-glitches) */
.webheads-switch input {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Voorkom focus- outlines of blauwe highlights bij actieve klik op mobiel/desktop */
.webheads-switch input:focus,
.webheads-switch input:active,
.webheads-switch input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* De slider achtergrond (Inactieve status: strak donkergrijs/antraciet met subtiele border) */
.webheads-switch .webheads-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2c3338;
    border: 1px solid #2c3338;
    border-radius: 22px;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Het bewegende schijfje (Zwevend effect door subtiele box-shadow) */
.webheads-switch .webheads-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Actieve status (Premium WordPress Blauwe kleur zonder rand) */
.webheads-switch input:checked + .webheads-slider {
    background-color: var(--webheads-color-primary, #d63638) !important;
    border-color: var(--webheads-color-primary, #d63638) !important;
}

/* Verschuiving van het schijfje bij actieve status (Pixel-perfect gecentreerd) */
.webheads-switch input:checked + .webheads-slider:before {
    transform: translateX(20px);
}

/* Statuslabels onder de switch (Clean & minimalistisch) */
.status-text {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    transition: color 0.2s ease;
}
.status-text.is-live {
    font-weight: bold;
    color: var(--webheads-color-primary, #d63638); 
}
.status-text.is-hidden {
    font-weight: bold;
    color: black;
}

/* Meta Box specifieke layout elementen */
.ai-faq-meta-switch-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #dcdcde;
}
.ai-faq-meta-switch-container .switch-label-text {
    font-weight: 500;
    font-size: 13px;
    color: #1d2327;
    user-select: none;
}