/* kanban.html 特有樣式 */

/* Filter Bar - Consistent with Projects List */
.kanban-list-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 32px;
}
.kanban-search-wrapper {
    position: relative;
    max-width: 680px;
}
.kanban-search-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.kanban-search-wrapper .form-input,
.kanban-search-wrapper .form-control {
    height: 56px;
    padding-left: 52px;
    font-size: 16px;
}
.kanban-list-toolbar .form-select {
    height: 56px;
    min-width: 180px;
    background-color: #fff;
}

@media (max-width: 900px) {
    .kanban-list-toolbar {
        grid-template-columns: 1fr;
    }
    .kanban-list-toolbar .form-select,
    .kanban-search-wrapper {
        max-width: none;
        min-width: 0;
        width: 100%;
    }
}
@media (min-width: 901px) and (max-width: 1320px) {
    .kanban-list-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .kanban-search-wrapper {
        grid-column: 1 / -1;
        max-width: none;
    }
    .kanban-list-toolbar .form-select {
        min-width: 0;
        width: 100%;
    }
}

/* Kanban Board Grid */
.kanban-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: start;
}

.kanban-column {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 500px;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.column-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 狀態圓點樣式 */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.todo {
    background-color: var(--status-todo);
}
.status-dot.in-progress {
    background-color: var(--status-in-progress);
}
.status-dot.in-review {
    background-color: var(--status-in-review);
}
.status-dot.done {
    background-color: var(--status-done);
}

.column-badge {
    background-color: var(--border-color);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}

/* Column Cards container */
.column-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

/* Task Cards */
.task-card {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:active {
    cursor: grabbing;
}

.task-card.is-locked {
    cursor: default;
}

.task-card.is-locked:active {
    cursor: default;
}

.task-card.is-locked .task-card-title,
.task-card.is-locked .task-card-footer {
    opacity: 0.82;
}

.task-card.dragging {
    opacity: 0.4;
    border: 2px dashed var(--primary);
}

.task-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#task-modal {
    padding: 16px;
    align-items: center;
}

#task-modal .modal-container {
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
}

#task-modal .modal-container:has(.searchable-select-wrapper) {
    overflow: hidden;
}

#new-task-form {
    min-height: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
}

#task-modal .modal-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

#task-modal .modal-container:has(.searchable-select-wrapper) .modal-body {
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
}

#task-modal .modal-footer {
    flex-shrink: 0;
    background: white;
    position: relative;
    z-index: 2;
}

#task-modal .searchable-select-dropdown {
    z-index: 4;
}

.task-due-date {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-due-date.overdue {
    color: var(--danger);
    font-weight: 550;
}

.task-card-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.task-card-avatar.has-image {
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: transparent;
}

.task-card-avatar.unassigned {
    background-color: #cbd5e1;
    color: #475569;
}

.current-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.column-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 18px 8px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.52);
}

/* Task Detail Timeline activity */
.timeline {
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.timeline-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.timeline-node {
    display: flex;
    gap: 12px;
    position: relative;
}
.timeline-node::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: -16px;
    width: 1px;
    background-color: var(--border-color);
}
.timeline-node:last-child::before {
    display: none;
}
.timeline-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.timeline-circle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
}
.timeline-circle.active::after {
    background-color: var(--primary);
}
.timeline-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.timeline-text {
    font-size: 13px;
    color: var(--text-main);
}
.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Task detail modal modifications */
.detail-modal-container {
    max-width: 600px;
}
.detail-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}
.detail-meta-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    font-size: 13px;
}
.detail-desc-box {
    background-color: var(--bg-sidebar);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-size: 14px;
    margin-bottom: 24px;
}
.detail-desc-box-title {
    font-weight: 600;
    margin-bottom: 6px;
}
.detail-desc-box-text {
    color: var(--text-muted);
}

/* Task card tags */
.task-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: 4px;
}
.task-tag {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-hover);
    border-radius: 4px;
    padding: 1px 5px;
}

.task-tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.task-tag-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.task-tag-empty {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    font-size: 13px;
    color: var(--text-muted);
}

/* Attachment Styles */
.attachment-section {
    margin-bottom: 24px;
}
.attachment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.attachment-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 0;
}
.attachment-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.attachment-info {
    min-width: 0;
}
.attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attachment-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Comments Section */
.comments-section {
    margin-bottom: 24px;
}
.comments-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}
.comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.comment-box {
    flex: 1;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}
.comment-header {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}
.comment-time {
    font-weight: 400;
    color: var(--text-muted);
}
.comment-text {
    font-size: 13px;
    color: var(--text-main);
}
.comment-input-area {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.comment-input-wrap {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.comment-input-field {
    resize: none;
    flex: 1;
    font-size: 13px;
}

/* Form layout grids */
.form-row-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Responsive columns stacking for mobile and tablet */
@media (max-width: 900px) {
    .kanban-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .kanban-column {
        min-height: auto;
    }
}
