/* /Components/Pages/CourseDetails.razor.rz.scp.css */
/* CourseDetails curriculum - CSS Isolation */

.course-topic-list[b-drpybt7w61] {
    list-style: none !important;
    margin: 0 !important;
    padding: 18px 24px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    border-top: 1px solid var(--line, #e2e8f0);
}

.course-topic[b-drpybt7w61] {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 54px !important;
    margin: 0 !important;
    padding: 9px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    border: 1px solid #dfe8ee !important;
    border-radius: 12px !important;
    background: #fff !important;
    list-style: none !important;
    direction: rtl !important;
    box-shadow: 0 1px 2px rgba(15,42,67,.03) !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease !important;
}

.course-topic:nth-child(odd)[b-drpybt7w61] { background: #f5f9fc !important; }
.course-topic:nth-child(even)[b-drpybt7w61] { background: #fff !important; }

.course-topic:hover[b-drpybt7w61] {
    transform: translateY(-1px) !important;
    border-color: #b9d2df !important;
    background: #edf7fb !important;
    box-shadow: 0 8px 20px rgba(15,42,67,.10) !important;
}

.course-topic-free[b-drpybt7w61] {
    background: #fff9e6 !important;
    border-color: #efd58b !important;
}

.course-topic-free:hover[b-drpybt7w61] {
    background: #fff2ca !important;
    border-color: #e3bd4e !important;
    box-shadow: 0 8px 20px rgba(196,137,0,.14) !important;
}

.course-topic-main[b-drpybt7w61] {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    direction: rtl !important;
}

.course-topic-index[b-drpybt7w61] {
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 9px !important;
    background: #e3f1f6 !important;
    color: #087ea4 !important;
    font: 800 9px/1 Tahoma,Arial,sans-serif !important;
    direction: ltr !important;
}

.course-topic-free .course-topic-index[b-drpybt7w61] {
    background: #ffedb8 !important;
    color: #a46900 !important;
}

.course-topic-icon[b-drpybt7w61] {
    flex: 0 0 31px !important;
    width: 31px !important;
    height: 31px !important;
    min-width: 31px !important;
    max-width: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 9px !important;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", Arial, sans-serif !important;
    font-size: 15px !important;
    line-height: 1 !important;
}

.course-topic-icon-normal[b-drpybt7w61] { background: #e8f1f5 !important; }
.course-topic-icon-file[b-drpybt7w61] { background: #e5f0ff !important; }
.course-topic-icon-free[b-drpybt7w61] { background: #ffe8a3 !important; color: #d37a00 !important; font-family: Arial,sans-serif !important; font-size: 12px !important; }

.course-topic-title[b-drpybt7w61] {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: #29465c !important;
    font-family: Tahoma,Arial,sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.75 !important;
}

.course-topic-free-link[b-drpybt7w61] {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    color: #865e00 !important;
    text-decoration: none !important;
}

.course-topic-free-link:hover[b-drpybt7w61] { color: #b56d00 !important; }

.course-topic-free-link > span:first-child[b-drpybt7w61] {
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.course-topic-free-badge[b-drpybt7w61] {
    flex: 0 0 20px !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    line-height: 1 !important;
}

.course-topic-actions[b-drpybt7w61] {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.course-topic-actions form[b-drpybt7w61] { margin: 0 !important; padding: 0 !important; display: block !important; }

.course-topic-download[b-drpybt7w61],
.course-topic-lock[b-drpybt7w61] {
    flex: 0 0 31px !important;
    width: 31px !important;
    height: 31px !important;
    min-width: 31px !important;
    max-width: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9px !important;
    font: 800 14px/1 Arial,sans-serif !important;
}

.course-topic-download[b-drpybt7w61] {
    border: 1px solid #c9def4 !important;
    background: #edf6ff !important;
    color: #2572c4 !important;
    cursor: pointer !important;
    transition: .18s ease !important;
}

.course-topic-download:hover[b-drpybt7w61] {
    background: #dceeff !important;
    border-color: #a8cbed !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(37,114,196,.15) !important;
}

.course-topic-lock[b-drpybt7w61] {
    border: 1px solid #dce5eb !important;
    background: #f1f5f8 !important;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", Arial, sans-serif !important;
    font-size: 13px !important;
}

@media (max-width: 680px) {
    .course-topic-list[b-drpybt7w61] { padding: 12px 10px 16px !important; gap: 7px !important; }
    .course-topic[b-drpybt7w61] { min-height: 47px !important; padding: 7px 8px !important; gap: 8px !important; }
    .course-topic-main[b-drpybt7w61] { gap: 6px !important; }
    .course-topic-index[b-drpybt7w61] { flex-basis: 28px !important; width: 28px !important; height: 28px !important; min-width: 28px !important; max-width: 28px !important; min-height: 28px !important; max-height: 28px !important; font-size: 8px !important; }
    .course-topic-icon[b-drpybt7w61] { flex-basis: 27px !important; width: 27px !important; height: 27px !important; min-width: 27px !important; max-width: 27px !important; min-height: 27px !important; max-height: 27px !important; font-size: 13px !important; }
    .course-topic-icon-free[b-drpybt7w61] { font-size: 11px !important; }
    .course-topic-title[b-drpybt7w61] { font-size: 12px !important; }
    .course-topic-free-badge[b-drpybt7w61] { flex-basis: 18px !important; width: 18px !important; height: 18px !important; min-width: 18px !important; max-width: 18px !important; min-height: 18px !important; max-height: 18px !important; font-size: 11px !important; }
    .course-topic-download[b-drpybt7w61], .course-topic-lock[b-drpybt7w61] { flex-basis: 27px !important; width: 27px !important; height: 27px !important; min-width: 27px !important; max-width: 27px !important; min-height: 27px !important; max-height: 27px !important; }
}
'''
Path(f'{out}/src/Presentation/Web/Components/Pages/CourseDetails.razor.css').write_text(css,encoding='utf-8')
# App.razor: add the CSS isolation bundle. Keep all existing links unchanged.
app=Path('/mnt/data/icode-src/icode/src/Presentation/Web/Components/App.razor').read_text(encoding='utf-8-sig')
needle='    <link rel="stylesheet" href="app.css" />\n'
if 'href="Web.styles.css"' not in app:
    app=app.replace(needle, needle+'    <link rel="stylesheet" href="Web.styles.css" />\n')
Path(f'{out}/src/Presentation/Web/Components/App.razor').write_text(app,encoding='utf-8')
PY
cd "$OUT" && zip -qr /mnt/data/icode-course-topics-clean-final.zip .
ls -lh /mnt/data/icode-course-topics-clean-final.zip
unzip -l /mnt/data/icode-course-topics-clean-final.zip[b-drpybt7w61]
/* /Components/Shared/CourseCard.razor.rz.scp.css */
/* CourseCard isolated styling.
   The important fix: .course-image is a block-level box with a real height.
   The old anchor was inline, so its height:205px did not constrain the image. */

.course-card[b-yx4p53uwz2] {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.course-image[b-yx4p53uwz2] {
    position: relative;
    display: block;
    flex: 0 0 205px;
    width: 100%;
    height: 205px;
    min-height: 205px;
    overflow: hidden;
    background: #dfeaf2;
    isolation: isolate;
}

.course-image img[b-yx4p53uwz2] {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    object-fit: cover;
    object-position: center;
    transition: transform .3s ease;
}

.course-card:hover .course-image img[b-yx4p53uwz2] {
    transform: scale(1.025);
}

.course-image span[b-yx4p53uwz2] {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 9px;
    background: rgba(255,255,255,.93);
    color: #102a43;
    font-size: 11px;
    line-height: 1.5;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(15,42,67,.10);
}

.course-card-body[b-yx4p53uwz2] {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    padding: 20px 22px 22px;
    background: #fff;
}

.course-card h3[b-yx4p53uwz2] {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.55;
}

.course-card h3 a[b-yx4p53uwz2] {
    display: block;
    color: #102a43;
    transition: color .18s ease;
}

.course-card h3 a:hover[b-yx4p53uwz2] {
    color: #087ea4;
}

.course-card p[b-yx4p53uwz2] {
    height: auto;
    min-height: 58px;
    max-height: 58px;
    overflow: hidden;
    margin: 0 0 18px;
    color: #5d7184;
    font-size: 13px;
    line-height: 1.85;
}

.course-meta[b-yx4p53uwz2] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #dce6ee;
    font-size: 13px;
}

.course-meta strong[b-yx4p53uwz2] {
    color: #087ea4;
    white-space: nowrap;
}

.course-meta a[b-yx4p53uwz2] {
    font-weight: 700;
    color: #102a43;
    white-space: nowrap;
    transition: color .18s ease, transform .18s ease;
}

.course-meta a:hover[b-yx4p53uwz2] {
    color: #087ea4;
    transform: translateX(-2px);
}

@media (max-width: 680px) {
    .course-image[b-yx4p53uwz2] {
        flex-basis: auto;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .course-image img[b-yx4p53uwz2] {
        height: 100%;
    }

    .course-card-body[b-yx4p53uwz2] {
        padding: 18px;
    }

    .course-card h3[b-yx4p53uwz2] {
        font-size: 17px;
    }
}
