/* ── LearnDash Task Hierarchy — Front-end Styles v2.0 ───────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   TASK DEDICATED PAGE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Task Page Wrapper ─────────────────────────────────────────────────────── */
.ld-task-page-wrap {
    max-width: 100%;
}

/* ── Content Area ───────────────────────────────────────────────────────────── */
.ld-task-content-area {
    margin-bottom: 40px;
}

/* ── Prev / Next Navigation ─────────────────────────────────────────────────── */
.ld-task-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.ld-task-nav-prev,
.ld-task-nav-next {
    flex: 1;
}

.ld-task-nav-next {
    text-align: right;
}

.ld-task-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    background: #fff;
    transition: background 0.15s, border-color 0.15s;
    max-width: 100%;
}

.ld-task-nav-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    text-decoration: none;
}

.ld-task-nav-btn--finish {
    border-color: #10b981;
    color: #065f46;
    background: #ecfdf5;
}

.ld-task-nav-btn--finish:hover {
    background: #d1fae5;
    color: #065f46;
}

.ld-task-nav-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ld-task-nav-hint {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    font-weight: 500;
}

.ld-task-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ld-task-nav-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #6b7280;
}

.ld-task-nav-btn--finish .dashicons {
    color: #10b981;
}

/* ── Mobile ─────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ld-task-nav {
        flex-direction: column;
    }
    .ld-task-nav-next {
        text-align: left;
    }
    .ld-task-nav-btn {
        width: 100%;
    }
    .ld-task-nav-title {
        max-width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR TASK SUB-LIST
   Tasks appear indented below their parent Topic in the LD30 Focus Mode sidebar.
   We inject a .ld-task-items-list container after the topic's .ld-table-list-item.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Container injected after the topic row */
.ld-task-items-list {
    padding-left: 0 !important;
    margin: 0 !important;
    border-top: none !important;
}

/* Each task row — same structure as LD30 topic rows but indented */
.ld-task-items-list .ld-table-list-item {
    padding-left: 0;
}

.ld-task-items-list .ld-table-list-item-preview {
    padding-left: 36px !important; /* indent to show hierarchy */
    font-size: 13px;
}

/* Task title text */
.ld-task-items-list .ld-task-title {
    font-size: 13px;
    color: inherit;
}

/* Current task highlight — orange */
.ld-task-items-list .ld-is-current-item {
    background: rgba(234, 88, 12, 0.85);
    font-weight: 600;
    border-radius: 4px;
}

.ld-task-items-list .ld-is-current-item .ld-task-title {
    color: #fff;
}

/* Completed task icon color */
.ld-task-items-list .learndash-complete .ld-status-icon {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
}

/* Separator line above the task list */
.ld-task-items-list .ld-table-list-items {
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOPIC PAGE — INLINE TASK LIST
   Rendered server-side inside the topic content area.
   Visible on both mobile and desktop without opening the sidebar.
   ═══════════════════════════════════════════════════════════════════════════ */

.ld-topic-task-list {
    margin: 28px 0 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    font-family: inherit;
}

/* Header row: "2 / 5 Tasks Complete" */
.ld-topic-task-list__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ld-topic-task-list__icon {
    font-size: 14px;
    color: #6b7280;
    flex-shrink: 0;
}

/* When all tasks done, header goes green */
.ld-topic-task-list.all-done .ld-topic-task-list__header {
    background: #ecfdf5;
    border-bottom-color: #a7f3d0;
    color: #065f46;
}

.ld-topic-task-list.all-done .ld-topic-task-list__icon {
    color: #10b981;
}

/* Task list */
.ld-topic-task-list__items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ld-topic-task-list__item {
    border-bottom: 1px solid #f3f4f6;
}

.ld-topic-task-list__item:last-child {
    border-bottom: none;
}

/* Each task row link */
.ld-topic-task-list__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    transition: background 0.12s;
}

.ld-topic-task-list__link:hover {
    background: #f9fafb;
    text-decoration: none;
    color: #111827;
}

/* Status dot */
.ld-topic-task-list__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    flex-shrink: 0;
    display: inline-block;
    transition: background 0.15s, border-color 0.15s;
}

.ld-topic-task-list__item.is-complete .ld-topic-task-list__dot {
    background: #10b981;
    border-color: #10b981;
}

/* Task name */
.ld-topic-task-list__name {
    flex: 1;
    color: inherit;
}

.ld-topic-task-list__item.is-complete .ld-topic-task-list__name {
    color: #6b7280;
}

/* Checkmark for completed tasks */
.ld-topic-task-list__check {
    font-size: 13px;
    color: #10b981;
    font-weight: 700;
    flex-shrink: 0;
}

/* Mobile: slightly larger tap targets */
@media (max-width: 600px) {
    .ld-topic-task-list__link {
        padding: 13px 16px;
        font-size: 15px;
    }
    .ld-topic-task-list__dot {
        width: 16px;
        height: 16px;
    }
}

/* ── Incomplete tasks warning notice ──────────────────────────────────────── */
#ld-task-incomplete-notice {
    background: #fff3cd;
    border: 2px solid #f0ad4e;
    border-left: 5px solid #e67e22;
    border-radius: 4px;
    color: #7a4f00;
    font-size: 14px;
    line-height: 1.5;
    margin: 16px 0;
    padding: 12px 16px;
    animation: ld-task-notice-fadein 0.3s ease;
}

@keyframes ld-task-notice-fadein {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
