/* task-list-panel.css - Grid-synced Task List Side Panel */

/* ============================================
   Panel Container - starts below timeline
   ============================================ */
.task-list-panel {
    position: fixed;
    top: 175px;
    left: 0;
    width: 300px;
    height: calc(100vh - 175px);
    background: var(--panel-bg);
    border-right: 1px solid var(--panel-border);
    box-shadow: 8px 0 12px -2px var(--panel-shadow);
    clip-path: inset(0 -20px 0 0);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), opacity var(--transition-fast);
    overflow: hidden;
}

/* Hidden state */
.task-list-panel.hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   Content Area (syncs with canvas scroll)
   ============================================ */
.task-list-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.task-list-row-container {
    position: relative;
    width: 100%;
    min-height: 100%;
}

/* ============================================
   Row Base Styles (absolute positioned)
   ============================================ */
.task-list-row {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding: 0 var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
    box-sizing: border-box;
    transition: background var(--transition-fast);
    overflow: hidden;
}

.task-list-row:hover {
    background: var(--surface-elevated);
}

.task-list-row.selected {
    background: var(--accent-subtle);
    border-left: 3px solid var(--accent);
}

/* ============================================
   Group Container & Vertical Sidebar
   ============================================ */
.task-list-group-container {
    position: absolute;
    left: 0;
    width: 30px;
    pointer-events: none;
    z-index: 50;
}

.task-list-group-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0;
    border-radius: 0;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    pointer-events: auto;
    box-sizing: border-box;
}

.group-minimize-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 6px;
    padding: 0;
}

.group-minimize-btn:hover {
    background: rgba(0, 0, 0, 0.4);
}

.group-minimize-btn .minimize-icon {
    display: block;
    width: 12px;
    height: 2px;
    background: white;
    position: relative;
}

.group-minimize-btn .minimize-icon.plus::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 12px;
    background: white;
}

/* Plus icon for collapsed state - handled via JS */

.group-name-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: white;
    font-weight: 600;
    font-family: Inter, system-ui, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-height: 0;
    cursor: text;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.inline-edit-input.vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    width: 20px;
    padding: 2px;
    text-align: center;
}

/* Task rows in groups - JS handles left offset dynamically */
.task-list-row.group-child {
    padding-left: 10 !important;
}

/* ============================================
   Canvas Row
   ============================================ */
.task-row-canvas {
    display: block;
    width: 100%;
}

/* ============================================
   Task Name Cell
   ============================================ */
.task-name {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    padding-right: 4px;
}

.task-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    cursor: text;
    padding: 2px 4px;
    border-radius: var(--radius-xs);
    flex: 1;
    min-width: 0;
}

.task-name-text:hover {
    background: var(--surface-elevated);
}

.task-indent {
    width: 12px;
    flex-shrink: 0;
}

/* Task indicators */
.task-indicators {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.task-indicator {
    font-size: 10px;
    opacity: 0.6;
}

/* ============================================
   Assigned Cell
   ============================================ */
.task-assigned {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm);
}

.task-assigned:hover {
    background: var(--surface-elevated);
}

.assignee-avatar {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: var(--accent-subtle);
    border: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
}

.assignee-avatar.more {
    background: var(--surface-elevated);
    font-size: 7px;
    color: var(--text-muted);
}

.task-assigned .assignee-avatar:not(:first-child) {
    margin-left: -6px;
}

.no-assignee {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
}

.no-assignee:hover {
    color: var(--accent);
    opacity: 1;
}

/* ============================================
   Progress Cell
   ============================================ */
.task-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.progress-input {
    width: 60px;
    padding: 2px 4px;
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font-size: inherit;
    font-weight: 500;
    text-align: right;
    appearance: textfield;
    -moz-appearance: textfield;
}

.progress-input::-webkit-outer-spin-button,
.progress-input::-webkit-inner-spin-button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

.progress-input:hover {
    background: var(--surface-elevated);
}

.progress-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-elevated);
}

.progress-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================
   Inline Edit Input
   ============================================ */
.inline-edit-input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-xs);
    background: var(--surface-elevated);
    color: var(--text-primary);
    font-size: inherit;
    font-family: inherit;
    outline: none;
}

/* ============================================
   Assignee Dropdown
   ============================================ */
.assignee-dropdown {
    position: fixed;
    min-width: 180px;
    max-height: 250px;
    overflow-y: auto;
    background: var(--surface-glass);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
}

.assignee-dropdown-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-default);
}

.assignee-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
}

.assignee-dropdown-item:hover {
    background: var(--surface-elevated);
}

.assignee-dropdown-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.assignee-dropdown-empty {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Control Bar Toggle Button
   ============================================ */
.task-list-toggle-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.task-list-toggle-btn:hover {
    background: var(--surface-elevated-hover);
    border-color: var(--border-hover);
}

.task-list-toggle-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================
   Animations
   ============================================ */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.task-list-panel:not(.hidden) {
    animation: slideIn var(--transition-normal) ease;
}

/* ============================================
   Panel Resize Handle
   ============================================ */
.task-list-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 1000;
}

.task-list-resize-handle:hover {
    background: var(--accent);
    opacity: 0.5;
}

.task-list-resize-handle:active {
    background: var(--accent);
    opacity: 0.8;
}

/* ============================================
   Inline Edit on Canvas (fixed position overlay)
   ============================================ */
.inline-edit-input.panel-canvas-edit {
    font-size: 13px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1;
    display: flex;
    align-items: center;
}