/* Kanban Board & Card View Styles */

/* View Switcher */
.view-switcher {
    font-family: 'Poppins', sans-serif;
}

.view-switcher .view-btn {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    transition: all 0.2s ease;
}

.view-switcher .view-btn.active {
    background-color: #2563eb !important;
    color: white !important;
    border-color: #2563eb !important;
}

.view-switcher .view-btn:hover:not(.active) {
    background-color: #f3f4f6;
}

.view-switcher .view-btn i {
    margin-right: 6px;
}

/* View Containers */
.list-view,
.kanban-view,
.cards-view {
    display: none;
}

.list-view.active,
.kanban-view.active,
.cards-view.active {
    display: block;
}

/* Kanban Board Layout */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: 600px;
}

.kanban-column {
    flex: 0 0 320px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
    transition: all 0.3s ease;
}

/* Drag Over State */
.kanban-column.drag-over {
    background: #f3f4f6;
    border: 2px dashed #3b82f6;
}

/* Collapsed Column State */
.kanban-column.collapsed {
    flex: 0 0 50px;
    cursor: pointer;
}

.kanban-column.collapsed .kanban-column-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    padding: 20px 12px;
    height: 100%;
    justify-content: flex-end;
    border-bottom: none;
    border-radius: 12px;
}

.kanban-column.collapsed .kanban-column-header .column-title {
    flex-direction: column;
    gap: 12px;
}

.kanban-column.collapsed .kanban-column-header .task-count {
    margin-top: 12px;
}

.kanban-column.collapsed .kanban-column-body {
    display: none;
}

.kanban-column.collapsed:hover {
    flex: 0 0 56px;
    opacity: 0.9;
}

.kanban-column-header {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 10;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.kanban-column-header .column-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-header .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.kanban-column-header .task-count {
    background: #e5e7eb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.kanban-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.kanban-column-body::-webkit-scrollbar {
    width: 6px;
}

.kanban-column-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Kanban Cards */
.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kanban-card.dragging {
    opacity: 0.5;
}

.kanban-card-id {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 8px;
}

.kanban-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.4;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6b7280;
}

.kanban-card-assignees {
    display: flex;
    gap: 4px;
}

.kanban-card-due-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card-priority {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.kanban-card-priority.high {
    background: #fee2e2;
    color: #991b1b;
}

/* Status Column Colors */
.kanban-column.status-backlog {
    background: #fef2f2;
}

.kanban-column.status-backlog .kanban-column-header {
    background: #fef2f2;
}

.kanban-column.status-backlog .status-dot {
    background: #ef4444;
}

.kanban-column.status-in-progress {
    background: #eff6ff;
}

.kanban-column.status-in-progress .kanban-column-header {
    background: #eff6ff;
}

.kanban-column.status-in-progress .status-dot {
    background: #3b82f6;
}

.kanban-column.status-done {
    background: #f0fdf4;
}

.kanban-column.status-done .kanban-column-header {
    background: #f0fdf4;
}

.kanban-column.status-done .status-dot {
    background: #10b981;
}

.kanban-column.status-not-doing {
    background: #f9fafb;
}

.kanban-column.status-not-doing .kanban-column-header {
    background: #f9fafb;
}

.kanban-column.status-not-doing .status-dot {
    background: #6b7280;
}

.kanban-column.status-duplicate {
    background: #f3f4f6;
}

.kanban-column.status-duplicate .kanban-column-header {
    background: #f3f4f6;
}

.kanban-column.status-duplicate .status-dot {
    background: #374151;
}

.kanban-column.status-qc {
    background: #fffbeb;
}

.kanban-column.status-qc .kanban-column-header {
    background: #fffbeb;
}

.kanban-column.status-qc .status-dot {
    background: #f59e0b;
}

.kanban-column.status-hold {
    background: #fef3c7;
}

.kanban-column.status-hold .kanban-column-header {
    background: #fef3c7;
}

.kanban-column.status-hold .status-dot {
    background: #f59e0b;
}

.kanban-column.status-discussion {
    background: #f5f3ff;
}

.kanban-column.status-discussion .kanban-column-header {
    background: #f5f3ff;
}

.kanban-column.status-discussion .status-dot {
    background: #8b5cf6;
}

/* Card Grid View */
.cards-view.active {
    display: grid !important;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.task-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    border-top: 4px solid #e5e7eb;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.task-card-id {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 600;
}

.task-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    line-height: 1.4;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

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

/* Add Task Button */
.add-task-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-task-btn:hover {
    background: #f9fafb;
    border-color: #2563eb;
    color: #2563eb;
}

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

    .kanban-column {
        flex: 1 1 auto;
        max-height: none;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Pinned Tasks Panel - Bottom Right Fizzy-style Stack */
.pinned-tasks-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1070;
    /* Higher than task capsule (1060) */
    transform: translateX(350px);
    transition: transform 0.3s ease;
}

.pinned-tasks-panel.active {
    transform: translateX(0);
}

.pinned-tasks-header {
    display: none;
}

/* Pinned label at bottom - always visible */
.pinned-label {
    background: #1f2937;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    float: right;
}

.pinned-label:hover {
    background: #374151;
}

.pinned-label .count {
    background: #3b82f6;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Cards container - hidden by default, shown above button when expanded */
.pinned-tasks-body {
    position: absolute;
    bottom: 50px;
    right: 0;
    width: 300px;
    display: none;
}

/* Show cards when expanded */
.pinned-tasks-panel.expanded .pinned-tasks-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 5px;
}

/* Card styling */
.pinned-task-card {
    width: 100%;
    cursor: pointer;
    transition: all 0.25s ease;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
}

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

/* Card content styling */
.pinned-task-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.pinned-task-content {
    padding: 12px;
}

.pinned-task-id {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
    display: inline;
    margin-right: 6px;
}

.pinned-task-title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pinned-task-meta {
    display: none;
}

.pinned-task-project {
    font-size: 10px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.pinned-task-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.pinned-timer-btn {
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 4px;
    display: inline-block;
}

.pinned-timer-btn:hover {
    transform: scale(1.2);
}

.pinned-task-unpin {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
    line-height: 1;
}

.pinned-task-unpin:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Pin button on cards */
.pin-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.pin-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.pin-btn.pinned {
    color: #3b82f6;
}

/* Pinned indicator on card */
.kanban-card.pinned,
.task-card.pinned {
    border-left-color: #3b82f6;
}

@media (max-width: 768px) {
    .pinned-tasks-panel {
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 320px;
    }
}