/* ================================================
   GLOBAL BASE STYLES
   ================================================ */

#prov_trainings p,
#prov_trainings ul,
#prov_trainings blockquote,
#prov_trainings pre,
#prov_trainings td,
#prov_trainings th,
#prov_trainings label {
    color: #555 !important;
}

#prov_trainings header {
    background-color: #002d62;
    color: #fff;
    padding: 1.5rem 1rem;
    text-align: center;
}

#prov_trainings header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.unfinished-popup__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Apply scrolling ONLY when there are 4+ items */
.unfinished-popup__list:has(li:nth-child(3)) {
    max-height: 160px;
    /* adjust to your row height */
    overflow-y: auto;
    padding-right: 6px;
    /* space for scrollbar */
}

/* Utility classes */
.dark-blue {
    color: #00205b;
}

.mt-45 {
    margin-top: 2rem !important;
}

.mb-45 {
    margin-bottom: 2rem !important;
}


/* ================================================
   MAIN BACKGROUND CONTAINER
   ================================================ */

.cpspTraining-bckgrnd {
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0, 45, 98, 0.13);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 1.5rem 0.75rem;
    margin: 0 auto;
    max-width: 1200px;
}

.cpspTraining-bckgrnd h2 {
    padding: 0.5em 1em;
    background: #00205b;
    color: #fff;
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    /*width: 100%;
    min-width: 450px;
    max-width: 1100px;*/
    font-size: clamp(1.4rem, 2.5vw + 0.5rem, 2rem);
    font-weight: 600;
    line-height: 1.2;
}


/* ================================================
   INTRO + CONTACT SECTIONS
   ================================================ */

.intro-info {
    border-radius: 10px;
    padding: 0.75rem 1.4rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.training-contact {
    background-color: #e8f1fb;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    border-left: 6px solid #002d62;
    border-right: 6px solid #002d62;
    padding: 2.2rem 7.5rem;
    margin-top: 3rem;
    font-size: 1.4rem;
    color: #1a1a1a;
    border-radius: 8px;
    text-align: center;
}

.training-contact a {
    color: #002d62;
    font-weight: 700;
    text-decoration: underline;
}

.training-contact a:hover,
.training-contact a:focus {
    color: #003d73;
    text-decoration: none;
}


/* ================================================
   TRAINING SECTIONS
   ================================================ */
.training-section {
    text-align: left;
    padding-bottom: 2rem;
}

.training-section h2 {
    font-size: 1.8rem;
    color: #002d62;
    margin-bottom: 1rem;
    font-weight: 700;
}

.training-section p.intro,
.additional-training p.intro {
    color: #555;
    max-width: 1150px;
    line-height: 1.5;
    font-size: 1.05rem;
    margin-top: -10px;
    text-align: left;
}

.additional-training {
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
}

.additional-training h2 {
    font-size: 1.7rem;
    color: #002d62;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.additional-desc {
    max-width: 750px;
    margin: 0 auto 2rem;
    color: #2b2b2b;
    line-height: 1.6;
    text-align: left;
}

.section-card {
    border-radius: 12px;
    padding: 0.75rem 1.4rem;
}


/* ================================================
   VIDEO GRID — SCROLLABLE
   ================================================ */

.video-grid {
    display: grid;
    background-color: #f1f5fb;
    /*background: rgb(232 241 251 / 85%);*/
    box-shadow: 0 3px 12px rgba(0, 32, 91, 0.18);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-items: center;
    max-height: 650px;
    overflow-y: auto;
    padding: 0.5rem 10px 0.5rem 10px;

    /* Firefox scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.05);
}

/* WebKit scrollbar styling (Chrome, Edge, Safari) */
.video-grid::-webkit-scrollbar {
    width: 10px;
}

.video-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
}

.video-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}


/* ================================================
   VIDEO CARD — MODERN MATERIAL STYLE
   ================================================ */

.video-card {
    background: #ffffff;
    border-radius: 14px;
    /* overflow: hidden;*/
    overflow: visible;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 350px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.25s ease;
    will-change: box-shadow;
    position: relative;
}

.video-card:hover {
    transform: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.video-badge--progress-circle {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    pointer-events: none;
    /* so clicks still hit the video */
}

/* Outer ring */
.video-badge__ring {
    --size: 108px;
    --progress: 0;
    --track-color: #37363b;
    --fill-color: #38b6ff;

    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    position: relative;

    background:
        conic-gradient(var(--fill-color) calc(var(--progress) * 1%),
            var(--track-color) 0);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

/* inner “disc” */
.video-badge__ring::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: #f8f8f8;
}

/* stack % + label */
.video-badge__ring-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.video-badge__percent {
    font-size: 1.35rem;
    font-weight: 700;
    color: #333333;
    line-height: 1;
}

.video-badge__label {
    font-size: 0.55rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #666666;
    margin-top: 2px;
}

/* ================================================
   THUMBNAIL — ZOOM + FADE OVERLAY
   ================================================ */

.video-thumbnail {
    width: 100%;
    position: relative;
    cursor: pointer;
    background: #e1e4ea;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* 16:9 aspect ratio */
.video-thumbnail::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

/* Visible thumbnail image */
.video-thumb-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease, opacity 0.3s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Zoom effect on hover */
.video-thumbnail:hover .video-thumb-preview {
    transform: scale(1.12);
}

/* Dark overlay (gradient) */
.video-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 20%,
            rgba(0, 0, 0, 0.45) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    border-radius: 12px 12px 0 0;
}

.video-thumbnail:hover .video-thumb-overlay {
    opacity: 1;
}

/* Play button (YouTube style) */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 68px;
    height: 48px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.25s ease;
}

.video-thumbnail:hover .play-button {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
}

.play-button svg {
    width: 100%;
    height: 100%;
}

.play-button .yt-shape {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.sort-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.sort-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.25s ease;
    font-size: 0.85rem;
}

/* Remove native browser arrow from the sort dropdown */
.sort-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none !important;
}

/* Sort dropdown OPEN → rotate arrow UP */
.sort-open .sort-arrow {
    transform: translateY(-50%) rotate(180deg);
}


/* ================================================
   HOVER PREVIEW VIDEO (IFRAME CONTAINER)
   ================================================ */

.hover-preview-container {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    z-index: 2;
}

/* The iframe used for hover preview (non-Safari browsers) */
.video-hover-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    border-radius: 12px 12px 0 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* On hover: show hover video, fade out static image */
.video-thumbnail:hover .video-hover-preview {
    opacity: 1;
}

.video-thumbnail:hover .video-thumb-preview {
    opacity: 0;
}


/* ================================================
   DIVIDER
   ================================================ */

.video-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #002d62, #004a9f);
    margin: 16px 0;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


/* ================================================
   TITLE AREA
   ================================================ */

.video-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #002d62;
    margin: 0;
    padding: 0 15px;
    text-align: center;
}


/* ================================================
   META ROW
   ================================================ */

.video-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    color: #555;
    margin: 10px 0 12px 0;
}

.video-date-icon {
    font-size: 1.1rem;
}

.video-date-text {
    font-size: 0.9rem;
}


/* ================================================
   DESCRIPTION
   ================================================ */

.video-desc {
    padding: 10px 15px;
    font-size: 0.85rem !important;
    color: #444;
    text-align: left;
    line-height: 1.4;

    /* let text grow naturally; no clipping */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;

    display: block;
    position: relative;
    margin-top: 0px;
}

/* Default: no gradient */
.video-desc::after {
    content: none;
}

/* Only show fade-out if this description has more text */
.video-desc.video-desc--can-expand:not(.expanded)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2rem;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 1));
    pointer-events: none;
}

/* Expanded → ensure overlay is off (safe redundancy) */
.video-desc.expanded::after {
    content: none;
}

/* EXPANDED STATE: scrollable container */
.video-desc.expanded {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 0.5rem;
}

/* WebKit scrollbar styling (Chrome, Edge, Safari) */
.video-desc.expanded::-webkit-scrollbar {
    width: 6px;
}

.video-desc.expanded::-webkit-scrollbar-track {
    background: transparent;
}

.video-desc.expanded::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}

/* READ MORE / SHOW LESS LINK */
.desc-toggle-link {
    color: #0056b3;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
}

/* Remove this — it was causing clipping */
.video-desc {
    display: block !important;
}


/* ================================================
   VIEW VIDEO BUTTON
   ================================================ */

.view-video-btn {
    background: #002d62;
    color: #ffffff;
    border: none;
    padding: 0.75em 1.25em;
    /* scalable padding */
    font-size: 0.85rem;
    /* scale with user settings */
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    margin-top: auto;
    line-height: 1.4;
    white-space: normal;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);

    /* smooth hover movement */
    transition:
        transform 0.22s ease-out,
        box-shadow 0.22s ease-out,
        background-color 0.22s ease-out;
    will-change: transform, box-shadow;
}

.view-video-btn i {
    font-size: 1em;
    /* icon scales with text */
}

.view-video-btn:hover,
.view-video-btn:focus-visible {
    background: #003d85;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    outline: none;
}

.filter-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

/* When the button is “open”, rotate the arrow up */
.filter-btn-open .filter-arrow {
    transform: rotate(180deg);
}


/* ================================================
   MODAL PLAYER
   ================================================ */

/* BACKDROP (FULLSCREEN) — REQUIRED */
.video-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.75);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 9999;
}

.video-modal.open {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    transform: scale(0.96);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.video-modal.open .video-modal-content {
    transform: scale(1);
    opacity: 1;
}

.video-modal-content {
    position: relative;
    background: #000;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    /* never taller than viewport */
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* video on top, text under */
}

/* Responsive video in modal */
.video-modal iframe,
.video-modal #videoPlayer {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    /* preserve 16:9 */
    max-height: 75vh;
    /* leave room for close button + progress text */
    display: block;
    border: none;
    outline: none;
}

/* Make video modal close button big, high-contrast, and always on top */
.close-btn {
    position: absolute;
    top: -10px;
    right: -7px;
    font-size: 1.8rem;
    line-height: 1;
    color: #ffffff;
    /*background: rgba(0, 0, 0, 0.7);*/
    /* dark pill behind the X */
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    z-index: 10001;

    transition:
        background 0.15s ease,
        transform 0.15s ease,
        opacity 0.15s ease;
}

.close-btn:hover,
.close-btn:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

/* Progress text under the player */
.video-progress-text {
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    /* or center, if you prefer */
    padding: 12px 12px 12px;
}

@media (orientation: landscape) and (max-height: 500px) {
    .video-modal {
        align-items: flex-start;
        /* anchor modal to top instead of center */
        padding-top: 8px;
    }

    .video-modal iframe,
    .video-modal #videoPlayer {
        max-height: 80vh;
        /* slightly shorter video on tiny-height screens */
    }
}

/* ================================================
   FILTER UI
   ================================================ */

.filter-toggle-btn {
    padding: 0.6rem 1rem;
    background: #002d62;
    color: #fff;
    border: 1px solid #002d62;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-toggle-btn .arrow {
    transition: transform 0.25s ease;
}

.filter-toggle-btn.open .arrow {
    transform: rotate(-180deg);
}

.filter-panel {
    display: none;
    position: absolute;
    right: 0;
    top: 60px;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    width: 260px;
    animation: dropdownFade 0.25s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-panel label {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
}

.filter-panel select {
    margin-top: 0.3rem;
    padding: 0.55rem;
    border-radius: 6px;
    border: 1px solid #bfc9d9;
    width: 100%;
    font-size: 0.95rem;
    background: #f6f8fc;
}

/* Keep filter dropdown contained on small screens */
.video-search-filter {
    position: relative;
    /* anchor absolute panel */
    max-width: 100%;
    overflow: visible;
    /* keep shadow visible */
}

.video-search-filter [id$="FilterPanel"],
.video-search-filter .filter-panel {
    right: 0;
    left: auto;
    width: 220px;
    /* was 260px */
    max-width: 90vw;
    /* safety for small screens */
    box-sizing: border-box;
}

/* Even smaller on mobile */
@media (max-width: 600px) {

    .video-search-filter [id$="FilterPanel"],
    .video-search-filter .filter-panel {
        width: 180px;
    }

    .video-search-filter {
        flex-wrap: wrap;
        /* allow search + button to wrap */
    }

    .video-search-filter input[type="text"] {
        min-width: 0;
        /* prevent flex overflow */
        width: 100%;
        flex: 1 1 100%;
    }

    .video-search-filter button {
        width: 100%;
        justify-content: center;
    }

    .video-search-filter [id$="FilterPanel"],
    .video-search-filter .filter-panel {
        left: 0;
        /* align to container on mobile */
        right: 0;
        top: calc(100% + 8px);
        /* drop below bar */
        width: 100%;
    }
}

/* ================================================
   TRAINING HIGHLIGHT BOX
   ================================================ */

.training-highlight {
    background: rgb(232 241 251 / 25%);
    box-shadow: 0 3px 12px rgba(0, 32, 91, 0.18);
    border-left: 6px solid #002d62;
    border-right: 6px solid #002d62;
    border-radius: 10px;
    padding: 1.5rem 1.4rem;
    max-width: 1050px;
    margin: 0 auto 2rem;

    display: block;
    gap: 15px;
    align-items: flex-start;
}

.highlight-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.training-highlight .small-top-img {
    width: 120px;
    border-radius: 6px;
    flex-shrink: 0;
}

.training-highlight p {
    font-size: clamp(0.95rem, 1.1vw + 0.7rem, 1.1rem);
    margin: 0;
    color: #1c1c1c;
    line-height: 1.55;
}

.training-highlight a {
    color: #002d62;
    font-weight: 600;
    text-decoration: underline;
}

.training-highlight a:hover {
    color: #003d73;
    text-decoration: none;
}

@media (max-width: 260px) {
    .highlight-row {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        text-align: center;
    }
}


/* ================================================
   VIEW VIDEO BUTTON + PDF BUTTON LAYOUT / RESPONSIVENESS
   ================================================ */

.pdf-btn {
    background: #b40000;
    color: #fff;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    border: unset !important;
}

.pdf-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    color: #fff;
}

.video-date-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    /* <-- Opacity added */
    color: #fff;
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    z-index: 5;
    backdrop-filter: blur(2px);
    /* optional: adds a frosted look */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.video-btn-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 0 15px 15px;
    margin-top: auto;
}

/* Buttons share the row equally */
.video-btn-row .view-video-btn,
.video-btn-row .pdf-btn {
    flex: 1 1 50%;
    text-align: center;
    white-space: nowrap;
}

/* Prevent wrapping text weirdly */
.video-btn-row button,
.video-btn-row a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Force icons + text to stay on one line */
.pdf-btn i,
.view-video-btn i {
    flex-shrink: 0;
}

/* iPhone-friendly: no squishing */
@media (max-width: 480px) {
    .video-btn-row {
        gap: 8px;
    }

    .video-btn-row .view-video-btn,
    .video-btn-row .pdf-btn {
        font-size: 0.85rem;
        padding: 9px 10px;
    }
}

/* Stack PDF + View Video buttons on very small screens */
@media (max-width: 380px) {
    .video-btn-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .video-btn-row .pdf-btn,
    .video-btn-row .view-video-btn {
        width: 100% !important;
    }
}

/* ================================================
   RESPONSIVE (TABLET + MOBILE)
   ================================================ */

@media (max-width: 1100px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .video-modal iframe {
        height: 380px;
    }
}

@media (max-width: 768px) {
    .training-highlight {
        padding: 1.5rem;
        font-size: 1.05rem;
    }

    .training-highlight .small-top-img {
        width: 80px;
        margin-bottom: 10px;
    }

    .cpspTraining-bckgrnd h2 {
        min-width: 0;
    }
}

@media (max-width: 700px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {

    header h1 {
        font-size: 1.5rem;
    }

    .video-modal-content {
        width: 95%;
    }

    .video-modal iframe {
        height: 250px;
    }

    .training-section h2 {
        font-size: 1.5rem;
    }

    .training-highlight .small-top-img {
        display: none;
    }

    .video-search-filter {
        /*flex-direction: column;*/
        align-items: stretch !important;
    }

    .filter-panel {
        top: 100%;
        width: 100%;
        left: 0;
        right: 0;
    }

    p,
    div,
    strong,
    b,
    em,
    i,
    td,
    th {
        font-size: 0.95rem;
    }
}

.pdf-tooltip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #003366;
    color: #fff;
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    max-width: 240px;
    position: absolute;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    pointer-events: none;
}

.pdf-tip-icon {
    display: inline-flex;
    align-items: center;
    font-size: 0.85rem;
}

.pdf-tip-text {
    line-height: 1.2;
}

.pdf-btn[data-locked="1"] {
    cursor: not-allowed;
    opacity: 0.5;
}

#cpspTrainingDashboard select {
    margin-bottom: 0px !important;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-weight: 700;
}

#bootstrap-support input[type="text"] {
    margin-bottom: 0px !important;
}

/* ================================
   UNFINISHED VIDEOS POPUP (card)
   WITH BLUR + FADE BACKDROP
   ================================ */

.unfinished-popup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;

    /* start slightly lighter + transparent */
    background: rgba(0, 0, 0, 0.18);

    /* blur everything behind the overlay */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    /* fade in/out */
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.28s ease,
        background-color 0.28s ease;
}

/* visible state (JS adds this class) */
.unfinished-popup--visible {
    opacity: 1;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.35);
    /* slightly darker when fully visible */
}

.unfinished-popup__inner {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    padding: 1.6rem 1.8rem 1.3rem;
    max-width: 420px;
    width: 92vw;
    text-align: center;
    border: 1px solid #e0e0e0;
    font-family: inherit;
    border: 4px solid #e0e0e0;
}

/* Close “X” button (JS no longer inserts it, but safe to keep styles) */
.unfinished-popup__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0;
}

.unfinished-popup__close:hover,
.unfinished-popup__close:focus-visible {
    color: #555;
    outline: none;
}

/* Circular progress ring container */
.unfinished-popup__progress-ring {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
}

/* SEGMENTED circular progress ring (thicker, with visible text) */
.unfinished-popup__progress-ring-circle {
    --size: 110px;
    --track-color: #d8d8d8;
    --fill-color: #007784;

    /* segment config */
    --segments: 50;
    --tick: 3deg;
    /* thicker visible segments */
    --gap: 4.5deg;
    /* a bit of space between them */

    /* progress 0–100 (set via JS) */
    --progress: 0;
    --angle: calc(var(--progress) * 3.6deg);

    position: relative;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    /* base: full 360° grey segmented track */
    background:
        repeating-conic-gradient(var(--track-color) 0deg var(--tick),
            transparent var(--tick) var(--gap));
}

/* progress segments (only up to --angle) */
.unfinished-popup__progress-ring-circle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;

    /* same segmented pattern, but in fill color */
    background:
        repeating-conic-gradient(var(--fill-color) 0deg var(--tick),
            transparent var(--tick) var(--gap));

    /* mask to reveal only up to the current angle */
    mask: conic-gradient(#000 0deg var(--angle), transparent var(--angle) 360deg);
    -webkit-mask: conic-gradient(#000 0deg var(--angle), transparent var(--angle) 360deg);

    z-index: 1;
}

/* inner white circle (donut hole) */
.unfinished-popup__progress-ring-circle::after {
    content: "";
    position: absolute;
    inset: 18px;
    /* thickness of the ring */
    border-radius: 50%;
    background: #ffffff;
    z-index: 2;
}

/* percentage text – always on top, never masked */
.unfinished-popup__progress-value {
    position: relative;
    z-index: 3;
    font-size: 1.25rem;
    font-weight: 700;
    color: #007784;
    text-align: center;
    line-height: 1.2;
    width: 100%;
}

/* Title + text */
.unfinished-popup__title {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #005266;
}

.unfinished-popup__intro {
    margin: 0 0 0.9rem;
    font-size: 0.95rem;
    color: #555 !important;
}

/* ===============================
   Clickable video list
   =============================== */

.unfinished-popup__list {
    list-style: none;
    text-align: left;
    margin: 0 0 1.2rem 0;
    padding: 0;
}

/* Row container – clickable “card” */
.unfinished-popup__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #c9e3f2;
    background: #f7fbff;
    cursor: pointer;
    transition:
        background 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.15s ease;
}

/* Hover / focus highlight effect */
.unfinished-popup__item:hover,
.unfinished-popup__item:focus-visible {
    background: #e9f5ff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
    outline: none;
}

/* Play icon at the left */
.unfinished-popup__item-icon {
    font-size: 1rem;
    font-weight: 700;
    color: #007784;
    flex: 0 0 auto;
    pointer-events: none;
}

/* Title text */
.unfinished-popup__video-title {
    flex: 1 1 auto;
    font-size: 0.92rem;
    font-weight: 600;
    color: #113344;
    line-height: 1.3;
    user-select: none;
}

/* Percent pill to the right */
.unfinished-popup__progress-pill {
    flex: 0 0 auto;
    font-size: 0.78rem;
    background: #007784;
    color: #ffffff;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-weight: 700;
}

/* Buttons row */
.unfinished-popup__actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.3rem;
}

.unfinished-popup__btn {
    flex: 1;
    border-radius: 4px;
    padding: 0.55rem 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    max-width: 250px;
    margin: 0 auto;
}

/* Cancel = grey */
.unfinished-popup__btn--cancel {
    background: #007784
        /*#e0e0e0*/
    ;
    color: #fff
        /*#666*/
    ;
}

.unfinished-popup__btn--cancel:hover,
.unfinished-popup__btn--cancel:focus-visible {
    background: #138d9a;
    /*background: #d2d2d2;*/
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Small-screen tweaks */
@media (max-width: 480px) {
    .unfinished-popup__inner {
        padding: 1.3rem 1.1rem 1.1rem;
    }
}

/* =========================================
   LIST ITEM SEPARATORS
   ========================================= */
/*.unfinished-popup__item {
    position: relative;
    padding: 0.45rem 0;
}

.unfinished-popup__item:not(:last-child)::after {
    content: "";
    display: block;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.45);
    margin: 0.45rem 0 0 0;
    width: 100%;
}*/

/* Base badge style */
.video-badge {
    display: inline-block;
    margin-top: 0.65rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.02em;
    user-select: none;
}

/* Completed badge */
.video-badge--complete {
    background: #28a745;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.35);
    text-transform: uppercase;
}

/* In-progress badge */
.video-badge--progress {
    background: #38b6ff;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.35);
    text-transform: uppercase;
}

/* Hover / focus styles (ADA friendly) */
.video-badge:focus,
.video-badge:hover {
    outline: 2px solid #003366;
    outline-offset: 2px;
}

/* ================================
   POPUP FADE + SCALE ANIMATION
   ================================ */

.unfinished-popup {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.unfinished-popup--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Inner “card” animation */
.unfinished-popup__inner {
    transform: scale(0.94);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.unfinished-popup--visible .unfinished-popup__inner {
    transform: scale(1);
    opacity: 1;
}

/*Completed Circular Badge*/
.video-badge--progress-circle {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    margin: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    pointer-events: none;
}

/* Outer ring */
.video-badge__ring {
    --size: 108px;
    --progress: 0;
    --track-color: #37363b;
    --fill-color: #38b6ff;

    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    position: relative;

    background:
        conic-gradient(var(--fill-color) calc(var(--progress) * 1%),
            var(--track-color) 0);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}

/* Default ring color for in-progress state */
.video-badge--progress-circle .video-badge__ring {
    --fill-color: #38b6ff;
    /* or keep #38b6ff if you prefer blue */
}

/* Completed videos: same circle, but green and at 100% */
.video-badge--progress-circle[data-status="complete"] .video-badge__ring {
    --fill-color: #28a745;
}

/* Optional: tweak text color for completed */
.video-badge--progress-circle[data-status="complete"] .video-badge__percent,
.video-badge--progress-circle[data-status="complete"] .video-badge__label {
    color: #1f5129;
}

@media(max-width: 380px) {
    .video-badge--progress-circle {
        top: 12px;
    }

    .video-badge__ring {
        --size: 91px;
    }
}

.video-modal-content.video-modal-content--completed #videoPlayer {
    opacity: 0.12;
    /* fade almost out */
    filter: blur(1px);
    transform: scale(0.98);
}

/* Optional: subtle “completed” glow on background */
.video-modal-content.video-modal-content--completed {
    background: radial-gradient(circle at top, rgba(40, 167, 69, 0.3), #000);
}

/* ================================================
   COMPLETION BANNER WITH DARK TRANSPARENT OVERLAY
   ================================================ */

/* Fullscreen overlay */
.completion-banner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    /* restore opacity background */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 9998;
    /* behind the ring */
}

/* Visible overlay */
/*.completion-banner-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}*/

/* The actual centered banner content */
.completion-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 9999;
    /* above overlay */
    background: transparent;
    padding: 0;
    margin: 0;
    color: #ffffff;
    text-align: center;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 9990;
}

.completion-banner--visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Vertical stack (ring then text) */
.completion-banner__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* ===== BIGGER segmented ring ===== */
.completion-banner__ring-circle {
    --size: 110px;
    --progress: 0;
    --track-color: #d8d8d8;
    --fill-color: #28a745;
    --tick: 3deg;
    --gap: 4deg;

    position: relative;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        repeating-conic-gradient(var(--track-color) 0deg var(--tick),
            transparent var(--tick) calc(var(--tick) + var(--gap)));

    box-shadow: 0 0 12px rgba(40, 167, 69, 0.4);
    animation: completionGlow 2s ease-in-out infinite;
}

.completion-banner__ring-circle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;

    background:
        repeating-conic-gradient(var(--fill-color) 0deg var(--tick),
            transparent var(--tick) calc(var(--tick) + var(--gap)));

    mask: conic-gradient(#000 0deg calc(var(--progress) * 3.6deg),
            transparent calc(var(--progress) * 3.6deg) 360deg);
    -webkit-mask: conic-gradient(#000 0deg calc(var(--progress) * 3.6deg),
            transparent calc(var(--progress) * 3.6deg) 360deg);
}

.completion-banner__ring-circle::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: #ffffff;
}

.completion-banner__ring-value {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
    font-weight: 700;
    color: #28a745;
}

.completion-banner__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #28a745;
}

.completion-banner__subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 600;
    color: #444;
}

/* Glow animation */
@keyframes completionGlow {
    0% {
        box-shadow: 0 0 8px rgba(40, 167, 69, 0.2);
    }

    50% {
        box-shadow: 0 0 24px rgba(40, 167, 69, 0.7);
    }

    100% {
        box-shadow: 0 0 8px rgba(40, 167, 69, 0.2);
    }
}

/* Overlay over the page/video when completion banner is shown */
.completion-banner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    /* opacity back on */
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.completion-banner-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* Completion banner layout is already there; just add button style */
.completion-banner__button {
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    background: #ffffff;
    color: #155724;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.completion-banner__button:hover,
.completion-banner__button:focus-visible {
    background: #f1fff2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    outline: none;
}

/* ================================================
   POST TEST MODAL
   ================================================ */

.posttest-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.posttest-modal--open {
    display: flex;
}

/* Backdrop */
.posttest-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

/* Content card */
.posttest-modal__content {
    max-width: 100%;
    width: 100%;
    max-height: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 10px;
    padding: 1.75rem 1.5rem 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 10;
    /* NEW: keep content above confetti */
    overflow-y: auto;
}

.posttest-modal__title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #002d62;
}

/* Close X */
.posttest-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #777;
}

.posttest-modal__close:hover,
.posttest-modal__close:focus-visible {
    color: #333;
    outline: none;
}

/* Questions */
.posttest-form {
    margin-top: 0.5rem;
}

.posttest-question {
    margin-bottom: 1.1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e1e1e1;
}

.posttest-question__text {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #333;
}

.posttest-options {
    list-style: none;
    margin: 0.2rem 0 0;
    padding: 0;
}

.posttest-options li {
    margin-bottom: 0.25rem;
}

.posttest-options label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Submit button */
.posttest-submit-btn {
    margin-top: 1rem;
    padding: 0.65rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: #002d62;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.98rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.posttest-submit-btn:hover,
.posttest-submit-btn:focus-visible {
    background: #003d85;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.3);
    outline: none;
}

/* Result area */
.posttest-result {
    margin-top: 1.1rem;
    font-size: 0.96rem;
    font-weight: 600;
}

.posttest-result--fail {
    color: #b40000;
}

/* Retake + Certificate buttons */
.posttest-actions {
    margin-top: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.posttest-actions button {
    border-radius: 999px;
    border: none;
    padding: 0.55rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.posttest-actions__retake {
    background: #f0f0f0;
    color: #333;
}

.posttest-actions__retake:hover,
.posttest-actions__retake:focus-visible {
    background: #e2e2e2;
    outline: none;
}

.posttest-actions__certificate {
    background: #28a745;
    color: #ffffff;
}

.posttest-actions__certificate:hover,
.posttest-actions__certificate:focus-visible {
    background: #218838;
    outline: none;
}

/* Small screens */
@media (max-width: 480px) {
    .posttest-modal__content {
        padding: 1.3rem 1.1rem 1.1rem;
    }
}

.video-modal .close-btn:hover,
.video-modal .close-btn:focus {
    color: #ffd700;
    /* yellow on hover */
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
    outline: none;
}

/* When we’re in a dedicated post-test tab, hide the training UI */
body.posttest-only-mode header,
body.posttest-only-mode nav,
body.posttest-only-mode .tabs,
body.posttest-only-mode #videoModal,
body.posttest-only-mode #completionBannerOverlay,
body.posttest-only-mode #unfinishedVideosPopup,
body.posttest-only-mode section,
body.posttest-only-mode .main-content {
    display: none !important;
}

/* But keep the post test modal visible */
body.posttest-only-mode #postTestModal {
    display: block;
    opacity: 1;
    visibility: visible;
}

/* Make the modal behave like a page instead of overlay if you want */
body.posttest-only-mode #postTestModal.posttest-modal--open {
    position: static;
    max-width: 900px;
    margin: 2rem auto;
    box-shadow: none;
}

body.posttest-only-mode .posttest-modal__backdrop {
    display: none !important;
}

/* Example: if you wrap your main content in #trainingPage,
   you can hide it here when in posttest-only mode */
.posttest-only-mode #trainingPage {
    display: none;
}

/* ===== POST TEST: INTRO + PROGRESS + OPTIONS + REVIEW + CONFETTI ===== */

.posttest-intro {
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1.2rem 1.4rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #f3f7ff, #e9f1ff);
    box-shadow: 0 4px 16px rgba(0, 32, 91, 0.10);
    text-align: center;
}

.posttest-intro__text {
    margin: 0 0 0.9rem;
    font-size: 0.98rem;
    color: #3c4968;
}

.posttest-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.45rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #002d62, #0053b3);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.posttest-start-btn:hover,
.posttest-start-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.3);
    outline: none;
}

/* Progress bar */
.posttest-progress {
    margin-bottom: 1.1rem;
}

.posttest-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5edf7;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.posttest-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0053b3, #38b6ff);
    transition: width 0.3s ease;
}

.posttest-progress-text {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5674;
}

/* Question + options */
.posttest-question {
    margin-bottom: 0.9rem;
}

.posttest-question__text {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #002d62;
}

.posttest-options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.posttest-option {
    margin-bottom: 0.45rem;
    border-radius: 10px;
    border: 1px solid #d5dcee;
    background: #f8fafe;
    padding: 0.55rem 0.75rem;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.posttest-option label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
}

.posttest-option input[type="radio"] {
    flex-shrink: 0;
}

.posttest-option--selected {
    border-color: #4b7bd8;
    background: #eef3ff;
    box-shadow: 0 2px 8px rgba(15, 76, 129, 0.16);
}

.posttest-option--correct {
    border-color: #1f7a33;
    background: #e6f6ea;
}

.posttest-option--incorrect {
    border-color: #b40000;
    background: #fde2e2;
}

/* Next / Finish */
.posttest-question-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
}

.posttest-next-btn {
    padding: 0.6rem 1.35rem;
    border-radius: 999px;
    border: none;
    background: #002d62;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.posttest-next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.posttest-next-btn:not(:disabled):hover,
.posttest-next-btn:not(:disabled):focus-visible {
    background: #003d85;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    outline: none;
}

/* Review block for incorrect questions */
.posttest-review {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #dde3f0;
}

.posttest-review__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: #002d62;
}

.posttest-review__item {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: #f7f8fc;
}

.posttest-review__question {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.posttest-review__your-answer {
    font-size: 0.9rem;
    color: #b40000;
}

.posttest-review__correct-answer {
    font-size: 0.9rem;
    color: #1f7a33;
}

/* Welcome / intro layout */
.posttest-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #f6f9ff, #e9f0ff);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    max-width: 850px;
    margin: 1.5rem auto 0 auto;
}

.posttest-intro__title {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.6rem;
    text-align: center;
    font-weight: 700;
    color: #002d62;
}

.posttest-intro__text {
    margin: 0 0 1rem;
    font-size: 1.2rem;
    color: #555;
}

.posttest-intro__media {
    width: 100%;
    max-width: 360px;
    margin: 0 auto 1rem auto;
}

.posttest-intro__thumb {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}

.posttest-intro__start-btn {
    border: none;
    border-radius: 999px;
    padding: 0.6rem 1.6rem;
    font-weight: 700;
    font-size: 0.98rem;
    background: #002d62;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.posttest-intro__start-btn:hover,
.posttest-intro__start-btn:focus-visible {
    background: #003d95;
    outline: none;
}

/* Mobile tweaks */
@media (max-width: 480px) {
    .posttest-intro__title {
        font-size: 1.4rem;
    }
}

/*********** 
Progress bar 
************/
.posttest-progress {
    margin-bottom: 1rem;
}

.posttest-progress-text {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4a5674;
}

/* outer bar */
.posttest-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e3e7f0;
    overflow: hidden;
}

/* Animated progress fill – THIS is the element JS is using */
.posttest-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: #0053b3;
    background-size: 200% 100%;
    transition: width 0.35s ease-out;
}

/* Only animate the gradient while we're moving to a new value */
.posttest-progress-fill--animating {
    animation: posttest-progress-slide 0.8s linear infinite;
}

@keyframes posttest-progress-slide {
    from {
        background-position-x: 0%;
    }

    to {
        background-position-x: -200%;
    }
}

/* Centered pass message */
.posttest-result--pass {
    /* turn it into a centered flex box */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    min-height: 100vh;
    /*60vh*/
    /* pull it into the middle of the chromeless window */
    margin-top: 0;
    /* override earlier margin-top */
    color: #1f7a33;
}

/* Headline text – about 25% larger than the old 0.96rem */
#postTestResult .posttest-result__headline {
    font-size: 3.2rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    color: #002d62 !important;
}

/* Emphasize the percentage a bit more */
.posttest-result__percent {
    font-size: 1.35em;
    /* slightly larger than the headline text */
    color: #28a745;
    /* green to match pass color */
}

/* Option feedback colors (kept for older flow) */
.posttest-option--correct {
    background: #e7f7ec;
    border-radius: 6px;
}

.posttest-option--wrong {
    background: #fde6e6;
    border-radius: 6px;
}

/* Wrong answer review list */
.posttest-review-title {
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
    color: #b40000;
}

.posttest-review-list {
    list-style: disc;
    padding-left: 1.25rem;
}

.posttest-review-correct {
    color: #1f7a33;
    font-weight: 600;
}

@media(max-width: 480px) {
    .posttest-result__headline {
        font-size: 1.8rem;
    }
}

/* =========================================================
   FULL-WINDOW CONFETTI – explosion from center
   ========================================================= */

/* Full viewport layer for confetti, attached to #confettiContainer */
#confettiContainer.confetti-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 11000;
    /* above overlays, below fixed UI if you want */
}

/* Base confetti piece */
.confetti-piece {
    position: absolute;

    /* origin = center of the screen */
    top: 50%;
    left: 50%;

    /* default desktop-ish size */
    width: 8px;
    height: 14px;
    border-radius: 2px;
    opacity: 0.96;

    /* start small at the center; keyframes will move to --dx/--dy */
    transform: translate3d(-50%, -50%, 0) scale(0.2);

    animation-name: confetti-explode;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;

    pointer-events: none;
    z-index: 5;
}

/* Emoji variant – sized by font-size from JS */
.confetti-piece--emoji {
    display: inline-block;
    line-height: 1;
}

/* Explosion keyframes using the JS-provided --dx / --dy and --confetti-rotate */
@keyframes confetti-explode {
    0% {
        transform: translate3d(-50%, -50%, 0) scale(0.2) rotateZ(0deg);
        opacity: 1;
    }

    60% {
        transform: translate3d(var(--dx), var(--dy), 0) scale(1) rotateZ(var(--confetti-rotate, 360deg));
        opacity: 1;
    }

    100% {
        transform: translate3d(calc(var(--dx) * 1.1), calc(var(--dy) * 1.1), 0) scale(0.9) rotateZ(calc(var(--confetti-rotate, 360deg) + 45deg));
        opacity: 0;
    }
}

.posttest-result__instructions {
    margin-top: 1rem;
    font-size: 1.2rem;
    color: #335;
}

.posttest-certificate-btn {
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: #28a745;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.posttest-certificate-btn:hover,
.posttest-certificate-btn:focus-visible {
    background: #218838;
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ===============================
   MOBILE RESPONSIVE TWEAKS
   =============================== */

/* Phones / narrow screens */
@media (max-width: 600px) {
    .confetti-piece {
        width: 6px;
        height: 10px;
        opacity: 0.9;
    }
}

/* Extra-small screens */
@media (max-width: 400px) {
    .confetti-piece {
        width: 5px;
        height: 8px;
        opacity: 0.85;
    }
}

.url-link {
    word-break: break-all;
}

.no-videos-message {
    width: 100%;
    max-width: 720px;
    margin: 1.25rem auto;
    padding: 1rem 1.15rem;

    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.45;

    color: #002d62 !important;
}

.cpsp-video-row__sub {
    font-weight: 650;
}

/* =========================
   VIDEO COMPLETION OVERLAY (RESTORED)
   ========================= */
#completionBannerOverlay {
    position: fixed;
    inset: 0;
    z-index: 100005;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

/*#completionBannerOverlay.completion-banner-overlay--visible{
  display: flex;
}*/

#completionBanner {
    display: none;
    background: #fff;
    color: #111827;
    width: min(560px, 100%);
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
    border: 1px solid rgba(17, 24, 39, .12);
    padding: 18px;
}

#completionBanner.completion-banner--visible {
    display: block;
}

#completionBanner h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

#completionBanner p {
    margin: 0 0 14px 0;
    color: #374151;
    line-height: 1.4;
}

#completionBanner .completion-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#unlockPostTestBtn {
    appearance: none;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #0b5fff;
    background: #0b5fff;
    color: #fff;
    font-weight: 800;
}

#unlockPostTestBtn:hover {
    filter: brightness(1.05);
}

#unlockPostTestBtn:focus {
    outline: 3px solid rgba(147, 197, 253, .95);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    #completionBanner {
        padding: 14px;
        border-radius: 16px;
    }

    #completionBanner .completion-banner__actions {
        justify-content: stretch;
    }

    #unlockPostTestBtn {
        width: 100%;
    }
}

/* =========================
   TABLET (481px–750px)
   ONE centered row:
   Pills + Continue + Reset
   ========================= */
@media (min-width: 481px) and (max-width: 809px) {

    /* Parent row behavior */
    .cpsp-dashboard__row {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
    }

    /* Title gets its own full row */
    .cpsp-dashboard__title {
        flex: 0 0 100% !important;
        text-align: center !important;
        font-size: 1.3rem !important;
    }

    /* META + ACTIONS MUST BE INLINE AND NOT WRAP */
    .cpsp-dashboard__meta,
    .cpsp-dashboard__actions {
        display: inline-flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
    }

    /* Force them to live on the SAME row */
    .cpsp-dashboard__meta {
        order: 1 !important;
    }

    .cpsp-dashboard__actions {
        order: 2 !important;
    }

    /* Prevent pills & buttons from stretching */
    .cpsp-dashboard__meta .cpsp-pill,
    .cpsp-dashboard__actions .cpsp-dashboard__btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    /* Slightly tighter buttons for tablet */
    .cpsp-dashboard__btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

/* =========================
   DASHBOARD BUTTONS: DISABLED UX
   (Continue / Reset Progress)
   ========================= */

/* Disabled base look */
.cpsp-dashboard__btn[disabled],
.cpsp-dashboard__btn.disabled {
    opacity: .55;
    cursor: not-allowed !important;
    filter: none !important;
    box-shadow: none !important;

    background: #e5e7eb !important;
    /* gray-200 */
    color: #6b7280 !important;
    /* gray-500 */
    border-color: #d1d5db !important;
    /* gray-300 */
}

/* Prevent the hover “brighten” effect from your normal styles */
.cpsp-dashboard__btn[disabled]:hover,
.cpsp-dashboard__btn.disabled:hover {
    filter: none !important;
    transform: none !important;
}

/* Icon appears on hover/focus to indicate “not clickable” */
.cpsp-dashboard__btn[disabled]::after,
.cpsp-dashboard__btn.disabled::after {
    content: "";
    display: inline-block;
    font-weight: 900;
    opacity: 0;
    /* hidden until hover/focus */
    transform: translateY(1px);
}

/* Show icon on hover (note: some browsers don’t apply :hover on disabled) */
.cpsp-dashboard__btn[disabled]:hover::after,
.cpsp-dashboard__btn.disabled:hover::after {
    opacity: 1;
}

/* Show icon on keyboard focus */
.cpsp-dashboard__btn[disabled]:focus::after,
.cpsp-dashboard__btn[disabled]:focus-visible::after,
.cpsp-dashboard__btn.disabled:focus::after,
.cpsp-dashboard__btn.disabled:focus-visible::after {
    opacity: 1;
}

/* Optional: visible focus ring even when disabled (keyboard users) */
.cpsp-dashboard__btn[disabled]:focus-visible,
.cpsp-dashboard__btn.disabled:focus-visible {
    outline: 3px solid rgba(147, 197, 253, .95);
    outline-offset: 2px;
}

.cpsp-prompt {
    position: relative;
    /* Ensures that the close button is positioned relative to the prompt container */
    padding: 20px;
    /* Adds space inside the prompt for better appearance */
    border-radius: 8px;
    /* Adds rounded corners to the prompt */
    background-color: #f0f4f8;
    /* Set a soft light background color for the prompt */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Adds a subtle shadow for depth */
}

.cpsp-prompt__close {
    position: absolute;
    top: -12px;
    right: -12px;
    background-color: #e0e0e0 !important;
    border: none;
    font-size: 1.6rem !important;
    /* Adjust the font size */
    color: #333 !important;
    cursor: pointer;
    border-radius: 50% !important;
    padding: 0;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    height: 30px;
    width: 30px;
    display: flex;
    /* Use flexbox to center content */
    align-items: center;
    /* Vertically center the "×" */
    justify-content: center;
    /* Horizontally center the "×" */
}

.cpsp-prompt__close:hover {
    background-color: #b3b3b3;
    /* Darker gray background on hover */
    color: #fff;
    /* Change text color to white on hover */
    transform: scale(1.1);
    /* Slight zoom effect when hovered */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    /* Add a subtle shadow on hover */
}

.cpsp-prompt__close:focus {
    outline: none;
    /* Removes default focus outline */
    box-shadow: 0 0 0 2px rgba(0, 0, 255, 0.5);
    /* Adds a custom focus effect */
}

/* Basic styling for the overlay */
.video-overlay {
    position: fixed;
    /* Ensure it's positioned on top of the content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Semi-transparent background */
    display: none;
    /* Initially hidden */
    justify-content: center;
    /* Center the content */
    align-items: center;
    /* Center the message vertically */
    z-index: 9999;
    /* Ensure it is above other content */
}

/* Styling for the overlay message */
.video-overlay-message {
    color: white;
    font-size: 1.5rem;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    text-align: center;
}

/* Close button styling */
.video-overlay-close {
    margin-top: 20px;
    padding: 10px 20px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.video-overlay-close:hover {
    background-color: #e94e4e;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        /* Black shadow with moderate opacity */
    }

    50% {
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
        /* Stronger black shadow at peak */
    }

    100% {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
        /* Return to original state */
    }
}

.video-card.highlighted {
    border: 2px solid #555;
    /* Blue border to highlight */
    animation: pulse 1.5s infinite;
    /* Apply the pulse animation */
}

.video-card {
    position: relative;
}

.completed-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .6px;
    background: rgba(0, 0, 0, .75);
    color: #fff;
    pointer-events: none;
}

.post-test-overlay {
    border-radius: 10px;
}

/* If it’s inside your grid, make it span the full row */
.video-grid .no-videos-message {
    grid-column: 1 / -1;
    justify-self: center;
}

/* Required for the seek blocker overlay */
#videoModal .video-modal-content {
    position: relative;
}

.note {
    max-width: 750px;
    margin: 10px auto 0 auto;

    padding: 12px 14px;
    background-color: #efe2b8;
    border-left: 4px solid #9c7b2f;
    border-right: 4px solid #9c7b2f;
    border-radius: 6px;
    color: #3b2f1a;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

.note u {
    font-weight: 600;
}

.privacy-note {
    margin-top: -0.75rem;
    padding: 12px 14px;
    background-color: #f7f3e8;
    border-left: 4px solid #e6d3a3;
    border-right: 4px solid #e6d3a3;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #374151;
    line-height: 1.5;
    text-align: center;
}

.privacy-note u {
    font-weight: 600;
}

/* Blocks clicking the timeline area (but leaves edges for play/pause/volume more usable) */
#videoModal.no-scrub .seek-blocker {
    position: absolute;
    left: 80px;
    right: 80px;
    bottom: 8px;
    height: 36px;
    z-index: 9999;
    background: transparent;
    pointer-events: auto;
}

/* Optional: improve coverage on WebKit by hiding the timeline itself */

#videoModal.no-scrub video::-webkit-media-controls-timeline {
    display: none !important;
}

#videoModal.no-scrub video::-webkit-media-controls-seek-back-button,
#videoModal.no-scrub video::-webkit-media-controls-seek-forward-button {
    display: none !important;
}