/* ===========================================
   Task Kanban Board Styles
   =========================================== */

/* ===========================================
   View Switcher Styles
   =========================================== */

.ticket-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-nav-bar .back-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Ticket breadcrumb shown on non-Details views */
.ticket-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.ticket-breadcrumb .breadcrumb-separator {
    color: #adb5bd;
}

.ticket-breadcrumb .ticket-number {
    font-weight: 600;
    color: #0d6efd;
    font-family: monospace;
}

.ticket-breadcrumb .ticket-title-short {
    color: #495057;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticket-view-switcher {
    display: flex;
    align-items: center;
}

.view-buttons {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.view-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-right: 1px solid #e9ecef;
}

.view-button:last-child {
    border-right: none;
}

.view-button:hover {
    background: #f8f9fa;
    color: #212529;
}

.view-button.active {
    background: #0d6efd;
    color: white;
}

.view-button i {
    font-size: 1rem;
}

.view-label {
    display: inline;
}

/* Ticket Board Section */
.ticket-board-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    min-height: calc(100vh - 200px);
}

/* Placeholder Views */
.ticket-schedule-section,
.ticket-kb-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.placeholder-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    color: #6c757d;
}

.placeholder-view i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #adb5bd;
}

.placeholder-view h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 8px 0;
}

.placeholder-view p {
    margin: 0 0 4px 0;
    font-size: 0.9375rem;
}

.placeholder-view .implementation-note {
    font-size: 0.8125rem;
    color: #adb5bd;
    font-style: italic;
    margin-top: 12px;
}

/* Responsive - hide labels on smaller screens */
@media (max-width: 576px) {
    .view-label {
        display: none;
    }
    
    .view-button {
        padding: 10px 14px;
    }
}

/* ===========================================
   Kanban Board Styles
   =========================================== */

/* Board Container */
.kanban-board {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.kanban-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.board-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.board-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.board-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #6c757d;
    font-size: 0.875rem;
}

.stat-divider {
    color: #dee2e6;
}

/* Columns Container */
.kanban-columns {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    overflow-x: auto;
    flex: 1;
    min-height: calc(100vh - 280px);
}

/* Single Column */
.kanban-column {
    flex: 0 0 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.kanban-column-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.column-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.column-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.column-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    color: #212529;
}

.column-count {
    background: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.kanban-column-body {
    flex: 1;
    padding: 0.5rem;
    overflow-y: auto;
    min-height: 200px;
}

.kanban-empty-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    color: #adb5bd;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.kanban-empty-column i {
    font-size: 1.5rem;
}

/* Task Card */
.task-card-wrapper {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: stretch;
}

/* Drag Handle */
.task-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-right: none;
    border-radius: 6px 0 0 6px;
    color: #adb5bd;
    cursor: grab;
    transition: all 0.15s ease;
}

.task-drag-handle:hover {
    background: #e9ecef;
    color: #6c757d;
}

.task-drag-handle:active {
    cursor: grabbing;
    background: #dee2e6;
}

.task-drag-handle i {
    font-size: 0.875rem;
}

/* When handle exists, adjust card border radius */
.task-card-wrapper.draggable .task-card {
    border-radius: 0 6px 6px 0;
}

.task-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.task-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.task-card.task-completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-subject {
    font-size: 0.875rem;
    font-weight: 500;
    color: #212529;
    line-height: 1.4;
    flex: 1;
    word-break: break-word;
}

.task-badge {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.task-badge-complete {
    color: #198754;
}

.task-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.task-due,
.task-estimate,
.task-schedule-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-schedule-indicator {
    color: #0d6efd;
}

/* Due Date Colors */
.due-overdue {
    color: #dc3545 !important;
    font-weight: 500;
}

.due-today {
    color: #fd7e14 !important;
    font-weight: 500;
}

.due-soon {
    color: #ffc107 !important;
}

.due-normal {
    color: #6c757d;
}

.task-card.task-overdue {
    border-left: 3px solid #dc3545;
}

.task-card.task-due-today {
    border-left: 3px solid #fd7e14;
}

.task-card.task-due-soon {
    border-left: 3px solid #ffc107;
}

.task-card-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f3f5;
}

.task-assignee {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #495057;
}

.assignee-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.assignee-avatar.small {
    width: 18px;
    height: 18px;
    font-size: 0.5625rem;
}

/* SortableJS Drag States */
.kanban-ghost {
    opacity: 0.4;
    background: #e7f1ff;
    border: 2px dashed #0d6efd;
}

.kanban-chosen {
    opacity: 1;
}

.kanban-drag {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
}

body.kanban-dragging {
    cursor: grabbing !important;
}

body.kanban-dragging * {
    cursor: grabbing !important;
}

/* Loading & Error States */
.kanban-loading,
.kanban-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
    color: #6c757d;
}

.kanban-error .error-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.kanban-error i {
    font-size: 2rem;
    color: #dc3545;
}

/* Task Detail Dialog */
.task-dialog-loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.task-dialog-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    color: #dc3545;
}

.task-dialog-error i {
    font-size: 2.5rem;
}

.task-dialog-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-dialog-header {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.task-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-status-badge.status-open {
    background: #e9ecef;
    color: #495057;
}

.task-status-badge.status-in-progress {
    background: #cfe2ff;
    color: #084298;
}

.task-status-badge.status-on-hold {
    background: #ffe5d0;
    color: #984c0c;
}

.task-status-badge.status-waiting {
    background: #e2d9f3;
    color: #432874;
}

.task-status-badge.status-uat {
    background: #d1e7dd;
    color: #0f5132;
}

.task-status-badge.status-complete {
    background: #d1e7dd;
    color: #0f5132;
}

.task-completed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #d1e7dd;
    color: #0f5132;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.task-dialog-subject {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

.task-dialog-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
}

.task-dialog-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-comments {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #495057;
    white-space: pre-wrap;
}

.task-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.875rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.due-relative {
    color: #6c757d;
    font-size: 0.75rem;
}

/* Schedule List */
.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #0d6efd;
}

.schedule-item.schedule-status-blocked {
    border-left-color: #fd7e14;
    background: #fff5eb;
}

.schedule-item.schedule-status-completed {
    border-left-color: #198754;
    background: #f0fdf4;
}

.schedule-week {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.schedule-badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.schedule-badge.current {
    background: #0d6efd;
    color: white;
}

.schedule-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: #6c757d;
}

.schedule-hours,
.schedule-user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.no-schedules {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    color: #adb5bd;
    gap: 0.5rem;
}

.no-schedules i {
    font-size: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .kanban-columns {
        flex-direction: column;
        padding: 0.5rem;
    }

    .kanban-column {
        flex: none;
        min-width: 100%;
        max-height: 300px;
    }

    .task-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Task Dialog Actions (for TelerikWindow) */
.task-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* ===========================================
   Read-Only State for Non-Employees
   =========================================== */

/* Read-only task cards don't have drag cursor */
.task-card-wrapper.read-only {
    cursor: default;
}

.task-card-wrapper.read-only .task-card {
    cursor: pointer; /* Still clickable to view details */
}

/* Draggable cards show grab cursor */
.task-card-wrapper.draggable {
    cursor: grab;
}

.task-card-wrapper.draggable:active {
    cursor: grabbing;
}

/* Read-only column body styling */
.kanban-column-body.read-only {
    background: #f8f9fa;
}


/* Optional: Show a subtle indicator that the board is read-only */
.kanban-column-body.read-only .kanban-empty-column {
    opacity: 0.7;
}

/* ===========================================
   Add Task Dialog Styles
   =========================================== */

.add-task-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-task-form .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

.add-task-form .text-danger {
    font-size: 0.75rem;
}

.add-task-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}
