/* ==========================================================================
   LearnPress Popup Course — LMS Theme Alignment (override)
   Paste at END of learnpress.css (or enqueue after LearnPress styles)
   ========================================================================== */

/* 1) Bridge LMS tokens -> LearnPress tokens (scoped to popup so we don't nuke all LP styling) */
#popup-course {
    /* LMS tokens (with fallbacks) */
    --lms-primary: var(--primary-color, #004E38);
    --lms-accent: var(--accent-color, #06a181);
    --lms-bg: var(--bg-color, #ffffff);
    --lms-card: var(--card-bg, #ffffff);
    --lms-text: var(--text-color, #333333);
    --lms-muted: var(--light-text, #6c757d);
    --lms-border: var(--border-color, #e9ecef);
    --lms-shadow: rgba(0, 0, 0, 0.12);

    /* Map to LearnPress vars used inside popup */
    --lp-primary-color: var(--lms-primary);
    --lp-secondary-color: var(--lms-primary);
    --lp-border-color: var(--lms-border);
    --lp-color-base: var(--lms-text);
    --lp-white-grey: color-mix(in srgb, var(--lms-primary) 3%, #ffffff 97%);
    --lp-border-radius: 8px;
}

/* 2) Popup canvas */
#popup-course {
    background: var(--lms-bg);
    /* LP uses --lp-bg-color-lesson; force align to LMS */
    color: var(--lms-text);
}

/* 3) Header bar */
#popup-header {
    background: var(--lms-primary);
    /* LP default uses --lp-secondary-color :contentReference[oaicite:5]{index=5} */
    border-bottom: 1px solid color-mix(in srgb, var(--lms-primary) 12%, transparent);
    box-shadow: none !important;
}

/* Header inner spacing stays, but make it feel like your UI */
#popup-course .popup-header__inner {
    width: min(1100px, 100%);
}

/* Course title link */
#popup-header .course-title a {
    color: #fff;
    /* already white in LP :contentReference[oaicite:6]{index=6} */
    font-weight: 600;
}

#popup-header .course-title a:hover {
    color: color-mix(in srgb, #ffffff 85%, var(--lms-accent) 15%);
}

/* Back button styling (LP currently translucent white overlay :contentReference[oaicite:7]{index=7}) */
#popup-course .back-course {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

#popup-course .back-course:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* Header action buttons (Finish/Complete/etc.) */
#popup-header .lp-button {
    border-radius: 8px;
    background: #fff;
    color: var(--lms-primary);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

#popup-header .lp-button:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* 4) Sidebar (curriculum) */
#popup-sidebar {
    background: var(--lms-card);
    box-shadow: none !important;
    /* shadow removed for AidData theme */
    border-right: 1px solid color-mix(in srgb, var(--lms-primary) 10%, transparent);
}

/* Sidebar search row */
#popup-sidebar .search-course {
    background: white !important;
    /* White background for AidData theme */
    border-bottom: 1px solid color-mix(in srgb, var(--lms-primary) 10%, transparent);
}

#popup-sidebar .search-course input[name=s] {
    color: var(--lms-text);
}

#popup-sidebar .search-course input[name=s]::placeholder {
    color: color-mix(in srgb, var(--lms-muted) 80%, transparent);
}

/* Highlight current item indicator (LP uses --lp-primary-color :contentReference[oaicite:10]{index=10}) */
#popup-sidebar .lp-course-curriculum .course-item.current:before {
    background: var(--lms-accent);
}

/* 5) Content area */
#popup-content {
    background: var(--lms-bg);
    color: var(--lms-text);
}

/* Content buttons (LP base button styles exist :contentReference[oaicite:11]{index=11}) */
#popup-content .lp-button {
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--lms-primary) 18%, var(--lms-border));
    color: var(--lms-primary);
    background: transparent;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

#popup-content .lp-button:hover {
    background: var(--lms-primary);
    color: #fff;
    border-color: var(--lms-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(17, 87, 64, 0.15);
}

/* Completed button in content (LP hardcodes green :contentReference[oaicite:12]{index=12}) -> use LMS accent */
#popup-content .lp-button.completed {
    background: var(--lms-accent);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(6, 161, 129, 0.18);
}

/* 6) Make quiz inputs/cards feel consistent */
#popup-course .quiz-questions .lp-fib-content {
    border: 1px solid color-mix(in srgb, var(--lms-primary) 14%, var(--lms-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--lms-primary) 2%, #ffffff 98%);
}

#popup-course .quiz-questions .lp-fib-input>input {
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--lms-primary) 16%, var(--lms-border));
}

#popup-course .quiz-questions .lp-fib-input>input:focus {
    outline: none;
    border-color: var(--lms-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lms-accent) 18%, transparent);
}

/* 7) Scrollbars (subtle, like a modern app) */
#popup-sidebar::-webkit-scrollbar,
#popup-content::-webkit-scrollbar {
    width: 10px;
}

#popup-sidebar::-webkit-scrollbar-track,
#popup-content::-webkit-scrollbar-track {
    background: transparent;
}

#popup-sidebar::-webkit-scrollbar-thumb,
#popup-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    border: 3px solid transparent;
    background-clip: content-box;
}

#popup-sidebar::-webkit-scrollbar-thumb:hover,
#popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
    border: 3px solid transparent;
    background-clip: content-box;
}

/* 8) Dark mode alignment (your site toggles body.dark-mode :contentReference[oaicite:13]{index=13}) */
body.dark-mode #popup-course {
    --lms-bg: var(--dark-bg-color, #121212);
    --lms-card: var(--dark-card-bg, #1e1e1e);
    --lms-text: var(--dark-text-color, #e0e0e0);
    --lms-muted: var(--dark-light-text, #a0a0a0);
    --lms-border: var(--dark-border-color, #333333);
    background: var(--lms-bg);
    color: var(--lms-text);
}

body.dark-mode #popup-header {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

body.dark-mode #popup-sidebar {
    background: var(--lms-card);
    border-right-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode #popup-sidebar .search-course {
    background: rgba(255, 255, 255, 0.06);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode #popup-content .lp-button {
    border-color: rgba(255, 255, 255, 0.10);
    color: #fff;
}

body.dark-mode #popup-content .lp-button:hover {
    background: var(--lms-primary);
    border-color: var(--lms-primary);
}

body.dark-mode #popup-sidebar::-webkit-scrollbar-thumb,
body.dark-mode #popup-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
}

body.dark-mode #popup-sidebar::-webkit-scrollbar-thumb:hover,
body.dark-mode #popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.26);
}

/* 9) AidData Brand Colors - Primary Green Override */
/* Update all LearnPress buttons to use AidData green (#026447) */
.lp-button,
button.lp-button,
a.lp-button,
.lp-button-complete-lesson,
.lp-button-start-course,
.lp-button.btn-finish-course {
    background-color: #026447 !important;
    border-color: #026447 !important;
    color: #ffffff !important;
}

/* Success messages - green text only */
.learn-press-message.success,
.learn-press-message.success .message-content {
    background-color: transparent !important;
    color: #026447 !important;
}

/* Hover states for buttons */
.lp-button:hover,
button.lp-button:hover,
a.lp-button:hover,
.lp-button-complete-lesson:hover,
.lp-button-start-course:hover,
.lp-button.btn-finish-course:hover {
    background-color: #004E38 !important;
    border-color: #004E38 !important;
    color: #ffffff !important;
}

/* Quiz result text */
.lp-quiz-result .result-grade.passed {
    color: #026447 !important;
}

/* Quiz failed message - change to "Try again" with light pink background */
body .learn-press-message.error,
body .learn-press-message.failed,
body .lp-quiz-result .result-grade.failed,
.learn-press-message.error,
.learn-press-message.failed,
.lp-quiz-result .result-grade.failed,
#popup-content .learn-press-message.error,
#learn-press-content-item .learn-press-message.error,
div.learn-press-message.error,
.content-item-wrap .learn-press-message.error {
    background: #ffe6e6 !important;
    background-color: #ffe6e6 !important;
    border-color: #ffcccc !important;
    color: #333333 !important;
}

.learn-press-message.error .message-content,
.learn-press-message.failed .message-content,
body .learn-press-message.error .message-content {
    color: #333333 !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Success message borders */
.learn-press-message.success {
    border-color: #026447 !important;
}

/* Completed status indicators */
.course-item-status.item-completed,
.lp-label.label-completed,
.order-status.order-status-completed,
.learn-press-course-results-progress .lp-course-progress .items-completed {
    background-color: #026447 !important;
    border-color: #026447 !important;
    color: #ffffff !important;
}

/* Remove shadow from completed button */
#popup-content .lp-button.completed,
.lp-button.completed,
button.lp-button.completed {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
}

/* Progress bars */
.learn-press-progress .lp-progress-bar,
.course-progress-bar .progress-bg .progress-active {
    background-color: #026447 !important;
}

/* Profile avatar identity */
.lp-user-profile .lp-profile-left .user-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.lp-user-profile .lp-profile-left .user-avatar img {
    border: 2px solid #026447;
    box-sizing: border-box;
}

.lp-user-profile .aiddata-profile-avatar-name {
    margin: 0;
    color: #004E38;
    font-size: calc(var(--lp-font-size-base, 1em) * 1.05);
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    word-break: break-word;
}

/* LearnPress certificates tab */
#profile-content-certificates .aiddata-profile-certificates {
    display: grid;
    gap: 20px;
}

#profile-content-certificates .aiddata-profile-certificates__intro h2 {
    margin: 0 0 8px;
    color: #004E38;
    font-size: clamp(1.5rem, 2vw, 1.875rem);
    line-height: 1.2;
}

#profile-content-certificates .aiddata-profile-certificates__intro p {
    margin: 0;
    max-width: 680px;
    color: #5B6B65;
}

#profile-content-certificates .aiddata-profile-certificates__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

#profile-content-certificates .aiddata-profile-certificates__item {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid rgba(2, 100, 71, 0.14);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 248, 245, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(2, 78, 56, 0.08);
}

@media (min-width: 782px) {
    #profile-content-certificates .aiddata-profile-certificates__item {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
}

#profile-content-certificates .aiddata-profile-certificates__eyebrow {
    margin: 0 0 10px;
    color: #026447;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#profile-content-certificates .aiddata-profile-certificates__title {
    margin: 0 0 16px;
    color: #0F2F24;
    font-size: 1.25rem;
    line-height: 1.3;
}

#profile-content-certificates .aiddata-profile-certificates__title a {
    color: inherit;
    text-decoration: none;
}

#profile-content-certificates .aiddata-profile-certificates__title a:hover {
    color: #026447;
}

#profile-content-certificates .aiddata-profile-certificates__meta {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px 18px;
}

#profile-content-certificates .aiddata-profile-certificates__meta div {
    display: grid;
    gap: 4px;
}

#profile-content-certificates .aiddata-profile-certificates__meta dt {
    margin: 0;
    color: #5B6B65;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#profile-content-certificates .aiddata-profile-certificates__meta dd {
    margin: 0;
    color: #0F2F24;
    font-size: 0.98rem;
    font-weight: 500;
    word-break: break-word;
}

#profile-content-certificates .aiddata-profile-certificates__meta code {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(2, 100, 71, 0.08);
    color: #004E38;
    font-size: 0.86rem;
}

#profile-content-certificates .aiddata-profile-certificates__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#profile-content-certificates .aiddata-profile-certificates__actions .lp-button {
    border-color: #026447;
    background: #026447;
    color: #FFFFFF;
    font-weight: 600;
}

#profile-content-certificates .aiddata-profile-certificates__actions .lp-button:hover {
    border-color: #004E38;
    background: #004E38;
    color: #FFFFFF;
}

#profile-content-certificates .aiddata-profile-certificates__actions .lp-button-secondary {
    background: transparent;
    color: #026447;
}

#profile-content-certificates .aiddata-profile-certificates__actions .lp-button-secondary:hover {
    border-color: #004E38;
    background: rgba(2, 100, 71, 0.08);
    color: #004E38;
}

@media (max-width: 600px) {
    #profile-content-certificates .aiddata-profile-certificates__actions .lp-button {
        width: 100%;
    }
}

/* In-course certificate notices */
.aiddata-course-certificate-notice-root {
    margin: 0 0 24px;
}

.aiddata-course-certificate-notice-root--popup {
    margin: 0;
    padding: 0 20px 18px;
    background: #FFFFFF;
}

.aiddata-course-certificate-notice {
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid rgba(2, 100, 71, 0.18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(236, 247, 241, 0.98) 100%);
    box-shadow: 0 16px 36px rgba(2, 78, 56, 0.12);
}

.aiddata-course-certificate-notice--popup {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: 0;
    box-shadow: 0 20px 34px rgba(2, 78, 56, 0.12);
}

.aiddata-course-certificate-notice__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: rgba(2, 100, 71, 0.12);
    color: #026447;
}

.aiddata-course-certificate-notice__content {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.aiddata-course-certificate-notice__eyebrow {
    margin: 0;
    color: #026447;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aiddata-course-certificate-notice__title {
    margin: 0;
    color: #0F2F24;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.aiddata-course-certificate-notice__text {
    margin: 0;
    color: #375046;
    line-height: 1.65;
}

.aiddata-course-certificate-notice__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #5B6B65;
    font-size: 0.92rem;
}

.aiddata-course-certificate-notice__meta li {
    position: relative;
}

.aiddata-course-certificate-notice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.aiddata-course-certificate-notice__actions .lp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid #026447;
    border-radius: 999px;
    background: #026447;
    color: #FFFFFF;
    font-weight: 600;
    text-align: center;
}

.aiddata-course-certificate-notice__actions .lp-button:hover {
    border-color: #004E38;
    background: #004E38;
    color: #FFFFFF;
}

.aiddata-course-certificate-notice__actions .lp-button.lp-button-secondary {
    background: #FFFFFF;
    color: #026447;
}

.aiddata-course-certificate-notice__actions .lp-button.lp-button-secondary:hover {
    background: rgba(2, 100, 71, 0.08);
    color: #004E38;
}

.aiddata-course-certificate-notice__actions .lp-button:focus-visible,
.aiddata-course-certificate-toast__close:focus-visible,
.aiddata-course-certificate-toast__link:focus-visible {
    outline: 3px solid #9FDBB5;
    outline-offset: 3px;
}

.aiddata-course-certificate-toast-stack {
    position: fixed;
    top: clamp(16px, 2.5vw, 28px);
    right: clamp(16px, 2.5vw, 28px);
    z-index: 99999;
    display: grid;
    gap: 12px;
    width: min(calc(100vw - 32px), 420px);
    pointer-events: none;
}

.aiddata-course-certificate-toast {
    display: grid;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 18px;
    background: #0F2F24;
    color: #FFFFFF;
    box-shadow: 0 18px 38px rgba(15, 47, 36, 0.28);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
}

.aiddata-course-certificate-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.aiddata-course-certificate-toast.is-closing {
    opacity: 0;
    transform: translateY(-8px);
}

.aiddata-course-certificate-toast__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    align-items: start;
}

.aiddata-course-certificate-toast__eyebrow {
    grid-column: 1;
    margin: 0;
    color: #9FDBB5;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aiddata-course-certificate-toast__title {
    grid-column: 1;
    margin: 0;
    color: #FFFFFF;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
}

.aiddata-course-certificate-toast__close {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    cursor: pointer;
}

.aiddata-course-certificate-toast__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.aiddata-course-certificate-toast__close span {
    font-size: 1.2rem;
    line-height: 1;
}

.aiddata-course-certificate-toast__text {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
}

.aiddata-course-certificate-toast__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.aiddata-course-certificate-toast__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #9FDBB5;
    border-radius: 999px;
    background: #9FDBB5;
    color: #0F2F24;
    font-weight: 700;
    text-decoration: none;
}

.aiddata-course-certificate-toast__link:hover {
    border-color: #FFFFFF;
    background: #FFFFFF;
    color: #0F2F24;
}

.aiddata-course-certificate-toast__link--secondary {
    background: transparent;
    color: #FFFFFF;
}

.aiddata-course-certificate-toast__link--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

@media (min-width: 900px) {
    .aiddata-course-certificate-notice--course {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }
}

@media (max-width: 782px) {
    .aiddata-course-certificate-notice-root--popup {
        padding: 0 14px 16px;
    }

    .aiddata-course-certificate-notice {
        padding: 18px;
    }

    .aiddata-course-certificate-notice__actions .lp-button {
        width: 100%;
    }

    .aiddata-course-certificate-toast-stack {
        left: 16px;
        right: 16px;
        width: auto;
    }

    .aiddata-course-certificate-toast__actions {
        flex-direction: column;
    }

    .aiddata-course-certificate-toast__link {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aiddata-course-certificate-toast {
        transition: none;
        transform: none;
    }
}

/* Links and accents */
.learn-press-message.success a {
    color: #026447 !important;
}

.learn-press-message.success a:hover {
    color: #004E38 !important;
}

/* Course item icons - Lesson icon */
.course-item-icon.lp_lesson,
.course-item .course-item-icon.lp_lesson,
#popup-sidebar .course-item-icon.lp_lesson,
.lp-course-curriculum .course-item-icon.lp_lesson {
    color: #026447 !important;
    background-color: rgba(2, 100, 71, 0.1) !important;
}

/* Lesson icon SVG/paths */
.course-item-icon.lp_lesson svg,
.course-item-icon.lp_lesson path,
.course-item-icon.lp_lesson .lp-icon {
    fill: #026447 !important;
    color: #026447 !important;
}

/* Sidebar toggle button */
#sidebar-toggle,
#popup-header #sidebar-toggle {
    color: #026447 !important;
    background-color: rgba(2, 100, 71, 0.1) !important;
}

#sidebar-toggle::before {
    color: #026447 !important;
}

#sidebar-toggle:hover {
    color: #004E38 !important;
    background-color: rgba(2, 100, 71, 0.15) !important;
}

#sidebar-toggle:hover::before {
    color: #004E38 !important;
}

/* Remove shadow from course curriculum and sidebar */
#popup-sidebar,
.lp-course-curriculum,
#popup-sidebar .lp-course-curriculum,
.course-curriculum,
#sidebar,
.lp-sidebar,
#popup-course #popup-sidebar,
.course-item-popup #popup-sidebar {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Make section headers white */
.course-section-header,
.lp-course-curriculum .section-header,
#popup-sidebar .course-section-header,
.curriculum-sections .section-header {
    background: white !important;
    background-color: white !important;
}

/* Complete lesson modal - AidData green */
body .lp-modal-dialog .lp-modal-header,
body.learnpress .lp-modal-dialog .lp-modal-header,
.lp-modal-dialog .lp-modal-header,
.lp-modal-content .lp-modal-header,
.lp-modal .lp-modal-header,
#popup-course .lp-modal-header {
    background: #026447 !important;
    background-color: #026447 !important;
}

/* Modal Yes/Confirm button */
body .lp-modal-dialog .btn-yes,
body.learnpress .lp-modal-dialog .btn-yes,
.lp-modal-dialog .btn-yes,
.btn-yes,
button.btn-yes,
.lp-modal-content .lp-button-yes,
.lp-modal-content button.lp-button-yes,
.lp-modal .lp-button-yes,
#popup-course .lp-modal .lp-button-yes {
    background: #026447 !important;
    background-color: #026447 !important;
    border-color: #026447 !important;
    color: #fff !important;
}

body .lp-modal-dialog .btn-yes:hover,
body.learnpress .lp-modal-dialog .btn-yes:hover,
.lp-modal-dialog .btn-yes:hover,
.btn-yes:hover,
.lp-modal-content .lp-button-yes:hover,
.lp-modal .lp-button-yes:hover {
    background: #004E38 !important;
    background-color: #004E38 !important;
    border-color: #004E38 !important;
}

/* Smooth content transitions */
#popup-content {
    transition: opacity 0.2s ease-in-out;
}

#popup-content.loading {
    opacity: 0.5;
    pointer-events: none;
}

.content-item-scrollable {
    transition: opacity 0.15s ease-in-out;
}

/* Smooth lesson switching */
#learn-press-content-item {
    min-height: 400px;
    transition: opacity 0.2s ease-in-out;
}

#learn-press-content-item.loading {
    opacity: 0.3;
}

/* Prevent layout shift during loading */
.content-item-wrap {
    min-height: 300px;
}

#popup-header .popup-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 24px;
}

#popup-header .course-header-action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.25rem !important;
    border: 1px solid #026447;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: normal !important;
    height: auto !important;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

#popup-header .course-header-action svg {
    flex-shrink: 0;
}

#popup-header .course-header-action:hover {
    transform: translateY(-1px);
}

#popup-header .course-header-action:focus-visible,
.course-glossary-modal__close:focus-visible,
.course-glossary-modal__search:focus-visible {
    outline: 2px solid #026447;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(2, 100, 71, 0.16);
}

#popup-header .course-glossary-button {
    background: #ffffff;
    color: #026447;
}

#popup-header .course-glossary-button:hover {
    background: #e7f5ef;
}

#popup-header .back-course.exit-course-button {
    background: #026447 !important;
    color: #ffffff;
    border-color: #026447;
    margin-right: 0 !important;
}

#popup-header .back-course.exit-course-button:hover {
    background: #004E38 !important;
    border-color: #004E38;
}

.course-glossary-modal[hidden] {
    display: none !important;
}

.course-glossary-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
}

.course-glossary-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 24, 18, 0.74);
}

.course-glossary-modal__dialog {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f5f7f4;
    color: #173729;
    display: flex;
    flex-direction: column;
}

.course-glossary-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 40px 24px;
    border-bottom: 1px solid rgba(2, 100, 71, 0.14);
    background: linear-gradient(135deg, #ffffff 0%, #eef7f1 100%);
}

.course-glossary-modal__heading-group {
    max-width: 720px;
}

.course-glossary-modal__eyebrow {
    margin: 0 0 10px;
    color: #026447;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.course-glossary-modal__title {
    margin: 0;
    color: #153b2d;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.1;
}

.course-glossary-modal__description {
    margin: 10px 0 0;
    color: #4a5f55;
    font-size: 1rem;
    line-height: 1.6;
}

.course-glossary-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(2, 100, 71, 0.16);
    border-radius: 999px;
    background: #ffffff;
    color: #026447;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.course-glossary-modal__close:hover {
    background: #e7f5ef;
    transform: translateY(-1px);
}

.course-glossary-modal__toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 40px 0;
}

.course-glossary-modal__search {
    flex: 1 1 auto;
    min-width: 240px;
    border: 1px solid rgba(2, 100, 71, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: #153b2d;
    padding: 14px 18px;
    font-size: 1rem;
}

.course-glossary-modal__search::placeholder {
    color: #6b7c74;
}

.course-glossary-modal__count {
    margin: 0;
    color: #4a5f55;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.course-glossary-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px 40px 40px;
}

.course-glossary-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin: 0;
}

.course-glossary-item {
    background: #ffffff;
    border: 1px solid rgba(2, 100, 71, 0.12);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 14px 28px rgba(2, 78, 56, 0.08);
}

.course-glossary-item[hidden] {
    display: none !important;
}

.course-glossary-term {
    margin: 0 0 12px;
    color: #026447;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.course-glossary-definition {
    margin: 0;
    color: #46564f;
    font-size: 0.96rem;
    line-height: 1.7;
}

.course-glossary-definition p:first-child {
    margin-top: 0;
}

.course-glossary-definition p:last-child {
    margin-bottom: 0;
}

.course-glossary-empty-state {
    max-width: 620px;
    margin: 72px auto 0;
    padding: 28px;
    background: #ffffff;
    border: 1px solid rgba(2, 100, 71, 0.12);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 14px 28px rgba(2, 78, 56, 0.08);
}

.course-glossary-empty-state h3 {
    margin: 0 0 12px;
    color: #153b2d;
    font-size: 1.3rem;
}

.course-glossary-empty-state p {
    margin: 0;
    color: #4a5f55;
    line-height: 1.6;
}

/* Mobile responsive header */
@media screen and (max-width: 768px) {
    #popup-header {
        flex-wrap: wrap !important;
        padding: 0.5rem 0 !important;
        min-height: auto !important;
    }

    #popup-header .popup-header__logo-toggle {
        order: 1;
        flex: 0 0 auto !important;
    }

    #popup-header .popup-header__logo-toggle img.aiddata-header-logo {
        height: 24px !important;
        margin-left: 10px !important;
    }

    #popup-header .popup-header__actions {
        order: 2;
        gap: 8px;
        margin-right: 12px !important;
        margin-left: auto !important;
    }

    #popup-header .course-header-action {
        padding: 0.5rem 1rem !important;
        font-size: 0.875rem !important;
    }

    #popup-header .course-header-action svg {
        width: 14px !important;
        height: 14px !important;
    }

    #popup-header .popup-header__inner {
        order: 3;
        flex: 1 1 100% !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
        margin-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }

    #popup-header .course-title {
        font-size: 1rem !important;
    }

    #sidebar-toggle {
        padding: 0.5rem !important;
    }

    .course-glossary-modal__header {
        padding: 24px 20px 18px;
    }

    .course-glossary-modal__toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 20px 0;
    }

    .course-glossary-modal__count {
        white-space: normal;
    }

    .course-glossary-modal__body {
        padding: 20px 20px 28px;
    }

    .course-glossary-list {
        grid-template-columns: 1fr;
    }

    .course-glossary-empty-state {
        margin-top: 32px;
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #popup-header .course-header-action,
    .course-glossary-modal__close,
    .course-glossary-modal__search {
        transition: none;
    }
}

/* Add a little breathing room below the site navbar on the LearnPress profile page. */
#learn-press-profile.lp-user-profile {
    margin-top: 18px;
}

@media (max-width: 990px) {
    #learn-press-profile.lp-user-profile {
        margin-top: 14px;
    }
}

.gie-lesson-embed,
.aiddata-lesson-embed {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 24px;
}

.lesson-embed-complete-action {
    width: 100%;
    margin: 24px 0 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.lesson-embed-complete-action .learn-press-form.form-button,
.lesson-embed-complete-action .lp-button.completed {
    margin: 0;
}

.lesson-embed-complete-action .learn-press-form.form-button {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.lesson-embed-complete-action .lp-button,
.lesson-embed-complete-action .lp-button.completed {
    width: min(100%, 280px);
}

.lesson-embed-complete-action .lp-button.completed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#popup-footer.has-aiddata-lesson-embed form[name="learn-press-form-complete-lesson"],
#popup-footer.has-aiddata-lesson-embed .button-complete-lesson,
#popup-footer.has-aiddata-lesson-embed .lp-btn-complete-item {
    display: none !important;
}

#learn-press-content-item.has-aiddata-lesson-embed .content-item-wrap,
#learn-press-content-item.has-aiddata-lesson-embed .lesson-description {
    width: min(1120px, 100%);
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

#learn-press-content-item .lesson-description > :last-child,
#learn-press-content-item .content-item-wrap > :last-child,
#learn-press-content-item .gie-lesson-embed:last-child,
#learn-press-content-item .aiddata-lesson-embed:last-child {
    margin-bottom: 0;
}

.gie-lesson-embed iframe,
.aiddata-lesson-embed iframe {
    width: 100%;
    max-width: 100%;
    min-height: 600px;
    height: 600px;
    display: block;
    border: 0;
    transition: height 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    .gie-lesson-embed iframe,
    .aiddata-lesson-embed iframe {
        transition: none;
    }
}

@media (max-width: 782px) {
    .lesson-embed-complete-action .lp-button,
    .lesson-embed-complete-action .lp-button.completed {
        width: 100%;
    }
}
