/* Fixed Task List Styles */
.fixed-task-list {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 250px; /* Adjust for sidebar width */
    min-height: 50px;
    max-height: 50vh;
    height: auto; /* Start with auto height for minimized state */
    background: #ffffff;
    border-top: 1px solid var(--vz-border-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: height 0.3s ease;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Disable height transition during manual resize */
.fixed-task-list.resizing {
    transition: none;
}


/* Minimized state - stays at bottom, no horizontal shrinking */
.fixed-task-list.minimized {
    height: auto !important;
    min-height: auto !important;
}

/* Hide resize handle when minimized */
.fixed-task-list.minimized .task-list-resize-handle {
    display: none;
}

/* Adjust for collapsed sidebar */
body[data-sidebar-size="sm"] .fixed-task-list:not(.minimized),
html[data-sidebar-size="sm"] .fixed-task-list:not(.minimized) {
    left: 70px !important;
}

/* Adjust for hidden sidebar */
body[data-sidebar-size="hidden"] .fixed-task-list:not(.minimized),
html[data-sidebar-size="hidden"] .fixed-task-list:not(.minimized),
body.vertical-layout[data-layout="horizontal"] .fixed-task-list:not(.minimized) {
    left: 0 !important;
}


.task-list-resize-handle {
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 10px;
    cursor: ns-resize;
    background: transparent;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-list-resize-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: var(--vz-border-color);
    border-radius: 2px;
    transition: all 0.2s;
}

.task-list-resize-handle:hover::before {
    background: var(--vz-primary);
    width: 60px;
}

.task-list-resize-handle:active::before {
    background: var(--vz-primary);
    width: 80px;
}

.task-list-header {
    background: var(--vz-light);
    padding: 4px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    flex-shrink: 0;
}

.task-list-header h6 {
    margin: 0;
    flex: 1;
    text-align: left;
    font-size: 0.875rem; /* 14px - smaller, slimmer header */
    font-weight: 600;
}

.task-list-controls {
    display: flex;
    gap: 5px;
}

.task-list-body {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    padding-top: 0.5rem;
    min-height: 0;
}

/* Completely hide body when minimized */
.fixed-task-list.minimized .task-list-body {
    display: none !important;
}

.task-list-body .table {
    margin: 0;
}

.task-list-body .table td,
.task-list-body .table th {
    vertical-align: middle;
}

/* Column widths for slimmer table */
.task-col-name { width: 25%; }
.task-col-status { width: 10%; }
.task-col-user { width: 15%; }
.task-col-start { width: 17%; }
.task-col-end { width: 17%; }
.task-col-progress { width: 16%; }

.task-list-body .table tbody tr:hover {
    background-color: rgba(var(--vz-primary-rgb), 0.05);
}

.task-list-body .table tbody tr[onclick] {
    transition: background-color 0.2s ease;
}

.task-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-progress-mini {
    flex: 1;
    height: 5px;
    background: var(--vz-gray-300);
    border-radius: 3px;
    overflow: hidden;
}

.task-progress-mini .progress-bar {
    height: 100%;
    background: var(--vz-primary);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.task-progress-mini .progress-bar.completed {
    background: var(--vz-success);
}

.task-progress-mini .progress-bar.failed {
    background: var(--vz-danger);
}

.task-progress-percent {
    font-size: 0.75rem;
    color: var(--vz-text-muted);
    min-width: 35px;
    text-align: right;
}

.task-status-badge {
    font-size: 0.875rem; /* 14px - matches standard badge size */
    padding: 4px 10px;
}

/* Task Steps Timeline */
.task-steps-list {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.task-step-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    position: relative;
}

.task-step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 24px;
    bottom: -8px;
    width: 2px;
    background: #e9ecef;
}

.task-step-item.completed:not(:last-child)::after {
    background: var(--vz-success);
}

.task-step-item.active:not(:last-child)::after {
    background: var(--vz-primary);
}

.task-step-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 0.75rem; /* 12px */
    position: relative;
    z-index: 1;
}

.task-step-indicator.completed {
    background: var(--vz-success);
    color: white;
    border: 2px solid var(--vz-success);
}

.task-step-indicator.active {
    background: var(--vz-primary);
    color: white;
    border: 2px solid var(--vz-primary);
}

.task-step-indicator.pending {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
}

.task-step-content {
    flex: 1;
    padding-top: 1px;
}

.task-step-title {
    font-weight: 500;
    margin-bottom: 2px;
    color: #495057;
}

.task-step-desc {
    line-height: 1.5;
}

.task-step-item.completed .task-step-title {
    color: var(--vz-success);
}

.task-step-item.active .task-step-title {
    color: var(--vz-primary);
    font-weight: 600;
}

/* Add some padding to the main content to prevent overlap */
.main-content .page-content {
    padding-bottom: 260px; /* Increased to account for default task list height */
}

/* Dark Mode Styles */
[data-bs-theme="dark"] .fixed-task-list {
    background: var(--vz-secondary-bg);
    border-top-color: var(--vz-border-color);
    box-shadow: none;
}

[data-bs-theme="dark"] .task-list-header {
    background: var(--vz-light);
}

[data-bs-theme="dark"] .task-list-body {
    background: var(--vz-secondary-bg);
    color: var(--vz-body-color);
}

[data-bs-theme="dark"] .task-list-body .table {
    color: var(--vz-body-color);
}

[data-bs-theme="dark"] .task-list-body .table td,
[data-bs-theme="dark"] .task-list-body .table th {
    border-color: var(--vz-border-color);
}

[data-bs-theme="dark"] .task-list-body .table tbody tr:hover {
    background-color: rgba(var(--vz-primary-rgb), 0.1);
}

[data-bs-theme="dark"] .task-steps-list {
    background: var(--vz-light);
}

[data-bs-theme="dark"] .task-step-indicator.pending {
    background: var(--vz-secondary-bg);
    border-color: var(--vz-border-color);
}

[data-bs-theme="dark"] .task-step-title {
    color: var(--vz-body-color);
}

[data-bs-theme="dark"] .task-step-desc {
    color: var(--vz-text-muted);
}

.no-tasks td {
    font-size: 0.875rem; /* 14px - matches content text */
}

.no-tasks td small {
    font-size: inherit; /* Use parent font size */
}

[data-bs-theme="dark"] .no-tasks td {
    color: var(--vz-text-muted);
}

/* iPad responsive styles */
@media (min-width: 768px) and (max-width: 1024px) {
    .fixed-task-list {
        left: 70px !important;
        width: calc(100% - 70px) !important;
    }
    
    /* Override sidebar adjustments on iPad */
    body[data-sidebar-size="sm"] .fixed-task-list,
    body[data-sidebar-size="hidden"] .fixed-task-list,
    html[data-sidebar-size="sm"] .fixed-task-list,
    html[data-sidebar-size="hidden"] .fixed-task-list {
        left: 70px !important;
        width: calc(100% - 70px) !important;
    }
}

/* Mobile responsive styles */
@media (max-width: 767.98px) {
    .fixed-task-list:not(.minimized) {
        left: 0;
    }
    
    /* Override sidebar adjustments on mobile */
    body[data-sidebar-size="sm"] .fixed-task-list:not(.minimized),
    body[data-sidebar-size="hidden"] .fixed-task-list:not(.minimized) {
        left: 0;
    }
    
    
    /* Hide less important columns on mobile */
    .task-col-user,
    .task-col-start,
    .task-col-end {
        display: none;
    }
    
    /* Adjust column widths for mobile */
    .task-col-name { width: 45%; }
    .task-col-status { width: 25%; }
    .task-col-progress { width: 30%; }
}

/* Small devices (landscape phones) */
@media (max-width: 575.98px) {
    .fixed-task-list {
        height: 180px; /* Reduce height on smaller screens */
    }
    
    .task-list-body .table td,
    .task-list-body .table th {
        padding: 6px 8px; /* Reduce padding for mobile */
        font-size: 0.75rem; /* Smaller font on mobile */
    }
    
    .task-list-header {
        padding: 6px 10px;
    }
    
    .task-list-header h6 {
        font-size: 0.8125rem; /* Smaller header on mobile */
    }
    
    /* Even smaller progress bar on mobile */
    .task-progress-mini {
        height: 4px;
    }
    
    .task-progress-percent {
        font-size: 0.7rem;
        min-width: 30px;
    }
    
    /* Reduce table padding on mobile */
    .table-responsive.px-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
}