/* ============================================================
   Sales Task Checklist — Paper-style checkbox list.
   UX Priority: Dead simple. Big checkboxes. Obvious colors.
   One click to complete. Think paper checklist, not software.

   Key UX decisions:
   - Quick-add bar replaces modal/form for 80% of task creation
   - Completed tasks collapse into a "Done" section
   - Priority communicated via visual weight, not badges
   - Activity hint is the HERO text (what do I need to DO?)
   - Entire row is clickable to edit
   - "Must Do" replaces jargon-y "Required"
   ============================================================ */

/* ── Root Container — fill parent width ── */
.stc-checklist {
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.stc-checklist * {
    box-sizing: border-box;
}

/* ── Header: Progress ── */
.stc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0 10px 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 8px;
}

.stc-progress-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.stc-progress-text {
    font-size: 1rem;
    color: #495057;
    white-space: nowrap;
}

.stc-progress-text i {
    color: #6c757d;
    margin-right: 4px;
}

.stc-progress-text strong {
    font-weight: 700;
    color: #212529;
}

.stc-progress-bar-wrap {
    flex: 1;
    max-width: 200px;
    min-width: 80px;
    background: #e9ecef;
    border-radius: 8px;
    height: 12px;
    overflow: hidden;
}

.stc-progress-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 0.3s ease;
}

.stc-bar-green {
    background: linear-gradient(90deg, #28a745, #34ce57);
}

.stc-bar-yellow {
    background: linear-gradient(90deg, #ffc107, #ffda47);
}

.stc-bar-red {
    background: linear-gradient(90deg, #dc3545, #e86a76);
}

/* ── Quick-Add Bar ── */
.stc-quick-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 4px;
}

.stc-quick-add-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 1rem;
    border: 2px dashed #ced4da;
    border-radius: 8px;
    background: #fdfdfd;
    color: #212529;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    outline: none;
}

.stc-quick-add-input::placeholder {
    color: #0d6efd;
    font-weight: 600;
    opacity: 0.7;
}

.stc-quick-add-input:focus {
    border-color: #0d6efd;
    border-style: solid;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.stc-quick-add-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.stc-quick-add-more:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #f0f6ff;
}

/* ── Task List ── */
.stc-list {
    padding: 0;
}

/* ── Individual Task Item — full width, position:relative for the right banner ── */
.stc-item {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 12px 42px 12px 10px; /* right padding reserves space for edit banner */
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
    border-radius: 6px;
    margin: 2px 0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.stc-item:hover {
    background-color: #f4f6f8;
}

.stc-item:last-child {
    border-bottom: none;
}

/* ── Custom Checkbox — BIG touch target ── */
.stc-checkbox-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    cursor: pointer;
    margin-top: 2px;
    align-self: center;
}

.stc-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.stc-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 3px solid #adb5bd;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.stc-checkbox:checked + .stc-checkmark {
    background: #28a745;
    border-color: #28a745;
}

.stc-checkbox:checked + .stc-checkmark::after {
    content: "✓";
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1;
}

.stc-checkbox:hover + .stc-checkmark {
    border-color: #6c757d;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.15);
}

.stc-checkbox:checked:hover + .stc-checkmark {
    background: #218838;
    border-color: #218838;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

/* ── Task Content ── */
.stc-item-content {
    flex: 1;
    min-width: 0;
    align-self: center;
}

/* ── Title Row ── */
.stc-task-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stc-task-title {
    display: inline;
    font-size: 1.05rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.4;
    word-break: break-word;
}

/* ── Priority via Visual Weight (no badges) ── */
.stc-item.stc-priority-high .stc-task-title {
    font-weight: 800;
    color: #000;
}

.stc-item.stc-priority-high {
    border-left: 4px solid #dc3545;
    padding-left: 10px;
}

.stc-item.stc-priority-low .stc-task-title {
    font-weight: 500;
    color: #6c757d;
}

/* ── Task Meta (date only for incomplete) ── */
.stc-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 4px;
    font-size: 0.9rem;
    color: #6c757d;
}

.stc-task-meta i {
    margin-right: 3px;
    font-size: 0.85rem;
}

/* ── Due Date ── */
.stc-due-date {
    display: inline-flex;
    align-items: center;
}

.stc-due-overdue {
    color: #dc3545 !important;
    font-weight: 700;
}

.stc-overdue-label {
    display: inline-block;
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── "Must Do" Badge (replaces "Required") ── */
.stc-must-do-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e8d5f5;
    color: #6f42c1;
    white-space: nowrap;
    line-height: 1.4;
}

/* ── Activity-Type Hint — HERO text ── */
.stc-activity-hint {
    font-size: 0.92rem;
    color: #0d6efd;
    margin-top: 5px;
    line-height: 1.4;
    font-weight: 600;
    padding: 4px 8px;
    background: #eef4ff;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stc-activity-hint i {
    font-size: 0.95rem;
    margin-right: 2px;
}

/* ── Info Icon — Prominent ── */
.stc-info-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0d6efd;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: help;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e7f1ff;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.stc-info-icon i {
    font-size: 0.9rem;
}

.stc-info-icon:hover {
    background: #d0e3ff;
    color: #0a58ca;
}

/* ── Edit Button — Right-side banner strip (mirrors priority left-border) ── */
.stc-edit-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-left: 1px solid #e9ecef;
    border-radius: 0 6px 6px 0;
    background: #f8f9fa;
    color: #adb5bd;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    transition: all 0.15s ease;
    opacity: 0.6;
}

.stc-item:hover .stc-edit-btn {
    opacity: 1;
    background: #e9ecef;
    color: #495057;
}

.stc-edit-btn:hover {
    background: #0d6efd !important;
    border-left-color: #0d6efd;
    color: #fff !important;
    opacity: 1;
}

/* ── Overdue Task Styling ── */
.stc-item.stc-overdue {
    background: #fff5f5;
    border-left: 4px solid #dc3545;
    padding-left: 10px;
}

.stc-item.stc-overdue .stc-checkmark {
    border-color: #dc3545;
}

/* Overdue + High priority: don't double up left borders */
.stc-item.stc-overdue.stc-priority-high {
    border-left: 4px solid #dc3545;
}

/* ── Completed Task Styling (minimal) ── */
.stc-item.stc-completed {
    opacity: 0.75;
    padding: 8px 42px 8px 10px; /* keep right space for edit banner */
}

.stc-item.stc-completed .stc-task-title {
    text-decoration: line-through;
    color: #6c757d;
    font-weight: 500;
}

.stc-completed-info {
    color: #28a745;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    margin-left: auto;
}

/* ── Collapsible Done Section ── */
.stc-done-section {
    margin-top: 12px;
    border-top: 2px solid #e9ecef;
    padding-top: 4px;
}

.stc-done-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6c757d;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-align: left;
}

.stc-done-header:hover {
    background: #f4f6f8;
    color: #495057;
}

.stc-done-chevron {
    font-size: 0.75rem;
    width: 14px;
    text-align: center;
    transition: transform 0.15s ease;
}

.stc-done-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stc-done-label i {
    color: #28a745;
}

.stc-done-list {
    padding: 0 0 0 4px;
}

/* ── "All done!" celebration ── */
.stc-all-done {
    text-align: center;
    padding: 24px 16px;
    color: #28a745;
    font-size: 1.1rem;
    font-weight: 600;
}

.stc-all-done i {
    margin-right: 6px;
    font-size: 1.2rem;
}

/* ── Empty State ── */
.stc-empty {
    text-align: center;
    padding: 24px 16px;
    color: #6c757d;
    font-size: 1rem;
    font-style: italic;
}

.stc-empty i {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
    color: #ced4da;
}

/* ── Full Add Task Form (expandable) ── */
.stc-add-form-wrap {
    margin-bottom: 8px;
    padding: 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
}

.stc-add-form-row {
    margin-bottom: 12px;
}

.stc-add-form-row:last-child {
    margin-bottom: 0;
}

.stc-add-form-inline {
    display: flex;
    gap: 16px;
}

.stc-add-field {
    flex: 1;
}

.stc-add-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.stc-add-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.stc-add-input:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.stc-add-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.stc-save-btn,
.stc-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 44px;
}

.stc-save-btn {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.stc-save-btn:hover {
    background: #218838;
    border-color: #218838;
}

.stc-cancel-btn {
    background: #fff;
    color: #6c757d;
    border-color: #dee2e6;
}

.stc-cancel-btn:hover {
    background: #e2e6ea;
    border-color: #adb5bd;
    color: #495057;
}

/* ── Edit Task Inline Form ── */
.stc-edit-form-wrap {
    padding: 16px;
    background: #fffbe6;
    border: 2px solid #ffc107;
    border-radius: 10px;
    margin: 4px 0;
}

.stc-edit-form .stc-add-form-row {
    margin-bottom: 12px;
}

.stc-edit-form .stc-add-form-row:last-child {
    margin-bottom: 0;
}

/* ── Textarea (Details field) ── */
textarea.stc-add-input {
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .stc-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .stc-add-form-inline {
        flex-direction: column;
        gap: 8px;
    }

    .stc-task-meta {
        flex-direction: column;
        gap: 4px;
    }

    .stc-quick-add {
        flex-direction: column;
    }

    .stc-quick-add-more {
        width: 100%;
    }

    /* Always show edit button on mobile/touch */
    .stc-edit-btn {
        opacity: 0.6;
    }
}
