/**
 * Task Manager Pro - Public Visibility Styles
 */

/* Legacy board layout (non-Kanban). Kanban uses tmp-public-board.css */
.tmp-public-board-view:not(.tmp-kanban-board) {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f8;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    max-width: 100%;
    min-height: var(--tmp-board-height, 600px);
}

.tmp-board-project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.tmp-board-project-title {
    margin: 0 0 6px;
    color: #1e293b;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
}

.tmp-board-project-description {
    margin: 0;
    color: #64748b;
    font-size: 0.925rem;
    line-height: 1.5;
}

.tmp-board-project-stats {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.tmp-board-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    min-width: 72px;
}

.tmp-board-stat strong {
    display: block;
    color: #0f172a;
    font-size: 1.1rem;
    line-height: 1.2;
}

.tmp-boards-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-height: 420px;
}

.tmp-board-column {
    flex: 0 0 280px;
    min-width: 280px;
    background: #eef2f6;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    max-height: calc(var(--tmp-board-height, 600px) - 120px);
}

.tmp-board-column--unassigned {
    background: #fef3c7;
}

.tmp-board-column-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.tmp-board-column-title {
    margin: 0;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
}

.tmp-task-count {
    background: #64748b;
    color: #fff;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}

.tmp-board-tasks {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tmp-board-empty-column {
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
}

.tmp-task-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: default;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.tmp-task-card:focus-visible {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

.tmp-task-title {
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    font-size: 0.925rem;
    line-height: 1.35;
}

.tmp-task-priority {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.tmp-task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tmp-task-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
}

.tmp-task-status {
    color: #fff;
}

.tmp-task-due-date {
    background: #f1f5f9;
    color: #475569;
}

.tmp-task-due-date.is-overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.tmp-task-due-date.is-due-today {
    background: #fef3c7;
    color: #b45309;
}

.tmp-task-due-date.is-due-soon {
    background: #e0f2fe;
    color: #0369a1;
}

.tmp-task-description {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-bottom: 8px;
}

.tmp-task-assignees {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tmp-assignee {
    background: #e2e8f0;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    color: #475569;
    font-weight: 500;
}

.tmp-empty-state {
    padding: 2rem;
    text-align: center;
    color: #64748b;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
}

.tmp-error {
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    margin: 1rem 0;
}

/* Explicit dark theme (legacy layout only) */
.tmp-public-board-view.tmp-theme-dark:not(.tmp-kanban-board) {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.tmp-theme-dark .tmp-board-project-header {
    border-bottom-color: #334155;
}

.tmp-theme-dark .tmp-board-project-title {
    color: #f8fafc;
}

.tmp-theme-dark .tmp-board-project-description,
.tmp-theme-dark .tmp-board-stat {
    color: #94a3b8;
}

.tmp-theme-dark .tmp-board-stat {
    background: #1e293b;
    border-color: #334155;
}

.tmp-theme-dark .tmp-board-stat strong {
    color: #f1f5f9;
}

.tmp-theme-dark .tmp-board-column {
    background: #1e293b;
}

.tmp-theme-dark .tmp-board-column-title {
    color: #e2e8f0;
}

.tmp-theme-dark .tmp-task-card {
    background: #0f172a;
    border-color: #334155;
}

.tmp-theme-dark .tmp-task-title {
    color: #f1f5f9;
}

.tmp-theme-dark .tmp-task-description {
    color: #94a3b8;
}

.tmp-theme-dark .tmp-assignee {
    background: #334155;
    color: #cbd5e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tmp-board-project-header {
        flex-direction: column;
    }

    .tmp-boards-container {
        flex-direction: column;
    }

    .tmp-board-column {
        flex: 1 1 auto;
        min-width: 100%;
        max-height: none;
    }

    .tmp-project-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .tmp-tasks-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Theme Support (system preference, light theme only) */
@media (prefers-color-scheme: dark) {
    .tmp-public-board-view.tmp-theme-light:not(.tmp-kanban-board),
    .tmp-public-task-list,
    .tmp-single-task,
    .tmp-project-overview {
        background: #1a1a1a;
        color: #ffffff;
    }

    .tmp-theme-light .tmp-board-column,
    .tmp-task-item,
    .tmp-theme-light .tmp-task-card {
        background: #2d2d2d;
        border-color: #404040;
    }

    .tmp-theme-light .tmp-task-title,
    .tmp-theme-light .tmp-board-column-title {
        color: #ffffff;
    }

    .tmp-theme-light .tmp-task-meta,
    .tmp-theme-light .tmp-task-description {
        color: #b0b0b0;
    }
}

/* Animation Effects */
.tmp-task-card,
.tmp-task-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tmp-task-card:hover,
.tmp-task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Loading States */
.tmp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.tmp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: tmp-spin 1s linear infinite;
}

@keyframes tmp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Priority Color Variations */
.tmp-priority-high {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.tmp-priority-medium {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: white;
}

.tmp-priority-low {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    color: white;
}

.tmp-priority-urgent {
    background: linear-gradient(135deg, #ff3838, #ff6b6b);
    color: white;
    animation: tmp-pulse 2s infinite;
}

@keyframes tmp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 56, 56, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 56, 56, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 56, 56, 0); }
}

/* Custom Scrollbar */
.tmp-public-board-view::-webkit-scrollbar,
.tmp-board-tasks::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.tmp-public-board-view::-webkit-scrollbar-track,
.tmp-board-tasks::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tmp-public-board-view::-webkit-scrollbar-thumb,
.tmp-board-tasks::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.tmp-public-board-view::-webkit-scrollbar-thumb:hover,
.tmp-board-tasks::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Print Styles */
@media print {
    .tmp-public-board-view,
    .tmp-public-task-list,
    .tmp-single-task,
    .tmp-project-overview {
        box-shadow: none;
        border: 1px solid #000;
    }

    .tmp-task-card:hover,
    .tmp-task-item:hover {
        transform: none;
        box-shadow: none;
    }
}
