/**
 * Atelier Coach Pro - Blocs CSS (Frontend + Éditeur)
 */

/* Variables par défaut */
.acp-block {
    --acp-brand: #f59e0b;
    --acp-brand-dark: color-mix(in srgb, var(--acp-brand), #000 20%);
    --acp-brand-light: color-mix(in srgb, var(--acp-brand), #fff 85%);
}

/* ──────────────────────────────────────────
   BLOC: Introduction
   ────────────────────────────────────────── */
.acp-block-intro {
    background: linear-gradient(135deg, 
        color-mix(in srgb, var(--acp-brand), transparent 85%), 
        color-mix(in srgb, var(--acp-brand), transparent 92%)
    );
    border: 1px solid color-mix(in srgb, var(--acp-brand), transparent 60%);
    border-radius: 16px;
    padding: 24px 28px;
    margin: 24px 0;
    font-size: 17px;
    line-height: 1.7;
}

.acp-block-intro p {
    margin: 0;
}

/* ──────────────────────────────────────────
   BLOC: Section
   ────────────────────────────────────────── */
.acp-block-section {
    margin: 28px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--acp-brand);
    background: #f8fafc;
    border-radius: 0 12px 12px 0;
}

.acp-block-section .acp-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
}

.acp-block-section .acp-section-num {
    display: inline-flex;
    width: 32px;
    height: 32px;
    background: color-mix(in srgb, var(--acp-brand), transparent 80%);
    color: var(--acp-brand);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.acp-block-section .acp-section-content {
    padding-left: 44px;
    color: #475569;
    line-height: 1.8;
}

.acp-block-section .acp-section-content p {
    margin-bottom: 1em;
}

.acp-block-section .acp-section-content p:last-child {
    margin-bottom: 0;
}

/* ──────────────────────────────────────────
   BLOC: Points Clés
   ────────────────────────────────────────── */
.acp-block-keypoints {
    background: #0f172a;
    border-radius: 16px;
    padding: 24px 28px;
    margin: 24px 0;
    color: #e2e8f0;
}

.acp-block-keypoints .acp-kp-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.acp-block-keypoints .acp-kp-icon {
    width: 36px;
    height: 36px;
    background: var(--acp-brand);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.acp-block-keypoints .acp-kp-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.acp-block-keypoints .acp-kp-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.acp-block-keypoints .acp-kp-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}

.acp-block-keypoints .acp-kp-bullet {
    flex-shrink: 0;
}

/* ──────────────────────────────────────────
   BLOC: Exercice
   ────────────────────────────────────────── */
.acp-block-exercise {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 16px;
    padding: 24px 28px;
    margin: 24px 0;
}

.acp-block-exercise .acp-ex-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.acp-block-exercise .acp-ex-icon {
    width: 36px;
    height: 36px;
    background: #10b981;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.acp-block-exercise .acp-ex-title {
    font-size: 18px;
    font-weight: 700;
    color: #065f46;
}

.acp-block-exercise .acp-ex-desc {
    color: #065f46;
    margin-bottom: 12px;
}

.acp-block-exercise .acp-ex-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.acp-block-exercise .acp-ex-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    color: #065f46;
}

.acp-block-exercise .acp-ex-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #a7f3d0;
    color: #065f46;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* ──────────────────────────────────────────
   BLOC: Réflexion
   ────────────────────────────────────────── */
.acp-block-reflection {
    background: #faf5ff;
    border: 1px solid #d8b4fe;
    border-radius: 16px;
    padding: 24px 28px;
    margin: 24px 0;
}

.acp-block-reflection .acp-ref-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.acp-block-reflection .acp-ref-icon {
    width: 36px;
    height: 36px;
    background: #8b5cf6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.acp-block-reflection .acp-ref-title {
    font-size: 18px;
    font-weight: 700;
    color: #581c87;
}

.acp-block-reflection .acp-ref-question {
    font-style: italic;
    font-size: 17px;
    color: #581c87;
    margin: 0;
    padding: 0;
    border: none;
    line-height: 1.7;
}

/* ──────────────────────────────────────────
   BLOC: CTA Appel Découverte
   ────────────────────────────────────────── */
.acp-block-cta {
    background: linear-gradient(135deg, #fffbeb, #fff7ed);
    border: 2px solid #fcd34d;
    border-radius: 20px;
    padding: 32px;
    margin: 32px 0;
    text-align: center;
}

.acp-block-cta .acp-cta-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.acp-block-cta .acp-cta-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--acp-brand);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--acp-brand), transparent 60%);
}

.acp-block-cta .acp-cta-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--acp-brand), transparent 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    border: 3px solid var(--acp-brand);
}

.acp-block-cta .acp-cta-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--acp-brand);
    margin-top: 8px;
}

.acp-block-cta .acp-cta-name {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #1e293b;
}

.acp-block-cta .acp-cta-title {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.acp-block-cta .acp-cta-subtitle {
    font-size: 15px;
    color: #555;
    max-width: 400px;
    margin: 4px 0;
}

.acp-block-cta .acp-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--acp-brand), var(--acp-brand-dark));
    color: #fff;
    border-radius: 14px;
    font-weight: 700;
    font-size: 17px;
    text-decoration: none;
    margin-top: 12px;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--acp-brand), transparent 60%);
    transition: all .2s;
}

.acp-block-cta .acp-cta-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: #fff;
}

/* Hide in recording mode */
.acp-cta-hidden {
    display: none !important;
}

/* ──────────────────────────────────────────
   DARK MODE
   ────────────────────────────────────────── */
.acp-dark .acp-block-intro {
    background: color-mix(in srgb, var(--acp-brand), transparent 90%);
}

.acp-dark .acp-block-section {
    background: #1e293b;
}

.acp-dark .acp-block-section .acp-section-heading {
    color: #e2e8f0;
}

.acp-dark .acp-block-section .acp-section-content {
    color: #94a3b8;
}

.acp-dark .acp-block-keypoints {
    background: #020617;
}

.acp-dark .acp-block-exercise {
    background: #064e3b;
    border-color: #065f46;
}

.acp-dark .acp-block-exercise .acp-ex-title,
.acp-dark .acp-block-exercise .acp-ex-desc,
.acp-dark .acp-block-exercise .acp-ex-steps li {
    color: #a7f3d0;
}

.acp-dark .acp-block-exercise .acp-ex-num {
    background: #065f46;
    color: #a7f3d0;
}

.acp-dark .acp-block-reflection {
    background: #3b0764;
    border-color: #581c87;
}

.acp-dark .acp-block-reflection .acp-ref-title,
.acp-dark .acp-block-reflection .acp-ref-question {
    color: #d8b4fe;
}

.acp-dark .acp-block-cta {
    background: linear-gradient(135deg, #451a03, #78350f);
    border-color: #b45309;
}

.acp-dark .acp-block-cta .acp-cta-name {
    color: #fff;
}

.acp-dark .acp-block-cta .acp-cta-title,
.acp-dark .acp-block-cta .acp-cta-subtitle {
    color: #d4d4d8;
}

/* ──────────────────────────────────────────
   RESPONSIVE
   ────────────────────────────────────────── */
@media (max-width: 600px) {
    .acp-block-intro,
    .acp-block-section,
    .acp-block-keypoints,
    .acp-block-exercise,
    .acp-block-reflection,
    .acp-block-cta {
        padding: 20px;
        margin: 16px 0;
    }
    
    .acp-block-section .acp-section-content {
        padding-left: 0;
        margin-top: 12px;
    }
    
    .acp-block-cta .acp-cta-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* ──────────────────────────────────────────
   BLOC: Accordéon / FAQ
   ────────────────────────────────────────── */
.acp-block-accordion {
    margin: 24px 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border, #e2e8f0);
}

.acp-accordion-item {
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.acp-accordion-item:last-child {
    border-bottom: none;
}

.acp-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    background: var(--bg2, #fff);
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.acp-accordion-trigger:hover {
    background: var(--bg3, #f1f5f9);
}

.acp-accordion-q {
    font-size: 16px;
    font-weight: 600;
    color: var(--text, #1e293b);
    flex: 1;
    line-height: 1.5;
}

.acp-accordion-chevron {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--acp-brand-light, #fef3c7);
    color: var(--acp-brand, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background 0.15s;
}

.acp-accordion-item.acp-open .acp-accordion-chevron {
    transform: rotate(180deg);
    background: var(--acp-brand);
    color: #fff;
}

.acp-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.acp-accordion-item.acp-open .acp-accordion-panel {
    max-height: 1000px;
}

.acp-accordion-answer {
    padding: 0 24px 20px 24px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text2, #475569);
}

.acp-accordion-answer p {
    margin: 0 0 12px 0;
}

.acp-accordion-answer p:last-child {
    margin-bottom: 0;
}

/* Dark mode */
.acp-dark .acp-accordion-trigger {
    background: var(--bg2, #1e293b);
}

.acp-dark .acp-accordion-trigger:hover {
    background: var(--bg3, #334155);
}

.acp-dark .acp-accordion-chevron {
    background: color-mix(in srgb, var(--acp-brand), transparent 80%);
}

.acp-dark .acp-accordion-item.acp-open .acp-accordion-chevron {
    background: var(--acp-brand);
}

/* Éditeur */
.acp-accordion-header-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.acp-accordion-item-editor {
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.acp-accordion-item-header-editor {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.acp-accordion-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f59e0b20;
    color: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.acp-accordion-item-body-editor {
    padding: 16px;
    min-height: 60px;
}

@media (max-width: 600px) {
    .acp-accordion-trigger {
        padding: 16px 18px;
    }
    .acp-accordion-answer {
        padding: 0 18px 16px 18px;
    }
}
