/* Kanban Board Specific Styles */

/* 1. Kanban Board Horizontal Scrollable Layout */
#kanban-board {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: start;
    min-height: calc(100vh - 200px);
}

/* 2. Column Styles */
.kanban-column {
    flex-grow: 1;
    flex-shrink: 0;
    width: 20rem; /* 320px */
    min-width: 17.5rem; /* 280px */
    max-width: 24rem; /* 384px */
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: none !important; /* Rules: No shadow except modal */
}

.dark .kanban-column {
    background-color: #161616;
    border-color: #2e2e2e;
}

/* Column Header */
.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e2e8f0;
    transition: border-color 0.3s ease;
}

.dark .kanban-column-header {
    border-bottom-color: #2e2e2e;
}

.kanban-column-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kanban-column-title {
    font-size: 0.875rem; /* 14px */
    font-weight: 600;
    color: #0f172a;
}

.dark .kanban-column-title {
    color: #ffffff;
}

.kanban-column-badge {
    font-size: 0.75rem; /* 12px */
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    background-color: #e2e8f0;
    color: #475569;
}

.dark .kanban-column-badge {
    background-color: #2e2e2e;
    color: #94a3b8;
}

/* Cards Container inside Column (Scrollable if too long) */
.kanban-cards-container {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 150px;
    padding: 0.25rem 0.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* 3. Task Card Styles */
.kanban-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    cursor: grab;
    transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: none !important; /* Rules: No shadow except modal */
}

.dark .kanban-card {
    background-color: #222222;
    border-color: #2e2e2e;
}

.kanban-card:hover {
    border-color: var(--color-brand-500, #3b82f6);
}

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

/* Task Priority Labels */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 10px;
    font-size: 0.6875rem; /* 11px */
    font-weight: 600;
    text-transform: capitalize;
    margin-bottom: 0.75rem;
}

/* Priority Badge Variations */
.priority-low {
    background-color: var(--color-brand-500, #3b82f6);
    color: #ffffff;
}

.priority-medium {
    background-color: #10b981;
    color: #ffffff;
}

.priority-high {
    background-color: #f59e0b;
    color: #ffffff;
}

.priority-urgent {
    background-color: #f43f5e;
    color: #ffffff;
}

/* Task Card Title */
.kanban-card-title {
    font-size: 0.8125rem; /* 13px */
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.dark .kanban-card-title {
    color: #ffffff;
}

/* Task Card Description */
.kanban-card-desc {
    font-size: 0.75rem; /* 12px */
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dark .kanban-card-desc {
    color: #94a3b8;
}

/* Card Progress bar */
.kanban-card-progress-wrapper {
    margin-bottom: 0.875rem;
}

.kanban-card-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6875rem; /* 11px */
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.dark .kanban-card-progress-text {
    color: #94a3b8;
}

/* Footer elements: Date and Avatar Group */
.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px dashed #e2e8f0;
    transition: border-color 0.3s ease;
}

.dark .kanban-card-footer {
    border-top-color: #2e2e2e;
}

.kanban-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem; /* 11px */
    font-weight: 500;
    color: #64748b;
}

.dark .kanban-card-date {
    color: #94a3b8;
}

.kanban-card-date.overdue {
    color: #f43f5e;
}

/* Avatar Group stack style */
.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group-item {
    margin-left: -6px;
    border: 2px solid #ffffff;
    border-radius: 9999px;
    width: 22px;
    height: 22px;
    -o-object-fit: cover;
       object-fit: cover;
    background-color: #cbd5e1;
    font-size: 0.625rem; /* 10px */
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: transform 0.2s ease;
}

.dark .avatar-group-item {
    border-color: #222222;
    background-color: #2e2e2e;
    color: #cbd5e1;
}

.avatar-group-item:first-child {
    margin-left: 0;
}

.avatar-group-item:hover {
    transform: translateY(-2px);
    z-index: 10;
}

/* 4. SortableJS Drag & Drop Classes */
.sortable-ghost {
    opacity: 0.4 !important;
    border: 2px dashed var(--color-brand-500, #3b82f6) !important;
    background-color: color-mix(in srgb, var(--color-brand-500, #3b82f6) 5%, transparent) !important;
}

.sortable-chosen {
    transform: rotate(1.5deg) scale(1.01);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.05) !important;
}

.sortable-drag {
    opacity: 0.9 !important;
}

/* 5. Custom Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #2e2e2e;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* 6. Modal Specific Animations and Styles (Like Calendar Modal) */
#modal-task.show {
    display: flex !important;
}

#modal-task.show #modal-backdrop {
    opacity: 1;
}

#modal-task.show #modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* Backdrop initial fade */
#modal-backdrop {
    opacity: 0;
}

/* Dialog initial scale */
#modal-dialog {
    transform: scale(0.95);
    opacity: 0;
}

/* Checkbox Label styles in modal */
.assignee-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem; /* 12px */
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.assignee-checkbox-label:hover {
    background-color: #f1f5f9;
}

.dark class .assignee-checkbox-label:hover {
    background-color: #222222;
}

.assignee-checkbox-label input:checked + span {
    color: var(--color-brand-500, #3b82f6);
}
