section { padding: 2.5rem 0; position: relative; }

.bg-hero {
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    color: #fff;
    padding: 2.5rem 0 4rem;
    position: relative; overflow: hidden;
}
.bg-hero::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.09) 1px, transparent 1.5px);
    background-size: 22px 22px;
    pointer-events: none;
    mask-image: linear-gradient(135deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.35) 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(135deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.35) 60%, transparent 100%);
}
.bg-hero::after {
    content: ''; position: absolute;
    top: -150px; right: -150px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%);
    border-radius: 50%; pointer-events: none;
}
.bg-hero .container { position: relative; z-index: 2; }

.dv-breadcrumb {
    display: flex; align-items: center; gap: .5rem;
    font-size: .82rem; color: rgba(255,255,255,.6);
    margin-bottom: 1rem; font-weight: 500; flex-wrap: wrap;
}
.dv-breadcrumb a { color: #a5b4fc; text-decoration: none; transition: .2s; }
.dv-breadcrumb a:hover { color: #fff; }
.dv-breadcrumb .sep { opacity: .5; }
.dv-breadcrumb .active { color: rgba(255,255,255,.75); max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dv-title {
    font-size: 2.15rem; font-weight: 800; letter-spacing: -.03em;
    line-height: 1.2; color: #fff; margin-bottom: 1rem;
}

.dv-meta-row {
    display: flex; flex-wrap: wrap; gap: .5rem;
    margin-bottom: 1rem;
}
.dv-meta-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .85rem;
    border-radius: 50px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.9);
    font-size: .78rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
}
.dv-meta-pill i { color: #a5b4fc; font-size: .9rem; }

.dv-stats { margin-top: -3rem; padding: 0 0 2.5rem; position: relative; z-index: 5; }
.dv-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 768px) { .dv-stats-grid { grid-template-columns: 1fr; } }
.stat-card {
    background: #fff; border-radius: 1.25rem; padding: 1.35rem 1rem; text-align: center;
    border: 1px solid #e5e7eb; box-shadow: 0 12px 32px rgba(15,23,42,.08);
    transition: .3s; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0); transform-origin: left; transition: transform .4s;
}
.stat-card:hover::before { transform: scaleX(1); }
.stat-card:hover { transform: translateY(-6px); }
.stat-card .icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; margin-bottom: .65rem;
}
.stat-card .val { font-size: 1.65rem; font-weight: 800; color: #0f172a; letter-spacing: -.04em; line-height: 1; }
.stat-card .lbl { font-size: .72rem; color: #64748b; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-top: .35rem; }

.bg-body {
    background-color: #f8fafc;
    background-image:
        radial-gradient(circle, rgba(99,102,241,.09) 1px, transparent 1.5px),
        radial-gradient(circle at 20% 10%, rgba(99,102,241,.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(168,85,247,.04) 0%, transparent 40%);
    background-size: 26px 26px, 100% 100%, 100% 100%;
}
.bg-related {
    background-color: #ffffff;
    background-image: radial-gradient(circle, rgba(15,23,42,.06) 1px, transparent 1.5px);
    background-size: 24px 24px;
    background-position: 12px 12px;
}

.head-left {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1.5rem; margin-bottom: 1.5rem; padding-bottom: .85rem;
    border-bottom: 1px solid #e5e7eb; flex-wrap: wrap;
}
.head-left .text { position: relative; padding-left: 1.25rem; }
.head-left .text::before {
    content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
    width: 4px; border-radius: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}
.head-left .head-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .22rem .7rem; border-radius: 50px;
    background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(168,85,247,.12));
    color: var(--primary); font-size: .66rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .1em; margin-bottom: .4rem;
}
.head-left h2 {
    font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em;
    margin-bottom: .15rem; color: #0f172a;
}
.head-left h2 .text-grad {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.head-left p { color: #64748b; margin: 0; font-size: .85rem; }

/* Original post card */
.post-card {
    background: #fff;
    border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
@media (max-width: 576px) { .post-card { padding: 1.5rem; } }
.post-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
}
.post-card .post-head {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.post-card .avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(99,102,241,.3);
}
.post-card .author-info { flex: 1; min-width: 0; }
.post-card .author-info .name {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.05rem;
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.post-card .author-info .role-tag {
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .2rem .6rem;
    border-radius: 50px;
    background: #eef2ff;
    color: var(--primary);
}
.post-card .author-info .role-tag.instructor { background: #cffafe; color: #0e7490; }
.post-card .author-info .role-tag.admin { background: #ede9fe; color: #6d28d9; }
.post-card .author-info .time {
    font-size: .82rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.post-card .post-content {
    font-size: 1.02rem;
    line-height: 1.75;
    color: #334155;
    padding-left: 72px;
    word-wrap: break-word;
}
@media (max-width: 576px) { .post-card .post-content { padding-left: 0; } }
.post-card .post-content p { margin-bottom: 1rem; }
.post-card .post-content p:last-child { margin-bottom: 0; }

.post-card .post-actions {
    display: flex;
    gap: .5rem;
    padding-top: 1.25rem;
    margin-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
    padding-left: 72px;
    flex-wrap: wrap;
}
@media (max-width: 576px) { .post-card .post-actions { padding-left: 0; } }
.post-action-btn {
    padding: .5rem 1.15rem;
    border-radius: 50px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: .82rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: .2s;
    cursor: pointer;
}
.post-action-btn:hover { background: #eef2ff; color: var(--primary); border-color: rgba(99,102,241,.25); }
.post-action-btn.danger:hover { background: #fef2f2; color: #ef4444; border-color: rgba(239,68,68,.25); }

/* Reply cards */
.reply-card {
    background: #fff;
    border-radius: 1.15rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 10px rgba(15,23,42,.04);
    padding: 1.35rem;
    margin-bottom: .85rem;
    display: flex;
    gap: 1rem;
    transition: .25s;
}
.reply-card:hover { border-color: rgba(99,102,241,.25); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.reply-card.op { border-color: rgba(99,102,241,.35); background: linear-gradient(90deg, rgba(99,102,241,.03), #fff); }
.reply-card .avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem;
    flex-shrink: 0;
}
.reply-card .body { flex: 1; min-width: 0; }
.reply-card .head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}
.reply-card .name {
    font-weight: 800;
    color: #0f172a;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.reply-card .role-tag {
    font-size: .65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15rem .55rem;
    border-radius: 50px;
    background: #eef2ff;
    color: var(--primary);
}
.reply-card .role-tag.instructor { background: #cffafe; color: #0e7490; }
.reply-card .role-tag.admin { background: #ede9fe; color: #6d28d9; }
.reply-card .role-tag.op-tag { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.reply-card .when {
    font-size: .76rem;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}
.reply-card .content {
    color: #475569;
    font-size: .92rem;
    line-height: 1.7;
    word-wrap: break-word;
}
.reply-card .content p { margin-bottom: .75rem; }
.reply-card .content p:last-child { margin-bottom: 0; }

/* Reply form */
.reply-form-card {
    background: #fff;
    border-radius: 1.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
    padding: 1.75rem;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}
.reply-form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.reply-form-card h5 {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.05rem;
    margin-bottom: .35rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.reply-form-card h5 i { color: var(--primary); }
.reply-form-card .sub { color: #64748b; font-size: .85rem; margin-bottom: 1.25rem; }

.form-control-modern {
    width: 100%;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    padding: .9rem 1.15rem;
    font-size: .95rem;
    transition: .2s;
    background: #f8fafc;
    outline: none;
    font-family: inherit;
    resize: vertical;
    min-height: 130px;
}
.form-control-modern:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}

.submit-btn {
    padding: .85rem 2rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border: 0;
    font-weight: 800;
    font-size: .92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: .25s;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(99,102,241,.28);
    margin-top: 1rem;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(99,102,241,.42); }

.login-prompt {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #e0e7ff;
    text-align: center;
}
.login-prompt i { font-size: 2rem; color: var(--primary); margin-bottom: .75rem; display: block; }
.login-prompt p { color: #475569; font-size: .92rem; margin-bottom: 1rem; }
.login-prompt a {
    padding: .7rem 1.75rem;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    box-shadow: 0 8px 20px rgba(99,102,241,.25);
}
.login-prompt a:hover { color: #fff; transform: translateY(-2px); }

.alert-modern {
    border-radius: 14px;
    border: 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    font-size: .92rem;
}
.alert-modern.success { background: #ecfdf5; color: #065f46; border-left: 4px solid #10b981; }
.alert-modern.error { background: #fef2f2; color: #991b1b; border-left: 4px solid #ef4444; }
.alert-modern i { font-size: 1.15rem; flex-shrink: 0; margin-top: .1rem; }

.empty-mini {
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-mini i { font-size: 2.75rem; color: #cbd5e1; margin-bottom: 1rem; display: block; }
.empty-mini h5 { font-weight: 800; color: #0f172a; font-size: 1.15rem; margin-bottom: .5rem; }
.empty-mini p { color: #64748b; margin: 0; font-size: .9rem; }

/* Sidebar */
.sidebar-card {
    background: #fff;
    border-radius: 1.25rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 16px rgba(15,23,42,.05);
    padding: 1.35rem;
    margin-bottom: 1rem;
    position: sticky;
    top: calc(var(--header-h) + var(--subnav-h) + 1rem);
}
.sidebar-card h6 {
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}
.sidebar-card h6 i { color: var(--primary); }

.course-mini {
    display: flex;
    gap: .75rem;
    text-decoration: none;
    color: inherit;
    padding: .5rem 0;
    transition: .2s;
}
.course-mini:hover { color: var(--primary); }
.course-mini .thumb {
    width: 60px; height: 60px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}
.course-mini .thumb-placeholder {
    width: 60px; height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.course-mini .info { flex: 1; min-width: 0; }
.course-mini .info .t {
    font-weight: 700;
    color: #0f172a;
    font-size: .9rem;
    line-height: 1.35;
    margin-bottom: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-mini:hover .info .t { color: var(--primary); }
.course-mini .info .s { font-size: .74rem; color: #94a3b8; }

.action-btn {
    width: 100%;
    padding: .75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    transition: .2s;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}
.action-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 10px 26px rgba(99,102,241,.28);
}
.action-btn.primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(99,102,241,.4); }
.action-btn.soft { background: #f1f5f9; color: #475569; }
.action-btn.soft:hover { background: #e2e8f0; color: #1e293b; }

.bg-cta {
    background:
        radial-gradient(circle at top right, rgba(255,255,255,.14) 0%, transparent 45%),
        linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; padding: 3.5rem 0;
    position: relative; overflow: hidden;
}
.bg-cta::before {
    content: ''; position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1.5px);
    background-size: 20px 20px;
    pointer-events: none;
    mask-image: linear-gradient(135deg, transparent 0%, rgba(0,0,0,.85) 50%, rgba(0,0,0,.4) 100%);
    -webkit-mask-image: linear-gradient(135deg, transparent 0%, rgba(0,0,0,.85) 50%, rgba(0,0,0,.4) 100%);
}
.bg-cta .container { position: relative; z-index: 2; }

@media (max-width: 992px) {
    .dv-title { font-size: 1.65rem; }
    .head-left h2 { font-size: 1.25rem; }
    .sidebar-card { position: static; }
}
@media (max-width: 576px) {
    .dv-title { font-size: 1.35rem; }
    .post-card .post-content { padding-left: 0; font-size: .95rem; }
    .stat-card .val { font-size: 1.35rem; }
}