/* =======================================================================
   Démo IA – atelier guidé étape par étape
   ======================================================================= */

.demo-wrapper {
    margin-top: 1rem;
}

.demo-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.demo-intro {
    margin-bottom: 0.8rem;
}

.demo-shell {
    margin-top: 0.6rem;
    padding: 1rem 1.1rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

.demo-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Barre d'étapes */
.demo-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.45rem;
}

.demo-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.45rem 0.35rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.7);
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: transform 0.08s ease-out, border-color 0.1s ease-out,
        box-shadow 0.1s ease-out, color 0.1s ease-out;
}

.demo-step:hover {
    border-color: rgba(56, 189, 248, 0.6);
    color: var(--text-main);
}

.demo-step.is-active {
    border-color: rgba(56, 189, 248, 0.85);
    color: var(--text-main);
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.25);
}

.demo-step.is-complete {
    border-color: rgba(56, 189, 248, 0.5);
    color: var(--text-main);
}

.demo-step-number {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.8rem;
}

.demo-step-label {
    text-align: center;
}

/* Contenu principal */
.demo-content {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.demo-questions {
    display: grid;
    gap: 0.8rem;
}

.demo-question {
    display: none;
}

.demo-question.is-active {
    display: block;
}

.demo-question-title {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
}

/* Datasets */
.demo-theme {
    margin-top: 0.6rem;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.72);
}

.demo-theme-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.demo-theme-desc {
    margin: 0.2rem 0 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.demo-options {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.demo-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(2, 6, 23, 0.76);
    cursor: pointer;
    transition: transform 0.08s ease-out, border-color 0.1s ease-out,
        box-shadow 0.1s ease-out;
}

.demo-option:hover {
    border-color: rgba(56, 189, 248, 0.6);
}

.demo-option.is-selected {
    border-color: rgba(56, 189, 248, 0.8);
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.18);
}

.demo-option input {
    margin-top: 0.2rem;
    accent-color: var(--accent-strong);
}

.demo-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.demo-option-actions {
    margin-top: 0.15rem;
    font-size: 0.78rem;
}

.demo-download-link {
    color: var(--accent);
}

.demo-download-link:hover {
    color: var(--accent-strong);
}

.demo-download-hint {
    margin: 0.35rem 0 0.25rem;
    color: var(--text-muted);
}

.demo-option-title {
    font-size: 0.88rem;
    color: var(--text-main);
}

.demo-option-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.demo-hint {
    margin-top: 0.6rem;
}

/* Sliders */
.demo-slider {
    margin-top: 0.6rem;
    margin-bottom: 0.4rem;
}

.demo-slider label {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
}

.demo-slider input[type="range"] {
    width: 100%;
}

.demo-slider-value {
    font-size: 0.86rem;
    margin-top: 0.15rem;
}

/* Colonne de droite */
.demo-side {
    display: grid;
    gap: 0.8rem;
}

.demo-response-card,
.demo-profile-card {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.9);
    padding: 0.7rem 0.8rem;
}

.demo-response-title {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.demo-response-text {
    font-size: 0.88rem;
    white-space: pre-line;
}

.demo-shell.demo-chat-mode .demo-response-card {
    display: none;
}

.demo-profile {
    display: grid;
    gap: 0.6rem;
}

.demo-profile-list {
    display: grid;
    gap: 0.35rem;
}

.demo-profile-item {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    font-size: 0.82rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
}

.demo-profile-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.demo-profile-item span {
    color: var(--text-muted);
}

.demo-meters {
    display: grid;
    gap: 0.5rem;
}

.demo-meter {
    display: grid;
    gap: 0.25rem;
}

.demo-meter-label {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.demo-meter-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.demo-meter-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-strong), #6366f1);
    width: 0;
}

.demo-meter--bias .demo-meter-fill {
    background: linear-gradient(90deg, #f97316, #f59e0b);
}

.demo-meter--energy .demo-meter-fill {
    background: linear-gradient(90deg, #ef4444, #f97316);
}

/* Actions */
.demo-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.demo-actions .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.demo-step-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Chat de test */
.demo-chat {
    display: grid;
    gap: 0.8rem;
}

.demo-suggestions {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(2, 6, 23, 0.78);
    padding: 0.7rem 0.8rem;
}

.demo-suggestions-title {
    margin: 0 0 0.35rem;
    color: var(--text-muted);
}

.demo-suggestions-list {
    display: grid;
    gap: 0.4rem;
}

.demo-suggestion-btn {
    text-align: left;
    width: 100%;
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(14, 165, 233, 0.08);
    color: var(--text-main);
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.1s ease-out, box-shadow 0.1s ease-out;
}

.demo-suggestion-btn:hover {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
}

.demo-chat-log {
    min-height: 220px;
    max-height: 360px;
    overflow: auto;
    padding: 0.7rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(2, 6, 23, 0.78);
}

.demo-chat-message {
    display: flex;
    margin-bottom: 0.6rem;
}

.demo-chat-message--user {
    justify-content: flex-end;
}

.demo-chat-message--assistant {
    justify-content: flex-start;
}

.demo-chat-bubble {
    max-width: 85%;
    padding: 0.6rem 0.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.demo-chat-message--user .demo-chat-bubble {
    background: rgba(56, 189, 248, 0.22);
    border-color: rgba(56, 189, 248, 0.65);
}

.demo-chat-controls {
    display: grid;
    gap: 0.35rem;
}

.demo-chat-controls label {
    font-size: 0.85rem;
    color: var(--text-main);
}

.demo-chat-controls textarea {
    width: 100%;
    min-height: 90px;
    resize: vertical;
    padding: 0.55rem 0.6rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.85);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
}

.demo-chat-controls textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.8);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.demo-chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.demo-chat-buttons {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.demo-chat-status {
    min-height: 1.2rem;
}

.btn.btn-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

/* Responsive */
@media (max-width: 980px) {
    .demo-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .demo-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .demo-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
