/* Task Manager Section Styles */
.task-manager-section {
    display: none; /* Hidden by default*/
    padding: 0;
    margin-bottom: 24px;
}

/* Header Section */
.task-header {
    margin-bottom: 24px;
}

.task-title-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.task-title-stats h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1E293B;
}

.task-stats {
    display: flex;
    gap: 24px;
}

.task-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 20px;
    font-weight: 600;
    color: #1E293B;
}

.stat-label {
    font-size: 12px;
    color: #64748B;
}

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

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    background-color: transparent;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    background-color: #F1F5F9;
    color: #1E293B;
}

.filter-tab.active {
    background-color: #4A90E2;
    color: #FFFFFF;
    border-color: #4A90E2;
}

.task-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.task-sort {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #1E293B;
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.task-sort:focus {
    border-color: #4A90E2;
}

.create-task-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    background-color: #4A90E2;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.create-task-btn:hover {
    background-color: #3A80D2;
}

/* Task Dashboard */
.task-dashboard {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #EBF8FF;
    color: #4A90E2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-icon.overdue {
    background-color: #FEF2F2;
    color: #EF4444;
}

.stat-icon.completed {
    background-color: #F0FDF4;
    color: #10B981;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-info .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1E293B;
}

.stat-info .stat-label {
    font-size: 14px;
    color: #64748B;
}

.stat-progress {
    position: relative;
    height: 8px;
    background-color: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #4A90E2;
    border-radius: 4px;
}

.progress-bar.overdue {
    background-color: #EF4444;
}

.progress-bar.completed {
    background-color: #10B981;
}

.progress-text {
    position: absolute;
    top: -18px;
    right: 0;
    font-size: 12px;
    color: #64748B;
}

.task-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.priority-distribution,
.project-progress {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.priority-distribution h3,
.project-progress h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
}

.priority-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 150px;
    margin-bottom: 8px;
}

.priority-bar {
    width: 40px;
    background-color: #4A90E2;
    border-radius: 4px 4px 0 0;
    position: relative;
    display: flex;
    justify-content: center;
}

.priority-bar.high {
    background-color: #EF4444;
}

.priority-bar.medium {
    background-color: #F59E0B;
}

.priority-bar.low {
    background-color: #10B981;
}

.priority-count {
    position: absolute;
    top: -24px;
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}

.priority-labels {
    display: flex;
    justify-content: space-around;
}

.priority-label {
    font-size: 12px;
    color: #64748B;
    text-align: center;
    width: 40px;
}

.priority-label.high {
    color: #EF4444;
}

.priority-label.medium {
    color: #F59E0B;
}

.priority-label.low {
    color: #10B981;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-name {
    font-size: 14px;
    color: #1E293B;
}

.project-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
}

.project-progress-bar {
    height: 8px;
    background-color: #F1F5F9;
    border-radius: 4px;
    overflow: hidden;
}

.project-progress-bar .progress {
    height: 100%;
    background-color: #4A90E2;
    border-radius: 4px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #64748B;
    background-color: transparent;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background-color: #F1F5F9;
    color: #1E293B;
}

.view-btn.active {
    background-color: #4A90E2;
    color: #FFFFFF;
    border-color: #4A90E2;
}

/* Task List View */
.task-list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: grab;
}

.task-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.task-item.overdue {
    border-left: 4px solid #EF4444;
}

.task-checkbox {
    margin-top: 4px;
}

.task-checkbox input[type="checkbox"] {
    display: none;
}

.task-checkbox label {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #CBD5E1;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.task-checkbox input[type="checkbox"]:checked + label {
    background-color: #10B981;
    border-color: #10B981;
}

.task-checkbox input[type="checkbox"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    font-size: 12px;
}

.task-content {
    flex: 1;
}

.task-content.completed {
    opacity: 0.6;
}

.task-content.completed .task-title {
    text-decoration: line-through;
}

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

.task-title {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
}

.task-priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #FFFFFF;
}

.task-priority.high {
    background-color: #EF4444;
}

.task-priority.medium {
    background-color: #F59E0B;
}

.task-priority.low {
    background-color: #10B981;
}

.task-description {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 12px;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.task-assignee img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.task-assignee span {
    font-size: 14px;
    color: #64748B;
}

.task-due-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748B;
}

.task-due-date.overdue {
    color: #EF4444;
}

.task-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.task-status.pending {
    background-color: #F1F5F9;
    color: #64748B;
}

.task-status.completed {
    background-color: #F0FDF4;
    color: #10B981;
}

.task-status.overdue {
    background-color: #FEF2F2;
    color: #EF4444;
}

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

.task-progress .progress-bar {
    width: 100px;
    height: 6px;
}

.task-progress span {
    font-size: 12px;
    color: #64748B;
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: transparent;
    border: none;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-action-btn:hover {
    background-color: #F1F5F9;
    color: #4A90E2;
}

.task-action-btn .count {
    font-size: 10px;
    margin-left: 2px;
}

.expand-task {
    color: #64748B;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.expand-task:hover {
    color: #4A90E2;
}

.expand-task.expanded {
    transform: rotate(180deg);
}

/* Kanban Board View */
.kanban-view {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    height: 600px;
    overflow-x: auto;
}

.kanban-column {
    background-color: #F8FAFC;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.kanban-column-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
}

.task-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #E2E8F0;
    font-size: 12px;
    font-weight: 500;
    color: #64748B;
}

.kanban-tasks {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 4px;
}

.kanban-tasks::-webkit-scrollbar {
    width: 4px;
}

.kanban-tasks::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 2px;
}

.kanban-tasks::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 2px;
}

.kanban-task {
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kanban-task:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.kanban-task.overdue {
    border-left: 3px solid #EF4444;
}

.kanban-task.completed {
    opacity: 0.7;
}

.kanban-task .task-priority {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    padding: 0;
}

.kanban-task h4 {
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    margin: 0 0 8px 0;
    padding-right: 16px;
}

.kanban-task p {
    font-size: 12px;
    color: #64748B;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

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

.kanban-task .due-date {
    font-size: 12px;
    color: #64748B;
}

.kanban-task .due-date.overdue {
    color: #EF4444;
}

.kanban-task .assignee img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFFFFF;
}

/* Task Modal */
.task-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.task-modal-content {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background-color: #FFFFFF;
    border-radius: 12px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #E2E8F0;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1E293B;
}

.close-modal {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background-color: #F1F5F9;
    color: #1E293B;
}

.task-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1E293B;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    color: #1E293B;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #4A90E2;
}

.subtasks-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.subtask-item {
    display: flex;
    gap: 8px;
}

.subtask-item input {
    flex: 1;
}

.remove-subtask {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: transparent;
    border: none;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-subtask:hover {
    background-color: #F1F5F9;
    color: #EF4444;
}

.add-subtask-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #4A90E2;
    background-color: transparent;
    border: 1px dashed #4A90E2;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-subtask-btn:hover {
    background-color: #EBF8FF;
}

.attachment-upload {
    margin-top: 8px;
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 120px;
    border: 2px dashed #CBD5E1;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: #4A90E2;
    background-color: #F8FAFC;
}

.upload-area i {
    font-size: 32px;
    color: #64748B;
}

.upload-area span {
    font-size: 14px;
    color: #64748B;
    text-align: center;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4A90E2;
}

.template-option label {
    font-size: 14px;
    color: #64748B;
}

.form-buttons {
    display: flex;
    gap: 16px;
}

.cancel-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748B;
    background-color: transparent;
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background-color: #F1F5F9;
    color: #1E293B;
}

.save-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    background-color: #4A90E2;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.save-btn:hover {
    background-color: #3A80D2;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .task-dashboard {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .task-charts {
        grid-template-columns: 1fr;
    }

    .kanban-view {
        grid-template-columns: repeat(2, 1fr);
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    .task-title-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .task-stats {
        width: 100%;
        justify-content: space-between;
    }

    .task-filters {
        flex-direction: column;
        gap: 16px;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .task-actions {
        width: 100%;
        justify-content: space-between;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .kanban-view {
        grid-template-columns: 1fr;
    }

    .task-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}