/**
 * Task List & Project Overview — shared public view design (matches Kanban board).
 */

.tmp-public-view {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #172b4d;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 1px 2px rgba(9, 30, 66, 0.12),
        0 8px 24px rgba(9, 30, 66, 0.1);
    border: 1px solid rgba(9, 30, 66, 0.08);
}

/* Shared header (Kanban-style slate bar) */
.tmp-pv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(145deg, #505f79 0%, #172b4d 100%);
    color: #ffffff;
}

.tmp-pv-header__lead {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.tmp-pv-header__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.45);
}

.tmp-pv-header__icon .dashicons {
    color: #fff;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

.tmp-pv-header__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    color: #ffffff;
}

.tmp-pv-header__subtitle {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.82);
    max-width: 60ch;
}

.tmp-pv-header__badge {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    white-space: nowrap;
    align-self: center;
}

/* Toolbar (search + filters) */
.tmp-pv-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f7f8f9;
    border-bottom: 1px solid #ebecf0;
}

.tmp-pv-search {
    flex: 1 1 200px;
    min-width: 180px;
    padding: 9px 12px 9px 36px;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23626f86' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tmp-pv-search:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.tmp-pv-filter {
    padding: 9px 12px;
    border: 1px solid #dfe1e6;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #fff;
    color: #172b4d;
    min-width: 140px;
}

.tmp-pv-body {
    padding: 16px 20px 20px;
}

/* Task list — card rows */
.tmp-task-list-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tmp-task-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #ebecf0;
    border-radius: 10px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.tmp-task-list-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(9, 30, 66, 0.1);
    transform: translateY(-1px);
}

.tmp-task-list-item:focus-visible {
    outline: 2px solid #388bff;
    outline-offset: 2px;
}

.tmp-task-list-item.is-hidden {
    display: none;
}

.tmp-task-list-item__main {
    min-width: 0;
}

.tmp-task-list-item__title {
    margin: 0 0 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #172b4d;
    line-height: 1.35;
}

.tmp-task-list-item__title.is-completed {
    text-decoration: line-through;
    color: #626f86;
}

.tmp-task-list-item__excerpt {
    margin: 0 0 8px;
    font-size: 0.8125rem;
    color: #626f86;
    line-height: 1.45;
}

.tmp-task-list-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tmp-pv-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.tmp-pv-badge--status,
.tmp-pv-badge--priority {
    color: #ffffff;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

.tmp-pv-badge--due {
    background: #f1f2f4;
    color: #44546f;
}

.tmp-pv-badge--due.is-overdue {
    background: #ffebe6;
    color: #ae2a19;
}

.tmp-pv-badge--due.is-due-soon {
    background: #fff7d6;
    color: #7f5f01;
}

.tmp-pv-badge--due.is-done {
    background: #dcfff1;
    color: #216e4e;
}

.tmp-task-list-item__assignees {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.tmp-pv-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #506eec;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.tmp-pv-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    object-fit: cover;
    box-shadow: 0 0 0 2px #fff;
}

/* Project overview — stats */
.tmp-pv-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px 20px 0;
}

.tmp-pv-stat-card {
    background: #f7f8f9;
    border: 1px solid #ebecf0;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.tmp-pv-stat-card__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #172b4d;
    line-height: 1.1;
}

.tmp-pv-stat-card__label {
    margin-top: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #626f86;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tmp-pv-stat-card--accent .tmp-pv-stat-card__value {
    color: #4f46e5;
}

.tmp-pv-stat-card--success .tmp-pv-stat-card__value {
    color: #1f845a;
}

.tmp-pv-stat-card--danger .tmp-pv-stat-card__value {
    color: #ae2a19;
}

/* Progress bar */
.tmp-pv-progress {
    padding: 16px 20px 0;
}

.tmp-pv-progress__label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #44546f;
    margin-bottom: 8px;
}

.tmp-pv-progress__track {
    height: 8px;
    background: #ebecf0;
    border-radius: 999px;
    overflow: hidden;
}

.tmp-pv-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #6366f1);
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* Recent tasks section */
.tmp-pv-section {
    padding: 20px;
}

.tmp-pv-section__title {
    margin: 0 0 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #172b4d;
}

/* Empty states */
.tmp-public-view .tmp-pv-empty {
    padding: 32px 24px;
    text-align: center;
    color: #626f86;
    background: #f7f8f9;
    border: 1px dashed #dfe1e6;
    border-radius: 10px;
}

.tmp-public-view .tmp-pv-empty p {
    margin: 0;
    font-size: 0.9375rem;
}

.tmp-public-view .tmp-pv-empty small {
    display: block;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: #8993a4;
}

/* Dark theme */
.tmp-public-view.tmp-theme-dark {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.tmp-public-view.tmp-theme-dark .tmp-pv-toolbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

.tmp-public-view.tmp-theme-dark .tmp-pv-search,
.tmp-public-view.tmp-theme-dark .tmp-pv-filter {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.tmp-public-view.tmp-theme-dark .tmp-task-list-item {
    background: #1e293b;
    border-color: #334155;
}

.tmp-public-view.tmp-theme-dark .tmp-task-list-item__title {
    color: #f1f5f9;
}

.tmp-public-view.tmp-theme-dark .tmp-pv-stat-card {
    background: #1e293b;
    border-color: #334155;
}

.tmp-public-view.tmp-theme-dark .tmp-pv-stat-card__value {
    color: #f1f5f9;
}

/* Filter empty state */
.tmp-pv-filter-empty {
    padding: 24px;
    text-align: center;
    color: #626f86;
    background: #f7f8f9;
    border: 1px dashed #dfe1e6;
    border-radius: 10px;
}

.tmp-pv-filter-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Task detail modal */
.tmp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 30, 66, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.tmp-modal {
    background: #ffffff;
    border-radius: 12px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(9, 30, 66, 0.25);
}

.tmp-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #ebecf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, #505f79 0%, #172b4d 100%);
    color: #ffffff;
}

.tmp-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.tmp-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
}

.tmp-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.tmp-modal-content {
    padding: 0;
    max-height: calc(85vh - 56px);
    overflow-y: auto;
}

.tmp-modal-content .tmp-single-task {
    max-width: none;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
}

@media (max-width: 640px) {
    .tmp-pv-header {
        flex-direction: column;
    }

    .tmp-pv-header__badge {
        align-self: flex-start;
    }

    .tmp-task-list-item {
        grid-template-columns: 1fr;
    }

    .tmp-task-list-item__assignees {
        justify-content: flex-start;
    }
}
