/* ==========================================================================
   Content Builder Pro – Admin styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wizard – step indicator
   -------------------------------------------------------------------------- */
.cbp-steps {
    display: flex;
    gap: 0;
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    font-size: 13px;
    border-radius: 4px;
    overflow: hidden;
    max-width: 640px;
}

.cbp-steps li {
    flex: 1;
    padding: 8px 16px;
    background: #ddd;
    color: #555;
    text-align: center;
    position: relative;
    transition: background 0.2s;
}

.cbp-steps li.done {
    background: #2271b1;
    color: #fff;
}

.cbp-steps li.active {
    background: #72aee6;
    color: #fff;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Wizard – plan editor (step 2)
   -------------------------------------------------------------------------- */
.cbp-h2-section {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.cbp-h2-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f6f7f7;
    border-bottom: 1px solid #ddd;
}

.cbp-h2-header strong {
    min-width: 28px;
    color: #2271b1;
    font-size: 13px;
}

.cbp-h3-list {
    padding: 8px 12px 4px 32px;
}

.cbp-h3-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cbp-h3-row strong {
    min-width: 28px;
    color: #646970;
    font-size: 13px;
}

.cbp-remove-h2,
.cbp-remove-h3 {
    color: #b32d2e;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    font-size: 13px;
}

.cbp-remove-h2:hover,
.cbp-remove-h3:hover {
    color: #7a1c1c;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Wizard – step 3 structure options
   -------------------------------------------------------------------------- */
.cbp-structure-options {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 16px 20px;
    max-width: 480px;
}

.cbp-structure-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 13px;
}

.cbp-structure-options label:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Wizard – result page (step 4)
   -------------------------------------------------------------------------- */
#cbp-preview {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 24px 32px;
    max-width: 800px;
    line-height: 1.7;
    font-size: 15px;
}

#cbp-preview h2,
.cbp-section h2 {
    font-size: 1.4em;
    margin-top: 40px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
}

#cbp-preview h3,
.cbp-section h3 {
    font-size: 1.15em;
    margin-top: 1.2em;
    color: #0073aa;
}

#cbp-preview p,
.cbp-section p {
    line-height: 1.8;
    font-size: 16px;
}

#cbp-preview ul li,
.cbp-section ul li {
    position: relative;
    padding-left: 22px;
    list-style: none;
    line-height: 1.8;
    margin-bottom: 6px;
}

#cbp-preview ul li::before,
.cbp-section ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #0073aa;
    font-weight: 700;
}

#cbp-preview blockquote,
.cbp-section blockquote,
blockquote {
    border-left: 4px solid #0073aa;
    background: #f0f7ff;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    color: #333;
    font-style: italic;
    margin: 20px 0;
    position: relative;
}

#cbp-preview blockquote::before,
.cbp-section blockquote::before,
blockquote::before {
    content: '\201C';
    font-size: 3em;
    color: #0073aa;
    opacity: 0.3;
    position: absolute;
    top: -10px;
    left: 10px;
    line-height: 1;
    pointer-events: none;
}

#cbp-raw-html {
    font-family: monospace;
    font-size: 12px;
    background: #f6f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-width: 100%;
}

#cbp-copy-btn {
    min-width: 140px;
    transition: background 0.15s;
}

/* --------------------------------------------------------------------------
   Plan editor – drag & drop states
   -------------------------------------------------------------------------- */
.cbp-drag-handle {
    cursor: grab;
    color: #aaa;
    font-size: 16px;
    padding: 0 4px;
    user-select: none;
    flex-shrink: 0;
}

.cbp-drag-handle:active {
    cursor: grabbing;
}

.cbp-h2-section.cbp-dragging,
.cbp-h3-row.cbp-dragging {
    opacity: 0.4;
}

.cbp-h2-section.cbp-drag-over {
    border-top: 3px solid #2271b1;
}

.cbp-h3-row.cbp-drag-over {
    border-top: 2px solid #72aee6;
}

.cbp-h3-add-wrap {
    padding: 4px 12px 10px 32px;
}

.cbp-hn-label {
    min-width: 28px;
    font-size: 13px;
    flex-shrink: 0;
}

.cbp-hn-label:not(.cbp-h3-label) {
    color: #2271b1;
}

.cbp-h3-label {
    color: #646970;
}

/* --------------------------------------------------------------------------
   Encarts de contenu – rendus dans le front-end et la prévisualisation admin
   -------------------------------------------------------------------------- */

/* Section wrapper */
.cbp-section {
    margin-bottom: 32px;
}

/* En Bref */
.cbp-encart-bref {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
}

.cbp-encart-bref p:first-child,
.cbp-encart-bref strong:first-child {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #1a1a1a;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.cbp-encart-bref ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 0;
}

.cbp-encart-bref ul li {
    padding: 6px 0 6px 28px;
    position: relative;
    line-height: 1.5;
}

.cbp-encart-bref ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 6px;
    color: #0073aa;
    font-weight: bold;
}

.cbp-encart-bref ul li strong,
.cbp-encart-bref ul li em,
.cbp-encart-bref ul li b {
    display: inline;
    font-weight: bold;
}

/* Bonne idée */
.cbp-bonne-idee {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 8px;
}

.cbp-bonne-idee > strong:first-child::before,
.cbp-bonne-idee > p:first-child > strong:first-child::before {
    content: '✅ ';
}

/* Attention */
.cbp-attention {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 8px;
}

.cbp-attention > strong:first-child::before,
.cbp-attention > p:first-child > strong:first-child::before {
    content: '⚠️ ';
}

/* À faire */
.cbp-a-faire {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 8px;
}

.cbp-a-faire > strong:first-child::before,
.cbp-a-faire > p:first-child > strong:first-child::before {
    content: '📌 ';
}

/* Avantages / Inconvénients */
.cbp-avantages-inconvenients {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.cbp-avantages-inconvenients > div {
    padding: 14px 16px;
    border-radius: 4px;
}

.cbp-avantages-inconvenients .avantages,
.cbp-avantages-inconvenients .cbp-avantages {
    background: #e8f5e9;
    border-top: 3px solid #4caf50;
}

.cbp-avantages-inconvenients .inconvenients,
.cbp-avantages-inconvenients .cbp-inconvenients {
    background: #fce4ec;
    border-top: 3px solid #e91e63;
}

.cbp-avantages-inconvenients ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

/* FAQ */
.cbp-faq details {
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
}

.cbp-faq details:first-of-type {
    border-top: 1px solid #ddd;
}

.cbp-faq summary {
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    list-style: none;
}

.cbp-faq summary::-webkit-details-marker {
    display: none;
}

.cbp-faq summary::before {
    content: '+ ';
    color: #2271b1;
    font-weight: 700;
}

.cbp-faq details[open] summary::before {
    content: '− ';
}

.cbp-faq details p {
    margin: 8px 0 4px;
    color: #444;
}

/* Responsive – avantages/inconvénients */
@media (max-width: 600px) {
    .cbp-avantages-inconvenients {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Wizard – step 2b (Visuels)
   -------------------------------------------------------------------------- */
.cbp-image-row {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 10px;
    max-width: 700px;
}

.cbp-image-row > label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13px;
}

.cbp-img-result {
    min-height: 24px;
    margin-top: 6px;
}

.cbp-img-result img {
    display: block;
    width: 160px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
}

.cbp-img-loading {
    color: #646970;
    font-style: italic;
    font-size: 13px;
    margin: 4px 0;
}

.cbp-img-error {
    color: #b32d2e;
    font-size: 12px;
    margin: 0 0 6px;
}

.cbp-progress-bar {
    background: #e0e0e0;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 8px;
    max-width: 500px;
}

#cbp-progress-fill {
    background: #2271b1;
    height: 100%;
    width: 0;
    transition: width 0.3s ease;
}

#cbp-progress-text {
    font-size: 13px;
    color: #646970;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Internal Links Suggester
   -------------------------------------------------------------------------- */
.cbp-suggest-status {
    border-radius: 4px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
}

.cbp-suggest-info {
    background: #e7f3ff;
    border-left: 4px solid #0073aa;
    color: #1d2327;
}

.cbp-suggest-success {
    background: #d7f0db;
    border-left: 4px solid #00a32a;
    color: #1d2327;
}

.cbp-suggest-error {
    background: #fbe9e7;
    border-left: 4px solid #d63638;
    color: #1d2327;
}

#cbp-suggest-links-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
