/* Registered, the course open (course/parts/entry.php): the bar with the chapter and the two ways on --
 * into the course, or out of it -- before the learner begins (Figma 01.11) and once they have, with how
 * much is done under it (01.13); and the dialog that asks before leaving (01.12).
 *
 * One bar in every state: the full width of the text column, from where the title starts to where it
 * is cut, and the same two buttons at the same size -- only the words and the track change.
 */

/* One line: a wrapping column sizes its line to the widest child, so a long course or chapter name
   would push the bar past the column instead of being cut short. */
.cil-course-hero__actions--entry { align-self: stretch; flex-wrap: nowrap; }
/* The LMS did not answer about this learner (parts/hero.php): in the bar's place and at its size, the my-courses row's failed
   state -- the red disc with its mark, a red edge and tint, the retry the house button. The arrow turns when pointed at. */
.cil-course-unknown {
    display: flex; align-items: center; gap: 12px; box-sizing: border-box; min-height: 68px; padding: 11px;
    border: 1.5px solid var(--cil-red-light-4); border-radius: 12px; background: var(--cil-red-light-1);
}
.cil-course-unknown__disc {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px; box-sizing: border-box;
    border: 1px solid var(--cil-red-light-4); border-radius: 50%; background: var(--cil-white); color: var(--cil-red-regular-5);
}
.cil-course-unknown__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; }
.cil-course-unknown__title { font-size: 18px; font-weight: 700; color: var(--cil-red-dark-1); }
.cil-course-unknown__note { font-size: 14px; color: var(--cil-black-regular-7); }
.cil-course .cil-course-unknown__retry {
    display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; box-sizing: border-box; cursor: pointer;
    border: 1px solid var(--cil-blue-dark-1); border-radius: 8px; background: var(--cil-white); color: var(--cil-blue-dark-1);
    font-size: 14px; font-weight: 700; line-height: 1.2;
}
.cil-course .cil-course-unknown__retry svg { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.cil-course .cil-course-unknown__retry:is(:hover, :focus-visible) { text-decoration: underline; text-underline-offset: 3px; }
.cil-course .cil-course-unknown__retry:is(:hover, :focus-visible) svg { transform: rotate(120deg); }
.cil-course .cil-course-unknown__retry:disabled { cursor: default; opacity: .5; }
@media (max-width: 600px) {
    .cil-course-unknown { flex-wrap: wrap; }
    .cil-course-unknown__text { flex-basis: calc(100% - 56px); }
    .cil-course .cil-course-unknown__retry { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .cil-course .cil-course-unknown__retry svg { transition: none; }
}

/* The bar and the line that may follow it, kept close whatever gap the hero puts between its parts. */
.cil-course-entryWrap { display: flex; flex-direction: column; gap: 8px; }
.cil-course-entry {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-block: 12px;
    padding-inline: 18px 12px;
    border-radius: 12px;
    background: var(--cil-black-regular-10);
}
.cil-course-entry__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cil-course-entry__next { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; }
.cil-course-entry__label { font-size: 14px; color: var(--cil-black-light-6); }
.cil-course-entry__lesson { font-size: 18px; font-weight: 700; color: var(--cil-white); }
.cil-course-entry__label, .cil-course-entry__lesson { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The chapter's line while its name is asked for (assets/chapter.js, item 540): its room kept, so nothing below moves when the
   name arrives; given up (hidden) only when no name comes. */
[data-cd-chapter-waiting] { visibility: hidden; }
.cil-course-entry__actions { display: flex; flex: none; gap: 12px; margin-inline-start: auto; }
.cil-course .cil-course-entry__start { width: 176px; min-width: 0; height: 44px; min-height: 0; padding: 0 16px; font-size: 18px; }
.cil-course .cil-course-entry__leave {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 176px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--cil-black-regular-3);
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--cil-black-light-6);
}
.cil-course .cil-course-entry__leave:hover { border-color: var(--cil-black-light-6); color: var(--cil-white); }

/* Video on demand (Figma 01.22): the pill between the course type and the registered line. */
.cil-course .cil-course-hero__vod {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--cil-black-light-6);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--cil-black-dark-4);
    white-space: nowrap;
}

/* Registration closed to newcomers (Figma 01.19), or an ended course (01.22): under the bar, the mark leading. */
.cil-course .cil-course-entry__note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    line-height: 1.2;
    color: var(--cil-black-light-6);
}
.cil-course-entry__note svg { flex: none; }

/* How much of the course is done, filled from where the line starts (the right, in Hebrew). */
.cil-course-entry__track { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--cil-black-regular-3); }
.cil-course-entry__fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 3px; background: var(--cil-blue); }

/* All of it done (Figma 01.14): a green chip with the mark in place of the percentage, the track full
   and green, and the words start at the top beside the two buttons. */
.cil-course-entry--done { gap: 14px; padding-block-start: 9px; }
.cil-course-entry--done .cil-course-entry__row { align-items: flex-start; padding-block-start: 3px; }
.cil-course-entry--done .cil-course-entry__next { align-items: flex-start; }
.cil-course-entry__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--cil-green);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--cil-black-dark-4);
    white-space: nowrap;
}
.cil-course-entry__chip svg { flex: none; }
.cil-course-entry--done .cil-course-entry__fill { background: var(--cil-green); }
.cil-course a.cil-course-entry__start { text-decoration: none; }

/* ---- the dialog ---- */
.cil-course-leave {
    width: min(520px, calc(100% - 32px));   /* 100%: the window without its scroll bar, as plans.css */
    max-width: none;
    padding: 40px 44px 32px;
    border: 0;
    border-radius: 16px;
    background: var(--cil-white);
    color: var(--cil-black-dark-4);
    text-align: center;
}
.cil-course-leave::backdrop { background: color-mix(in srgb, var(--cil-black-dark-4) 60%, transparent); }
.cil-course .cil-course-leave__close {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}
.cil-course .cil-course-leave__close:hover { background: var(--cil-black-light-1); }
.cil-course .cil-course-leave__title { margin: 0 0 12px; font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--cil-black-dark-4); }
.cil-course .cil-course-leave__text { margin: 0 auto 12px; max-width: 432px; font-size: 16px; line-height: 1.2; color: var(--cil-black-regular-7); }
.cil-course .cil-course-leave__error { margin: 0 0 12px; font-size: 14px; color: var(--cil-red-regular-6, var(--cil-red)); }
.cil-course-leave__actions { display: flex; justify-content: center; gap: 12px; }
/* Both answers the design's size, 190x44 -- the hero's own button is larger, and would win otherwise. */
.cil-course .cil-course-leave__actions > button { width: 190px; min-width: 0; height: 44px; min-height: 0; padding: 0 16px; }
.cil-course .cil-course-leave__confirm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    border: 1px solid var(--cil-red);
    border-radius: 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--cil-red-regular-6, var(--cil-red));
}
.cil-course .cil-course-leave__confirm:hover { background: var(--cil-red-light-1, transparent); }
.cil-course .cil-course-leave__confirm:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 767px) {
    .cil-course-entry { gap: 16px; padding: 14px 12px; }
    .cil-course-entry__row, .cil-course-entry--done .cil-course-entry__row { flex-direction: column; align-items: stretch; }
    .cil-course-entry__actions { margin-inline-start: 0; }
    .cil-course .cil-course-entry__start, .cil-course .cil-course-entry__leave { flex: 1 1 0; width: auto; min-width: 0; padding-inline: 12px; }
    /* The hero's phone rule sends its CTA last; in the bar the way in keeps the leading place. */
    .cil-course .cil-course-entry__start { order: 0; }
    /* The design's phone dialog (01.12 mobile): 16px from the screen's edges, the two answers side by side. */
    .cil-course-leave { width: calc(100% - 32px); padding: 24px 20px 20px; }
    /* Clear of the close button in the corner. */
    .cil-course .cil-course-leave__title { padding-inline: 24px; }
    /* The hero's phone rule sends its CTA last; in the dialog the answers keep their places. */
    .cil-course .cil-course-leave__actions > button { order: 0; flex: 1 1 0; width: auto; padding: 0 12px; }
}
