/* Homepage: AI conversations + AI stories section (index-ai-content.php) - soft cards in the colours of the app's new look */

#ai-features-article { margin-top: 7rem; color: #2e2a22; }
.ai-header { text-align: center; max-width: 760px; margin: 0 auto 2.5rem; }
.ai-header h2 { font-size: 2.6rem; }
.ai-subtitle { margin-top: .8rem; font-size: 1.15rem; font-weight: 600; color: #6b6455; }

.ai-block {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 2.5rem;
    padding: 2rem 2.2rem;
    margin-bottom: 2rem;
    background: #fff;
    border: 1px solid #EDE4D2;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(46, 42, 34, .06), 0 12px 28px -12px rgba(46, 42, 34, .18);
}
.ai-block--stories { grid-template-columns: 1fr; gap: 1.5rem; }

/* text side */
.ai-text h3 { color: #2e2a22; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .6rem 0 .7rem; font-size: 1.9rem; font-weight: 700; }
.ai-text p { font-size: 1.08rem; line-height: 1.55; color: #41484f; }
.ai-text--center { text-align: center; max-width: 760px; margin: 0 auto; }
.ai-text--center h3 { justify-content: center; }
.ai-ico--teal { color: #17a2b8; }
.ai-ico--orange { color: #f0883e; }
.ai-tag {
    display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem;
    border-radius: 999px; background: #28a745; color: #fff; font-size: .85rem; font-weight: 700; letter-spacing: .04em;
}
.ai-tag i { font-size: .75em; }
.ai-level {
    display: inline-block; padding: .15rem .7rem; border-radius: 999px;
    background: #3a2f1c; color: #fff; font-size: .95rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.ai-level--sm { padding: 0 .45rem; font-size: .7rem; vertical-align: .1em; }
.ai-points { list-style: none; padding: 0; margin: 1rem 0 0; }
.ai-points li { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem; font-size: 1.05rem; font-weight: 600; }
.ai-points i {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 2.1rem; height: 2.1rem; border-radius: 50%; background: #e3f5f7; color: #17a2b8; font-size: .95rem;
}

/* conversations demo: phone with a chat (or the video) */
.ai-demo { display: flex; justify-content: center; }
.ai-phone { width: 250px; max-width: 100%; isolation: isolate; }   /* the device frame is a z-index:-1 ::after - keep it above the white card */
.ai-video { width: 100%; height: 100%; object-fit: cover; display: block; border: 0; background: #000; }
/* spoken conversation (video, default) / chat toggle above the phone */
.ai-demo { flex-direction: column; align-items: center; gap: 14px; }
.ai-mode-toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: #eef1f5; }
.ai-mode-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 999px;
    background: transparent; color: #5c6670; font-size: 14px; font-weight: 700; cursor: pointer;
}
.ai-mode-btn.is-active { background: #fff; color: #138496; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.ai-demo[data-mode="voice"] .ai-chat, .ai-demo[data-mode="chat"] .ai-voice { display: none; }
.ai-voice { position: absolute; inset: 0; background: #000; }
.ai-voice .ai-video { object-fit: contain; }
/* sound on / off over the bottom of the video */
.ai-sound-btn {
    position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 7px 13px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff;
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.ai-sound-btn:hover { background: rgba(0, 0, 0, .85); }
.ai-chat {
    display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 10px 8px;
    background: #f7f9fc; font-family: 'Montserrat', sans-serif; font-size: 10.5px; line-height: 1.35; text-align: left; overflow: hidden;
}
.ai-chat-head { padding: 5px 8px; border-radius: 8px; background: #e3f5f7; color: #0f5f6b; font-weight: 700; text-align: center; }
.ai-chat-words { display: flex; gap: 4px; justify-content: center; }
.ai-chat-words span { padding: 0 6px; border: 1px solid #dfe2e6; border-radius: 999px; background: #fff; color: #6c757d; font-size: 9.5px; }
.ai-chat-words .is-used { border-color: #a8dcb4; background: #eaf7ee; color: #1d6b30; font-weight: 700; }
.ai-msg { max-width: 82%; padding: 6px 9px; border-radius: 12px; }
.ai-msg--bot { align-self: flex-start; background: #fff; border: 1px solid #EDE4D2; border-bottom-left-radius: 3px; }
.ai-msg--me  { align-self: flex-end; background: #17a2b8; color: #fff; border-bottom-right-radius: 3px; }
.ai-msg--fix { background: #fff7e8; border-color: #f6e1b5; color: #6b4a00; }
.ai-msg--fix > i { color: #f0a93c; }
.ai-chat-input {
    display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding: 6px 6px 6px 10px;
    border: 1px solid #dfe2e6; border-radius: 999px; background: #fff; color: #9aa3ad;
}
.ai-chat-input i {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    border-radius: 50%; background: #dc3545; color: #fff; font-size: 10px;
}

/* stories: 4 steps */
.ai-steps {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem;
    list-style: none; padding: 0; margin: 0;
}
.ai-step {
    position: relative; display: flex; flex-direction: column; gap: .6rem;
    padding: 1rem; border: 1px solid #EDE4D2; border-radius: 14px; background: #fffdf8;
}
.ai-step:not(:last-child)::after {   /* arrow to the next step */
    content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900;
    position: absolute; top: 50%; right: -1.15rem; transform: translateY(-50%);
    color: #fba828; font-size: .95rem;
}
.ai-step-head { display: flex; align-items: center; gap: .5rem; }
.ai-step-no {
    display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem;
    border-radius: 50%; background: #fba828; color: #fff; font-weight: 800;
}
.ai-who { padding: .05rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.ai-who--teacher { background: #eceefa; color: #2f3778; }
.ai-who--ai      { background: #e9f6ec; color: #1e5e2e; }
.ai-who--student { background: #e8f1fd; color: #1d4f91; }
.ai-step-title { font-size: 1rem; font-weight: 700; line-height: 1.3; min-height: 2.6em; }

/* the small screen inside a step */
.ai-mock {
    flex: 1 1 auto; display: flex; flex-direction: column; gap: .55rem; padding: .75rem;
    border: 1px solid #EDE4D2; border-radius: 10px; background: #fff; font-size: .88rem; text-align: left;
}
.ai-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.ai-chips span { padding: .1rem .65rem; border: 1px solid #cdebd4; border-radius: 999px; background: #e9f6ec; color: #1e5e2e; font-weight: 700; }
.ai-mock-row { display: flex; align-items: center; gap: .4rem; color: #6b6455; font-weight: 600; }
.ai-mock-btn {
    align-self: flex-start; margin-top: auto; padding: .3rem .8rem; border-radius: 8px;
    background: #28a745; color: #fff; font-weight: 700; font-size: .82rem;
}
.ai-story-title { display: flex; align-items: center; gap: .4rem; font-weight: 700; }
.ai-story { margin: 0; line-height: 1.5; color: #2e2a22; }
.ai-story b { color: #1e7e34; }
/* stories step 3 - as in the app: coloured symbols in the text, the student picks a word for each one */
.ai-sym--green { color: #28a745; }
.ai-sym--blue { color: #007bff; }
.ai-sym { font-size: .95em; vertical-align: -1px; }
.ai-select { position: relative; align-self: flex-start; min-width: 150px; font-size: .8rem; font-weight: 700; color: #2e2a22; }
.ai-select-val {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1.5px solid #fba828; border-radius: 8px; cursor: pointer; user-select: none; background: #fff;
}
.ai-select-val .fa-caret-down { margin-left: auto; color: #8a8478; }
.ai-select.is-open .ai-select-list { display: block; }
.ai-select.is-open .ai-select-val { border-radius: 8px 8px 0 0; }
.ai-select.is-open .fa-caret-down { transform: rotate(180deg); }
/* closed by default, a dropdown over the card when open (the script in index-ai-content.php) */
.ai-select-list { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 3; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .25); margin: 0; padding: 3px 0; list-style: none; border: 1.5px solid #fba828; border-top: 0; border-radius: 0 0 8px 8px; background: #fff; }
.ai-select-list li { display: flex; align-items: center; gap: 6px; padding: 2px 10px; font-weight: 600; color: #6b6455; }
.ai-select-list li.is-active { background: #fff4dc; color: #2e2a22; font-weight: 700; }
.ai-select-list .fa-check { margin-left: auto; color: #28a745; }
.ai-player { display: flex; align-items: center; gap: .5rem; color: #6b6455; font-size: .8rem; }
.ai-player > i {
    display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem;
    border-radius: 50%; background: #007bff; color: #fff; font-size: .7rem;
}
.ai-player-bar { flex: 1; height: 5px; border-radius: 3px; background: #ececec; overflow: hidden; }
.ai-player-bar > span { display: block; height: 100%; background: #007bff; }
.ai-rec { display: flex; align-items: center; gap: .5rem; margin-top: auto; }
.ai-rec-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
    border-radius: 50%; background: #dc3545; color: #fff; box-shadow: 0 0 0 4px rgba(220, 53, 69, .18);
}
.ai-wave { display: flex; align-items: center; gap: 3px; height: 1.6rem; }
.ai-wave i { display: block; width: 3px; border-radius: 2px; background: #dc3545; opacity: .75; }
.ai-wave i:nth-child(1) { height: 30%; } .ai-wave i:nth-child(2) { height: 70%; } .ai-wave i:nth-child(3) { height: 45%; }
.ai-wave i:nth-child(4) { height: 100%; } .ai-wave i:nth-child(5) { height: 60%; } .ai-wave i:nth-child(6) { height: 85%; }
.ai-wave i:nth-child(7) { height: 40%; } .ai-wave i:nth-child(8) { height: 65%; }
.ai-rec-time { color: #dc3545; font-weight: 700; font-size: .8rem; }
.ai-wrong { color: #dc3545; font-weight: 700; text-decoration: underline wavy #dc3545; text-underline-offset: 3px; }
.ai-stars { display: flex; align-items: center; gap: .15rem; margin-top: auto; color: #fba828; font-size: 1.05rem; }
.ai-wp { margin-left: .5rem; padding: 0 .5rem; border-radius: 999px; background: #fff7e8; border: 1px solid #f6e1b5; color: #8a5200; font-size: .75rem; font-weight: 700; }
.ai-stepsNote { margin: 0; text-align: center; font-size: 1.05rem; font-weight: 600; color: #41484f; }
.ai-stepsNote i { color: #28a745; }

/* tablet: steps 2 x 2, conversations stacked */
@media (max-width: 991.98px) {
    .ai-block { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem 1.2rem; }
    .ai-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-step::after { display: none; }
    .ai-header h2 { font-size: 2rem; }
}
/* phone: one step per row */
@media (max-width: 575.98px) {
    #ai-features-article { margin-top: 4rem; }
    .ai-steps { grid-template-columns: 1fr; }
    .ai-step-title { min-height: 0; }
    .ai-text h3 { font-size: 1.5rem; }
}
