/* Phase sections */
.phase-task-section {
    margin-bottom: 0;
    border: none;
    border-bottom: 1px solid var(--gray-200, #e9ecef);
    border-radius: 0;
    overflow: hidden;
}

.phase-task-section:last-child {
    border-bottom: none;
}

.phase-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background-color: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    border: none;
    transition: all 0.2s ease;
}

.phase-header:hover {
    background-color: #e9ecef;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.phase-header.active {
    background: linear-gradient(135deg, #cfe2ff 0%, #e0ecff 100%);
    color: #001E46;
    border-left: 4px solid #001E46;
}

.phase-header.completed {
    background: linear-gradient(135deg, #d1e7dd 0%, #e2f5ea 100%);
    color: #0a3622;
    border-left: 4px solid #28A745;
}

.collapse-icon {
    font-size: 16px;
    transition: transform 0.2s ease;
    color: #6c757d;
}

.phase-progress {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    padding: 4px 12px;
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
}

/* Task items */
.tasks-container {
    background-color: white;
}

.task-item {
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background-color: #f8f9fa;
    border-left: 3px solid #001E46;
}

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

.task-checkbox {
    font-size: 28px;
    min-width: 32px;
    line-height: 1;
}

.task-order {
    font-size: 13px;
    color: #495057;
    font-weight: 700;
    min-width: 36px;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 6px;
    text-align: center;
}

.task-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    min-width: 280px;
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #212529;
}

.task-progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 200px;
}

.task-progress-bar .progress {
    flex: 1;
    min-width: 120px;
    height: 12px;
    border-radius: 6px;
    background-color: #e9ecef;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    min-width: 50px;
    text-align: right;
}

/* Task states */
.task-item.completed {
    background-color: #f0f9f4;
}

.task-item.completed .task-name {
    color: #28A745;
    font-weight: 600;
}

.task-item.completed .task-checkbox {
    color: #28A745;
}

.task-item.in-progress .task-name {
    color: #0066CC;
}

.task-item.in-progress .task-checkbox {
    color: #0066CC;
}

.task-item.skipped {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.task-item.skipped .task-name {
    text-decoration: line-through;
    color: #6c757d;
    font-style: italic;
}

.task-item.skipped .task-checkbox {
    color: #6c757d;
}

/* Activities */
.activities-container {
    margin-left: 64px;
    margin-top: 12px;
    margin-bottom: 12px;
    border-left: 3px solid #e0e0e0;
    padding-left: 24px;
    padding-bottom: 12px;
    background: linear-gradient(90deg, #f8f9fa 0%, white 100%);
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.activity-row:hover {
    border-color: #001E46;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.activity-row:last-child {
    margin-bottom: 0;
}

.activity-row.completed {
    background-color: #f0f9f4;
    opacity: 0.85;
}

.activity-row.completed:hover {
    border-color: #28A745;
}

.activity-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #212529;
    min-width: 200px;
}

.activity-due-date {
    width: 160px;
    font-size: 14px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.activity-due-date:focus {
    border-color: #001E46;
    box-shadow: 0 0 0 3px rgba(0,30,70,0.1);
}

/* Hide empty date placeholder */
.activity-due-date::-webkit-datetime-edit-text,
.activity-due-date::-webkit-datetime-edit-month-field,
.activity-due-date::-webkit-datetime-edit-day-field,
.activity-due-date::-webkit-datetime-edit-year-field {
    color: #495057;
}

.activity-due-date:invalid {
    color: #adb5bd;
}

.activity-user-dropdown {
    width: 200px;
    font-size: 14px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.activity-user-dropdown:focus {
    border-color: #001E46;
    box-shadow: 0 0 0 3px rgba(0,30,70,0.1);
}

/* Hide "Unassigned" text if possible */
.activity-user-dropdown option[value=""] {
    color: #adb5bd;
}

.completed-info {
    font-size: 13px;
    color: #28A745;
    font-weight: 500;
    padding: 6px 12px;
    background: #d1e7dd;
    border-radius: 12px;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .task-list-container {
        padding: 12px;
    }

    .task-name {
        max-width: 120px;
    }

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

    .activity-row {
        flex-wrap: wrap;
    }

    .activity-due-date,
    .activity-user-dropdown {
        width: 100%;
        margin-top: 4px;
    }
}

@media (max-width: 576px) {
    .task-list-container::before {
        content: "Vista de escritorio recomendada para gestión de tareas";
        display: block;
        padding: 20px;
        text-align: center;
        color: var(--gray-600, #6c757d);
        font-style: italic;
        background-color: var(--gray-100, #f8f9fa);
        border-radius: 8px;
        margin-bottom: 16px;
    }
}
