/* ─────────────────────────────────────────────────────────
   ArsAltitude Drone IA — Styles chatbot + quiz
   Palette : Navy #1a3a6b · Orange #e86c2b · White
   ───────────────────────────────────────────────────────── */

:root {
    --aada-navy:   #1a3a6b;
    --aada-navy2:  #0f2347;
    --aada-orange: #e86c2b;
    --aada-green:  #0a7227;
    --aada-red:    #c0392b;
    --aada-grey:   #f4f6f9;
    --aada-border: #e2e8f0;
    --aada-radius: 12px;
    --aada-shadow: 0 8px 32px rgba(26,58,107,.18);
}

/* ═══════════════════════════════════════════════════════════
   CHATBOT
   ═════════════════════════════════════════════════════════ */

#aada-chatbot-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: var(--aada-navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--aada-shadow);
    z-index: 9998;
    transition: transform .2s, background .2s;
}
#aada-chatbot-toggle:hover { background: var(--aada-navy2); transform: scale(1.08); }

#aada-chatbot {
    position: fixed;
    bottom: 94px;
    right: 28px;
    width: 380px;
    max-height: 560px;
    background: #fff;
    border-radius: var(--aada-radius);
    box-shadow: var(--aada-shadow);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(.97);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#aada-chatbot.aada-open {
    opacity: 1;
    transform: none;
    pointer-events: all;
}

/* Header */
#aada-chatbot-header {
    background: var(--aada-navy);
    color: #fff;
    padding: 14px 16px;
    border-radius: var(--aada-radius) var(--aada-radius) 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.aada-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.aada-header-text { flex: 1; }
.aada-header-text strong { display: block; font-size: 14px; }
.aada-header-text span   { font-size: 11px; opacity: .75; }
#aada-chatbot-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 4px;
}
#aada-chatbot-close:hover { color: #fff; }

/* Messages */
#aada-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.aada-msg {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
}
.aada-msg-bot {
    background: var(--aada-grey);
    color: #1a202c;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.aada-msg-user {
    background: var(--aada-navy);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.aada-msg-thinking {
    background: var(--aada-grey);
    align-self: flex-start;
    padding: 12px 16px;
}
.aada-dots { display: flex; gap: 4px; }
.aada-dots span {
    width: 7px;
    height: 7px;
    background: #94a3b8;
    border-radius: 50%;
    animation: aada-bounce .8s infinite;
}
.aada-dots span:nth-child(2) { animation-delay: .15s; }
.aada-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes aada-bounce {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* Footer saisie */
#aada-chatbot-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--aada-border);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
#aada-chatbot-input {
    flex: 1;
    border: 1px solid var(--aada-border);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13.5px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color .2s;
    max-height: 100px;
}
#aada-chatbot-input:focus { border-color: var(--aada-navy); }
#aada-chatbot-send {
    width: 36px;
    height: 36px;
    background: var(--aada-orange);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s, transform .15s;
}
#aada-chatbot-send:hover   { background: #c85920; }
#aada-chatbot-send:active  { transform: scale(.92); }
#aada-chatbot-send:disabled { background: #cbd5e1; cursor: not-allowed; }

#aada-chatbot-disclaimer {
    font-size: 10.5px;
    color: #94a3b8;
    text-align: center;
    padding: 6px 12px;
    border-top: 1px solid var(--aada-border);
    background: #fafbfc;
    border-radius: 0 0 var(--aada-radius) var(--aada-radius);
}

/* ═══════════════════════════════════════════════════════════
   QUIZ ADAPTATIF
   ═════════════════════════════════════════════════════════ */

.aada-quiz-wrapper {
    background: #fff;
    border: 1px solid var(--aada-border);
    border-radius: var(--aada-radius);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 2rem 0;
}

/* Header quiz */
.aada-quiz-header {
    background: var(--aada-navy);
    color: #fff;
    padding: 18px 24px 0;
}
.aada-quiz-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.aada-quiz-badge {
    background: var(--aada-orange);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .04em;
}
.aada-quiz-title h3 { margin: 0; font-size: 16px; font-weight: 600; }
.aada-quiz-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: .8;
    margin-bottom: 10px;
}
.aada-progress-bar {
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    overflow: hidden;
}
.aada-progress-fill {
    height: 100%;
    background: var(--aada-orange);
    border-radius: 2px;
    transition: width .5s ease;
}

/* Screens communes */
.aada-quiz-screen { padding: 32px 28px; }

/* Écran démarrage */
.aada-quiz-start-content { text-align: center; }
.aada-quiz-icon { font-size: 52px; margin-bottom: 12px; }
.aada-quiz-start-content h4 { font-size: 18px; margin: 0 0 10px; color: var(--aada-navy); }
.aada-quiz-start-content p  { color: #64748b; font-size: 14px; margin-bottom: 16px; }
.aada-quiz-rules {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    text-align: left;
    display: inline-block;
}
.aada-quiz-rules li { font-size: 13.5px; color: #475569; padding: 5px 0; }

/* Boutons */
.aada-btn-primary {
    background: var(--aada-navy);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s;
    display: inline-block;
    margin-top: 12px;
}
.aada-btn-primary:hover   { background: var(--aada-navy2); }
.aada-btn-primary:active  { transform: scale(.97); }
.aada-btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.aada-btn-secondary {
    background: var(--aada-grey);
    color: var(--aada-navy);
    border: 1px solid var(--aada-border);
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}
.aada-btn-secondary:hover { background: #e8edf4; }

/* Loading */
.aada-screen-loading { text-align: center; padding: 60px 28px; }
.aada-loading-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.aada-loading-dots span {
    width: 10px; height: 10px;
    background: var(--aada-navy);
    border-radius: 50%;
    animation: aada-bounce .7s infinite;
}
.aada-loading-dots span:nth-child(2) { animation-delay: .15s; }
.aada-loading-dots span:nth-child(3) { animation-delay: .3s; }
.aada-loading-text { color: #64748b; font-size: 14px; }

/* Question */
.aada-question-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.5;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--aada-grey);
    border-radius: 8px;
    border-left: 4px solid var(--aada-navy);
}
.aada-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.aada-option {
    padding: 13px 16px;
    border: 1.5px solid var(--aada-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: border-color .15s, background .15s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.aada-option:hover { border-color: var(--aada-navy); background: #f0f4ff; }
.aada-option.selected { border-color: var(--aada-navy); background: #ebf0ff; font-weight: 500; }
.aada-option.correct  { border-color: var(--aada-green); background: #f0fff4; color: var(--aada-green); }
.aada-option.wrong    { border-color: var(--aada-red); background: #fff5f5; color: var(--aada-red); }
.aada-option-letter {
    width: 26px; height: 26px;
    background: var(--aada-grey);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
    color: var(--aada-navy);
}

/* Explication */
.aada-result-badge {
    text-align: center;
    font-size: 40px;
    margin-bottom: 16px;
}
.aada-explication-box {
    background: var(--aada-grey);
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 12px;
}
.aada-reference-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 16px;
}
.aada-score-live {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin: 12px 0;
}
#aada-next-btn { width: 100%; }
.aada-validate-btn { width: 100%; }

/* Bilan final */
.aada-bilan-score { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.aada-score-circle {
    width: 100px; height: 100px;
    border-radius: 50%;
    background: var(--aada-navy);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}
.aada-score-pct   { color: #fff; font-size: 26px; font-weight: 700; }
.aada-score-label { color: rgba(255,255,255,.7); font-size: 11px; }
.aada-bilan-verdict h4 { margin: 0 0 6px; font-size: 17px; color: var(--aada-navy); }
.aada-bilan-verdict p  { margin: 0; font-size: 13.5px; color: #64748b; }
.aada-bilan-ia {
    background: var(--aada-grey);
    border-radius: 8px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 16px;
}
.aada-bilan-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }

/* Responsive */
@media (max-width: 480px) {
    #aada-chatbot { width: calc(100vw - 20px); right: 10px; bottom: 80px; }
    #aada-chatbot-toggle { right: 16px; bottom: 20px; }
    .aada-quiz-wrapper { margin: 1rem 0; }
    .aada-quiz-screen { padding: 20px 16px; }
    .aada-bilan-score { flex-direction: column; text-align: center; }
}
